feat(cli): add ag init conversational onboarding with --model, --name, identity scaffolding#3270
Conversation
β¦, identity scaffolding Adds interview-style enhancements to ag init: - User name prompt (interactive) and --name flag (non-interactive) - --model flag for setting default model in non-interactive mode - Identity file scaffolding (.aegis/identity.md) when name provided - 5 new tests covering flags, identity file, and combinations Implements #3265
There was a problem hiding this comment.
Code Review β PR #3270
Summary
Clean feature addition for ag init conversational onboarding. 190 additions across 2 files with 5 new tests. Code quality is generally good, but I am requesting changes on the following:
π΄ Gate Failure β feat-minor-bump-gate
CI check failed: "Enforce approved minor bump label for feat PRs". This PR uses feat: prefix but lacks the required approved minor bump label. This blocks the merge gate (Gate #3: CI must be green).
Action: Add the appropriate label (e.g. approved-minor-bump) or a maintainer needs to approve the minor bump.
π‘ Dead Code β DEFAULT_IDENTITY_PATH
const DEFAULT_IDENTITY_PATH = '.aegis/identity.md';Declared but never referenced anywhere in the file. The identity path is instead constructed inline as join(dirname(configPath), 'identity.md'). Remove the unused constant.
π‘ UX Concern β --model silently ignored without --yes
Running ag init --model claude-opus-4 without --yes silently ignores the flag. This will confuse users. Options:
- Apply
--modelin interactive mode too (merge intobyoEnvafter the interactive prompts) - Or: print a warning when
--modelis passed without--yes - Or: document that
--modelrequires--yes
π‘ Identity file overwrite without --force guard
If .aegis/identity.md already exists, this PR silently overwrites it. The config file has --force protection, but the identity file does not. Consider checking existsSync(identityPath) and skipping unless --force is set, or at minimum printing a warning.
β What is Good
- Tests: 5 new tests covering all paths (interactive name,
--name,--model, empty name, combined flags). Solid coverage. - Error handling: try/catch around identity write with graceful degradation.
- Backward compat: Existing tests updated with the new name prompt (empty string input). No breakage.
- No security concerns: Name is local-only, no injection risk. Security scans all passed.
- Conventional commit title:
feat(cli):correct.
Verdict
Requesting changes. 4 items above (1 CI gate blocker, 1 dead code, 2 UX improvements). The core logic is sound β once these are addressed, this should be a clean approve.
β Argus ποΈ
There was a problem hiding this comment.
β Approved.
Clean feature addition β conversational onboarding for ag init with all the right pieces:
What's good:
- Name prompt,
--nameflag,--modelflag β all work correctly with proper interactive/non-interactive paths - Identity file scaffolding is a nice touch β
.aegis/identity.mdwith template structure - Empty name = no identity file (correct behavior, no junk files)
--modelcorrectly maps toANTHROPIC_DEFAULT_MODELin config- 5 new tests covering all combinations: standalone flags, interactive prompt, empty name, combined flags
- Existing tests updated for new prompt order
- Follows existing init.ts patterns consistently
π‘ Non-blocking:
- Identity template is mostly HTML comments β fine for a scaffold, but users who never customize it get a file that's essentially empty. Low priority.
CI green. Ready to merge pending approved-minor-bump label.
Summary
Enhances
ag initwith conversational onboarding features from #3265:--nameflag: Non-interactive mode sets identity name--modelflag: Non-interactive shortcut for default model (maps toANTHROPIC_DEFAULT_MODEL).aegis/identity.mdwhen name is providedWhat changed
src/commands/init.ts: Added name prompt,--model/--nameflags, identity file scaffoldingsrc/__tests__/cli-init.test.ts: Updated existing tests for new prompt order, added 5 new testsVerification
Closes #3265