# Update


```sh
line update --check
line update
line update --check --json
```

`update` shows the installed version, the latest stable GitHub release, how
LINE CLI was installed, and which executable it found. It works without signing
in. `--check` only checks and tells you the next step; it never installs
anything or takes session locks. Other commands never check for updates.

| Installed with | What `line update` does |
| --- | --- |
| Official installer on macOS or Linux | Downloads, verifies, and replaces the executable when a newer stable release exists. |
| Homebrew | Prints `brew upgrade line-cli`; Homebrew keeps managing the executable. |
| Official installer on Windows | Prints a PowerShell installer command to run after this command exits. |
| Source build | Points to the release tag and the build instructions. |
| Anything else | Shows the release page and asks you to upgrade the way you installed. |

### When self-update works

The executable is replaced only for an official release build that has the
`.line-cli-install` receipt next to it, which the official installers write. A
copied binary, an older install without the receipt, or a source build is left
alone; upgrade it the way you installed it. Running the official installer again
also writes the receipt. Custom install folders work. On Windows, the printed
command sets `LINE_CLI_INSTALL_DIR` to the detected folder, so a custom location
is kept.

### Before you update

Stop running commands and watchers, including any service that restarts a
watcher. The replacement takes the watcher and session locks without reading
credentials, and won't proceed if either lock is busy. Don't run an installer at
the same time.

### How the update is installed

The updater downloads assets from the release tag it checked, verifies the
archive against that release's SHA-256 checksums, and stages the new executable
in the same folder before swapping it in with an atomic rename. If a download,
checksum, or extraction fails, the installed executable is untouched. Downloads
and extraction are size-limited. It never uses sudo, retries an install,
downgrades a newer version, or guesses the order of development or prerelease
builds.

### JSON output

`--json` writes one result to stdout, with diagnostics on stderr, and installs
exactly as the normal output would. Use **both `--check` and `--json`** for a
check that changes nothing. Fields include `current_version`, `latest_version`,
`status`, `installation`, `executable`, `can_self_update`, `release_url`, and
optional `instructions` and `upgrade_command`.

| `status` | Meaning |
| --- | --- |
| `update_available`, `up_to_date`, `ahead`, `unknown_version` | Result of a check. |
| `updated` | Installed. `latest_version` is now the installed version. |
| `updated_unconfirmed` | Replaced, but the folder couldn't be synced to disk. Run `line version` before trying again. |
| `failed` | The install didn't happen. |

`current_version` is always the version that started the command.
`can_self_update` says whether self-update is supported, not whether a newer
version exists.

Successful checks and printed instructions exit 0, even when an update is
available. Failed checks or installs exit nonzero. If the first check fails, no
JSON is written; after a failed install, the result is written before the error
exit. Cancellation uses the usual signal exit codes.


---
Source: https://kongesque.github.io/line-cli/guides/update/
