Skip to main content
ChatCLI keeps itself current. It detects which channel the running binary was installed through and applies updates through that exact channel — it never crosses channels, never fights your package manager, and never touches a build it didn’t produce.

Install-Channel Detection

Detection runs locally (no network) by combining the binary’s real path, the Go build metadata and the version stamp injected by the release CI:
The Homebrew check runs first on purpose: the bottle installed by the tap is the same stamped asset published on the GitHub release, so only the Cellar path distinguishes the two channels.

Why source builds are never auto-updated

A locally compiled binary may carry uncommitted patches. Replacing it with a release artifact would silently destroy that work, so ChatCLI only prints the way forward:

The /update Command

Bare /update is an explicit request: when a newer release exists on an automatable channel, it applies immediately — the same semantics as brew upgrade.
Before applying anything — and on /update check — ChatCLI shows the What’s new section: the highlights parsed straight from the GitHub release notes, which arrive in the same API response as the version check (no extra network call). /update check reports the same status but never applies anything. The same card backs /version and the -v/--version flag: installed build, detected install channel, latest release, the invitation to /update (plus the channel-native command when there is one) and the what’s-new section whenever an update exists. The command is also available from the interactive command palette and the tab completer, and /config update shows the resolved policy at any time.

Retries behind a proxy

Every network step of the update is retried (except a release check refused by GitHub’s API rate limit, which says when the limit lifts and stops there): the release check, checksums.txt, its signature, the binary download, brew upgrade and go install. A failed step gets 3 more attempts, 5 seconds apart by default (CHATCLI_UPDATE_RETRIES and CHATCLI_UPDATE_RETRY_DELAY change both), and each retry is announced with the real error the server or proxy returned:
A download cut halfway starts over from an empty staging file, so a partial binary is never installed. Statuses 403 (a proxy that blocks intermittently), 408, 425, 429 and 5xx are retried. Failures a retry cannot fix stop at once, with the same real error: a release that does not publish the file (404, also 410, 401 and 400), an invalid signature or checksum, a missing brew/go, the go install refusal for a tag with replace directives, and Ctrl+C, which also ends the pause. When every attempt fails, the last line points at the usual corporate cause: HTTPS_PROXY/NO_PROXY, and CHATCLI_CA_BUNDLE for a proxy that inspects TLS. The background auto-update uses the same retries without printing them.

One-shot: chatcli update

For scripts, CI and automation the same flow is available without entering the REPL:
Exit codes: 0 updated or already on the latest version (including check), 1 check/apply failure or a manual channel (Docker, source build) with a pending update, 2 invalid usage.

Verified Self-Replace

When the binary came straight from a GitHub release, ChatCLI updates it in place with a hardened pipeline:
  1. Downloads checksums.txt from the target release.
  2. Streams the platform asset to a staging file in the same directory as the binary (guaranteeing an atomic rename on the same filesystem) while computing its SHA-256.
  3. Refuses the install on any checksum mismatch — the download is discarded and the current binary is never touched.
  4. Swaps atomically: a plain rename on macOS/Linux (the running process keeps its old inode), or the rename-to-.old dance on Windows with automatic rollback if activation fails. Leftover artifacts are cleaned on the next boot.
Releases published before checksums.txt existed cannot be verified, and ChatCLI refuses unverified installs — you’ll get a manual-download instruction instead. This only affects updating to very old releases.
If the install directory isn’t writable (say, /usr/local/bin owned by root), the updater degrades to a copy-paste command:

Background Auto-Update (Staging)

Set CHATCLI_AUTO_UPDATE to control the boot-time behavior: Auto mode uses staging, the same model as Claude Code: the running process is never restarted or interrupted. The new binary lands on disk while you work, and the next start opens on the new version — announced once on the welcome screen:
In notify mode (the default) the welcome screen shows the invitation instead — the same one the /version card renders, including the native command of your detected install channel:
The banner is both instant and current: it trusts the last known release data even past the daily re-check window, and when that cache is stale the boot gives the refresh a short synchronous budget (about 1.5 s) before printing — so a release published overnight shows up on the very first banner, not one boot later. A fresh cache (at most one query per day) costs nothing, and off mode skips the network entirely. Only when the check can’t finish inside the budget (slow or absent network) does the announcement fall back to the running session, at the next prompt turn — you still don’t have to restart (or run /version) to find out:
The same in-session notice fires in auto mode when the silent staging fails (for example, the module proxy is unreachable), so a broken background update never hides a new release from you. When the staging succeeds during your session, the next prompt turn tells you the new version is already on disk:

Restarting on the New Version

The running process keeps the version it started with. /restart switches to the installed one without leaving your workflow:
  1. It saves the conversation — under its own name when the session is named, otherwise as an autosave-… session (nothing is saved for an empty conversation, or for an unnamed one when CHATCLI_SESSION_AUTOSAVE=false).
  2. It shuts down exactly like /exit: SessionEnd hooks, history, MCP servers, scheduler drain and cost snapshot.
  3. It starts the chatcli your command resolves to now, with the same arguments. A bare chatcli is looked up on PATH again — on Homebrew that is the symlink already pointing at the new Cellar, not the old versioned directory the process was loaded from. Release binaries and go install keep the same path.
  4. The new process announces the switch and reloads the conversation:
On macOS and Linux the process is replaced in place (same PID and terminal slot); on Windows the new process inherits the console and the old one exits with its exit code. /restart works on any channel — on Docker or a source build it is a plain restart. It is only available in the interactive terminal: scheduler jobs, the web UI and ACP clients cannot restart the process. A session connected to a server (chatcli connect) is resumed by the conversation hub instead of a local session file.
Homebrew is deliberately excluded from silent background updates. brew upgrade takes Homebrew’s global lock and can trigger a full brew update; ChatCLI only drives it when you explicitly run /update. Concurrent ChatCLI processes coordinate through a lock file, so only one performs the background update.

Configuration


Troubleshooting