← Back to PRs

#16033: fix: add model configuration step to onboard command

by MisterGuy420 open 2026-02-14 06:03 View on GitHub →
cli commands stale size: XS trusted-contributor
## 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