fix(cli): ag init --force implies --yes, --yes creates config on partial state (#3345, #3354)#3391
Merged
Merged
Conversation
…ial state (#3345, #3354) #3354: --force now implies --yes (non-interactive). Previously, --force still prompted for 4 interactive questions. The docs say --force skips the confirmation prompt, which now matches behavior. #3345: --yes with partial state (no config.yaml but .aegis/ exists with other files like keys.json) now correctly creates config.yaml instead of silently skipping and claiming success. Fixes: #3345, #3354
Contributor
There was a problem hiding this comment.
✅ Approved.
Review gates checked:
- Full diff reviewed — logic is correct
--forceimplies--yesviaif (force) yes = true— clean, addresses #3354- The
existingConfigguard insideyes && !forceblock is the right fix for #3345 — previously it would skip write even when no config file existed - CI all green, no conflicts, targets develop
Both issues (#3345, #3354) are properly addressed. Ready to merge.
This was referenced May 14, 2026
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
Fixes #3345 and #3354 — two ag init flag handling bugs.
#3354: --force still prompts interactively
Problem:
ag init --forceprompted for 4 interactive questions despite docs saying it skips confirmation.Fix:
--forcenow implies--yes(non-interactive). All prompts are skipped.#3345: --yes skips config creation on partial state
Problem: With
--yes, if.aegis/exists with keys.json/state.json but no config.yaml, the CLI claims success but never creates config.yaml.Fix: The
--yesskip-write guard now only activates when an existing config is actually present. When there's no config file,--yescreates it.Verification