fix(cli): require --yes flag for non-TTY atomic-agent update - #213
Open
yablokolabs wants to merge 1 commit into
Open
fix(cli): require --yes flag for non-TTY atomic-agent update#213yablokolabs wants to merge 1 commit into
yablokolabs wants to merge 1 commit into
Conversation
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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