feat: first-run onboarding wizard (provider + model selection) - #171
Merged
Conversation
…reachability probe
… non-secret test sentinel
…n dir 0700; harden dotenv test
… HOME-portable on windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a clean first-run onboarding wizard that replaces the silent hardcoded default (
ollama/gemma4:latest) with an interactive provider + model selection flow, persisting the choice so future runs need no prompts.name:base_url), select a model (live-listed when the endpoint is reachable, else a curated fallback), and enter an optional API key~/.raven/config.toml(0600) + API key in~/.raven/.env(0600),~/.ravendir locked to 0700--headless/--yolo/--acp/CI (non-TTY) and any existing config or explicit--provider/--model/RAVEN_PROVIDER~/.raven/.envat startup so the persisted key is picked up in the same sessionqwen3.8:latestMotivation
On a fresh install the very first model was chosen silently from a hardcoded builtin default — no onboarding, no config write-back, and the README claimed a first-run prompt that didn't exist. This PR makes the README true and gives users a real setup flow.
Changes
src/config/onboarding.rs(new): gate (needs_onboarding), path helpers, custom-provider parsing, fallback model lists, secret-free config/env serialization, 0600/0700 write helpers, and the interactiverun_onboardingwizardsrc/main.rs: loads~/.raven/.env, runs the wizard when interactive + unconfigured + un-overridden, reloads the env after onboardingsrc/config/mod.rs:load_global_dotenv()src/config/provider.rs: ollama builtin defaultgemma4:latest→qwen3.8:latestsrc/tui/mod.rs: exportfetch_live_provider_modelsaspub(crate)src/config/tests.rs: dotenv loader testREADME.md: first-run docs reflect the real wizardTest Plan
cargo test— 611 lib + 4 CLI, 0 failurescargo clippy --all-targets -- -D warningscleancargo fmt --checkcleancargo check --target x86_64-pc-windows-gnuclean.env+ 0700 dir; first-run key auth works in same sessionNotes for Reviewers
OpenOptions::modeat creation), a first-run API-key-not-loaded bug (fixed by reloading env post-wizard), and a~/.ravendir-perm gap (fixed to 0700) — all addressed in the review-fix commits.