Repository navigation
fix(cli): require --yes flag for non-TTY atomic-agent update - #213
yablokolabs wants to merge 2 commits into
Conversation
359b18a to
1e2e40e
Compare
|
Hi @yablokolabs, apologies: this PR got no reply at all for six weeks, which is not how we want to treat a careful follow-up to #206. Thanks for rebasing it on Sep 30; it merges cleanly on current main and both CI jobs are green. The change reads well to us: a non-interactive run now refuses without --yes, the interactive prompt is unchanged, --check is untouched, and the in-app updater does not go through this path. One small ask: a line in the README update section about --yes, since scripts that run |
PR AtomicBot-ai#206 review: a non-TTY `update` (cron, CI, piped output) replaced the binary with no confirmation because the prompt was gated on isTTY() alone. This adds a --yes / -y flag; non-TTY invocations without it now refuse with exit 1 and a clear message. TTY invocations continue to prompt as before. --check is unaffected (it never installs). 7 new tests covering: non-TTY refusal (latest path), non-TTY refusal (--version path), --yes auto-confirm (non-TTY), -y short flag, --yes skips prompt in TTY, --version with/without --yes in TTY.
A script that runs `atomic-agent update` unattended now exits with code 1 unless it passes --yes. The README update paragraph did not say so.
1e2e40e to
fcac610
Compare
|
hi @sosidudku1 no worries n tnx. Done in fcac610: the README update paragraph now says that the command asks for confirmation, and that a non-interactive run (cron, CI, piped output) must pass |
Summary
Follow-up to PR #206 (review comment). A non-TTY
update(cron, CI, piped output) replaced the binary with no confirmation — the confirm prompt was gated onisTTY()alone, and no--yesflag existed.This adds
--yes/-y; non-TTY invocations without it now refuse with exit 1 and a clear message. TTY invocations continue to prompt as before.--checkis unaffected (it never installs).Changes
src/cli/update-command.ts—--yes/-yflag inparseArgs, non-TTY guard before bothrun()callsites,--yesdocumented in help textTest coverage
7 new tests (21 total, up from 14):
--yes(latest path and--versionpath)--yesauto-confirms in non-TTY-yshort flag works--yesskips prompt in TTY--versionwith/without--yesin TTYVerification
npm run lintclean