Repository navigation
feat(cli): add qq init and mark config paths as present or missing (OB5) - #147
Merged
Merged
Conversation
`qq init [--project] [--model PROVIDER/MODEL] [--force]` writes a short, commented config.ron to the global directory (0700/0600) or to <cwd>/.qq/config.ron, validates it through the ordinary loader, and prints the path plus the next command (`qq auth login PROVIDER # or export VAR`, the browser sign-in for openai-codex, AWS for bedrock). It refuses to overwrite without --force. Without --model on a terminal it offers a numbered list of the built-in providers; without a terminal it errors. The model string is escaped so a quote cannot change the document. `qq config paths` now prints `global config` and appends (exists)/(missing) to every path. The quickstart's mkdir/heredoc/awk block is replaced by `qq init`. Closes ENG-879.
lg2m
force-pushed
the
feat/eng-879-init
branch
from
September 23, 2026 22:29
fc1bfa3 to
10a0bc5
Compare
lg2m
changed the base branch from
main
to
feat/eng-882-first-session-guidance
September 23, 2026 22:29
This was referenced Sep 23, 2026
2 of 6 tasks
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.
Plan slice OB5 of
docs/plans/onboarding-ux.md. Linear: ENG-879.User-visible behavior
qq initwrites a short, commented starterconfig.ron:--projectwrites<cwd>/.qq/config.roninstead, with a comment block aboutqq trustand gitignoredconfig.d/*-local.ronfragments, and addsnote: run qq trust so this project's model is loaded.--modelon a terminal, it lists the five built-in login providers with an example model each and accepts a number or a fullPROVIDER/MODEL. Without a terminal it errors:no --model given and stdin is not a terminal; pass --model PROVIDER/MODEL.<path> already exists; pass --force to overwrite.openai-codex, AWS credential chain forbedrock/bedrock-mantle, "declare it underproviders:" for anything else.qq config pathsnow printsglobal config: <global>/config.ronand appends(exists)/(missing)to every path.The quickstart's
mkdir+ heredoc +awkblock is replaced by oneqq initline (README too).Design notes
src/init.rswith injectedConfigPaths, cwd, reader, and writer (thedoctorpattern), so tests run against a temp tree;InitErroris athiserrorenum with actionable variants.create_newunless--force, mode 0600 in a 0700 global dir on unix; a project.qq/is repository content and keeps default modes.ConfigLoader::checkso the file the user runs with is the one that was checked.TrustRequiredis accepted (a project file that setsmodelis pending trust by design); any otherConfigErroris reported with the path so the user can edit it.qq-config: route parsing issplit_once('/')in the binary;ModelRoute::parsestays private.Docs
docs/guide/quickstart.md§ 2,docs/guide/configuration.md,docs/guide/cli.md(new## qq init,pathsrow),docs/guide/troubleshooting.md,README.md. Ledger: OB5 → In review; OB0 → Shipped (#128); OB6 → Shipped (#139).Verification
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace— 1790 passedcli::tests::parses_init…,init::tests::*): writes and validates, unix modes,--project+ trust note, refuse-then---force, four bad routes,ModelRequired, escaping round-trip, unknown provider surfaced asInvalid, codex/bedrock/other "next" lines, chooser by number / route / invalid answer,CHOICESnames equalLOGIN_PROVIDERS.cargo run -- init --help,cargo run -- config paths, interactive chooser under a pty.Performance / compatibility
Startup-neutral (new subcommand only).
qq config pathsoutput gains one row and a trailing marker per line; scripts that parsed it withawk '{print $2}'still get the path (the marker is a separate field), and the one such script in our docs was replaced.Notes
qq init(global) from inside an untrusted project directory validates only up toTrustRequired, so an unknown provider in the global file is not caught in that one case. Acceptable for this slice;qq config checkafterqq trustreports it.