feat(cli): add atomic-agent update self-update command - #206
Conversation
0600eb6 to
fc70dc3
Compare
Headless / `run` / sidecar users never see the TUI's in-app update prompt. Add a first-class `atomic-agent update` command that checks GitHub Releases and re-runs the canonical installer in place, reusing the existing `src/update/` seam unchanged: - `atomic-agent update` — check, confirm when interactive, update in place - `atomic-agent update --check` — probe only, exit 0 on a successful check - `atomic-agent update --version <tag>` — install a pinned release - Follows the documented 0/1/2 CLI exit-code contract
fc70dc3 to
959cfe0
Compare
|
Reviewed while integrating this into the 0.3.3 build — it's in, and the command works. One finding worth a follow-up.
The confirm prompt is gated on # cron, CI, or just piping the output
atomic-agent update | tee update.log
Two ways out, either is fine: refuse in non-TTY unless Nothing else came up: the flag parsing, the pinned-tag path and the exit codes all read correctly, and the dependency seam makes it testable without touching the network. |
|
Follow-up addressing the non-TTY auto-confirm finding: #213 Adds |
Summary
The TUI offers an in-app self-update (startup check →
update_availableprompt → re-runinstall.shin place → restart handoff), but headless /run/serve/ sidecar users never see it — there is no CLI surface for updating the installed binary.This adds a first-class
atomic-agent updatecommand that reuses the existingsrc/update/module unchanged:atomic-agent update— checks GitHub Releases; confirms interactively when attached to a TTY; re-runs the canonical installer in place when a newer version existsatomic-agent update --check— probe only, reports current vs latest, exits 0 whenever the check itself succeedsatomic-agent update --version <tag>— installs a pinned release tag (still refuses dev builds, still confirms interactively)0success,1operational failure,2usage errornode/tsxdev runtimes (matchescanSelfUpdatesemantics); the running process is not restarted — the next launch picks up the new binary (installer already swaps atomically)Files
src/cli/update-command.ts— new command (+ injectable deps seam for tests)src/cli/update-command.test.ts— 15 tests (help, usage errors,--check, dev-build refusal, in-place update, streaming lines, interactive confirm/cancel, pinned version)src/cli/index.ts— registerupdatein COMMANDS + helpREADME.md— document the command next to the existing update notesTest Plan
npm run lint(tsc noEmit) passesnpx vitest run src/cli/update-command.test.ts— 15/15 passnpx vitest run src/cli/ src/update/— 112/112 passnpm run build+node dist/cli/index.js update --helpsmoke testsend-message-concurrency,llm-health-poller) that also fail on pristinemain(verified separately) — untouched by this change