| name | ax-onboarding |
| description | Use when modifying the first-run setup, configuration wizard, bootstrap ritual, or profile defaults in src/onboarding/ and src/cli/bootstrap.ts |
Overview
The onboarding system handles first-run configuration via a minimal 3-question wizard (profile → LLM provider → API key), generates a minimal ax.yaml, and stores credentials directly in the SQLite database. It also supports reconfiguration.
Key Files
| File | Responsibility | Key Exports |
|---|
src/onboarding/wizard.ts | Config generation, minimal ax.yaml + database credential storage | runOnboarding(), loadExistingConfig(), openCredentialStore() |
src/onboarding/prompts.ts | Profile names, LLM providers, default models | PROFILE_NAMES, PROFILE_DISPLAY_NAMES, LLM_PROVIDERS, DEFAULT_MODELS |
src/onboarding/configure.ts | Interactive @inquirer/prompts 3-question wizard | runConfigure() |
src/cli/bootstrap.ts | Agent identity reset ritual | resetAgent() |
Programmatic Onboarding
runOnboarding(opts) generates config files from OnboardingAnswers:
interface OnboardingAnswers {
profile: 'paranoid' | 'balanced' | 'yolo';
llmProvider?: string;
model?: string;
apiKey?: string;
}
Output files:
ax.yaml -- Minimal config (profile + models.default only, all other fields use Zod schema defaults)
- Credentials stored directly in SQLite database (
~/.ax/data/ax.db) via openCredentialStore()
Interactive Configuration
runConfigure() uses @inquirer/prompts:
- Profile selection (paranoid/balanced/yolo)
- LLM provider selection (anthropic/openai/openrouter/groq/deepinfra)
- Model name input (with provider-specific default)
- API key input (password field, masked)
Common Tasks
Adding a new security profile:
- Add profile to
PROFILE_NAMES in prompts.ts
- Add display name to
PROFILE_DISPLAY_NAMES in prompts.ts
- Add profile choice to interactive wizard in
configure.ts
- Add default values in
config.ts Zod schema
- Add test in
tests/onboarding/wizard.test.ts
Adding a new LLM provider to onboarding:
- Add to
LLM_PROVIDERS array in prompts.ts
- Add default model to
DEFAULT_MODELS
- Add provider implementation in
src/providers/llm/<name>.ts
- Register in
src/host/provider-map.ts
Gotchas
- Credentials stored in database, not .env file. The wizard opens SQLite directly via
openCredentialStore().
- Reconfigure flow loads existing API key from database and shows masked version as default.
- Provider defaults live in config.ts Zod schema, not in PROFILE_DEFAULTS. The wizard only writes profile and models.default to ax.yaml.
- Bootstrap preserves per-user state:
resetAgent keeps users/ directory.
- claude-code models optional: claude-code agents can omit
models.default entirely.
- Channel config is per-profile: Different profiles may want different channel defaults.