Skip to content

fix(cli): require --yes flag for non-TTY atomic-agent update - #213

Open
yablokolabs wants to merge 2 commits into
AtomicBot-ai:mainfrom
yablokolabs:fix/update-yes-flag
Open

yablokolabs wants to merge 2 commits into
AtomicBot-ai:mainfrom
yablokolabs:fix/update-yes-flag

Conversation

@yablokolabs

Copy link
Copy Markdown
Contributor

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 on isTTY() alone, and no --yes flag 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. --check is unaffected (it never installs).

Changes

  • src/cli/update-command.ts — --yes/-y flag in parseArgs, non-TTY guard before both run() callsites, --yes documented in help text

Test coverage

7 new tests (21 total, up from 14):

  • Non-TTY refuses without --yes (latest path and --version path)
  • --yes auto-confirms in non-TTY
  • -y short flag works
  • --yes skips prompt in TTY
  • --version with/without --yes in TTY

Verification

  • npm run lint clean
  • 107/107 CLI tests pass

@sosidudku1

Copy link
Copy Markdown
Collaborator

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 atomic-agent update unattended today will start exiting 1. If you would rather not, we can add it on our side during review.

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.
@yablokolabs

yablokolabs commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

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 --yes / -y or it installs nothing and exits with code 1. The branch is also rebased onto current main (606ef73); lint, docs:check and update-command.test.ts (21/21) pass locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants