Context
Part of #415 Phase 1 (auth foundation). The onboarding wizard (src/wizard/onboarding.ts) needs adaptation after auth profiles are relocated and the per-agent auth config field is introduced.
Decision: Wizard stays "one key, one runtime" simple. Multi-key rotation is a post-wizard concern.
Concrete changes
Import path updates (follows #415 item 1)
src/wizard/onboarding.ts imports from agents/auth-profiles/ → auth/
src/commands/onboard-*.ts — any auth profile imports follow relocation
Storage path update
upsertAuthProfile() calls write to new canonical location (follows resolveAuthStorePath() relocation)
Set auth field when key provided
- When user provides an API key during onboarding, write
agents.defaults.auth: "{profile-id}" to config
- Claude API key →
agents.defaults.auth: "anthropic:default"
- Claude OAuth →
agents.defaults.auth: "claude:oauth-token"
- Gemini →
agents.defaults.auth: "google:default"
- Codex →
agents.defaults.auth: "codex:default"
- OpenCode →
agents.defaults.auth: "{provider}:default" or "opencode:{VAR_NAME}"
Explicit skip semantics
- When user skips credential setup, write
agents.defaults.auth: false explicitly (CLI-native auth)
- Update skip guidance text to mention this means "CLI handles its own authentication"
Non-interactive mode
--anthropic-api-key, --auth-token, --gemini-api-key, --codex-api-key, --openai-api-key flags: same behavior — store profile + set auth field
- No key flags provided: set
auth: false
What does NOT change
Dependencies
Files likely touched
src/wizard/onboarding.ts — promptRuntimeCredential(), config write logic
src/commands/onboard-types.ts — no change expected (CLI flags stay the same)
src/commands/onboard-config.ts — applyOnboardingLocalWorkspaceConfig() may need auth field
src/commands/onboard-non-interactive.ts — mirror interactive auth field behavior
Context
Part of #415 Phase 1 (auth foundation). The onboarding wizard (
src/wizard/onboarding.ts) needs adaptation after auth profiles are relocated and the per-agentauthconfig field is introduced.Decision: Wizard stays "one key, one runtime" simple. Multi-key rotation is a post-wizard concern.
Concrete changes
Import path updates (follows #415 item 1)
src/wizard/onboarding.tsimports fromagents/auth-profiles/→auth/src/commands/onboard-*.ts— any auth profile imports follow relocationStorage path update
upsertAuthProfile()calls write to new canonical location (followsresolveAuthStorePath()relocation)Set
authfield when key providedagents.defaults.auth: "{profile-id}"to configagents.defaults.auth: "anthropic:default"agents.defaults.auth: "claude:oauth-token"agents.defaults.auth: "google:default"agents.defaults.auth: "codex:default"agents.defaults.auth: "{provider}:default"or"opencode:{VAR_NAME}"Explicit skip semantics
agents.defaults.auth: falseexplicitly (CLI-native auth)Non-interactive mode
--anthropic-api-key,--auth-token,--gemini-api-key,--codex-api-key,--openai-api-keyflags: same behavior — store profile + setauthfieldauth: falseWhat does NOT change
remoteclaw auth addsubcommand (out of scope for feat: unified auth + multimodal AgentRuntime — implementation plan #415)Dependencies
authconfig field)Files likely touched
src/wizard/onboarding.ts—promptRuntimeCredential(), config write logicsrc/commands/onboard-types.ts— no change expected (CLI flags stay the same)src/commands/onboard-config.ts—applyOnboardingLocalWorkspaceConfig()may needauthfieldsrc/commands/onboard-non-interactive.ts— mirror interactive auth field behavior