#16033: fix: add model configuration step to onboard command
cli
commands
stale
size: XS
trusted-contributor
Cluster:
Image Model Enhancements
## Summary
This PR adds a `--model` CLI option to the non-interactive onboarding flow, allowing users to configure the default model during `openclaw onboard --non-interactive --install-daemon`. Previously, model configuration was only available in the interactive onboarding wizard, which caused confusion for users running non-interactive onboarding.
## Changes
- Added `model?: string` option to `OnboardOptions` type in `onboard-types.ts`
- Added `--model <model>` CLI option in `register.onboard.ts` (e.g., `--model anthropic/claude-3-5-sonnet-20241022`)
- Added model configuration step in `runNonInteractiveOnboardingLocal()` that applies the model using `applyPrimaryModel()`
- Added model to JSON output in `logNonInteractiveOnboardingJson()` for non-interactive mode
## Testing
- Lint passes with 0 errors
- Existing onboard-helpers e2e tests pass
## Usage Example
```bash
openclaw onboard --non-interactive --accept-risk --install-daemon \
--auth-choice openai-api-key --openai-api-key sk-xxx \
--model openai/gpt-4.1
```
Fixes openclaw/openclaw#16013
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds `--model` CLI option support to non-interactive onboarding, allowing users to configure the default model when running `openclaw onboard --non-interactive`. The implementation reuses the existing `applyPrimaryModel` function from the interactive wizard, properly trims input, and includes the model in JSON output.
- Added `--model <model>` CLI option in `register.onboard.ts` with example usage
- Extended `OnboardOptions` type to include optional `model` field
- Applied model configuration in `runNonInteractiveOnboardingLocal` after auth setup
- Included model in JSON output for programmatic consumption
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation follows established patterns, reuses existing tested utilities (`applyPrimaryModel`), properly handles edge cases (trimming, optional values), and maintains consistency with the interactive onboarding flow. The changes are minimal, focused, and the PR description indicates existing tests pass.
- No files require special attention
<sub>Last reviewed commit: 593fc22</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#16388: Fix: Show model selector during onboarding for all auth choices
by saurav470 · 2026-02-14
82.0%
#13079: feat: Add OpenAI-compatible API option to CLI for self-hosted models
by MikeWang0316tw · 2026-02-10
78.6%
#12191: fix: guard against undefined model.input in display and scan layers
by mcaxtr · 2026-02-09
74.4%
#20567: fix: validate model IDs against catalog before saving to config
by baja87 · 2026-02-19
73.9%
#16099: feat: add opencode-cli as CLI backend provider
by imwxc · 2026-02-14
73.4%
#21963: fix(cli): models fallbacks add now includes primary model in allowlist
by ashiabbott · 2026-02-20
73.3%
#20962: Fix/context window size for custom api provider
by r4jiv007 · 2026-02-19
73.0%
#13401: fix: slug generator should use agent's primary model instead of har...
by pahud · 2026-02-10
73.0%
#7051: Add io-intelligence model inference provider
by rajagurunath · 2026-02-02
72.5%
#4459: fix: enable image input for Kimi K2.5 and refresh stale config mode...
by manikv12 · 2026-01-30
72.0%