mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 07:41:52 +08:00
Add a non-interactive doctor subcommand that checks API key reachability, OAuth credential state, config files, git, MCP servers, network access, and system metadata in one structured report. The implementation reuses existing runtime/auth plumbing and adds focused tests for parsing and report behavior. Also update stale runtime permission-mode tests so workspace verification reflects the current enum model rather than historical Prompt/Allow variants. Constraint: Keep diagnostics dependency-free and reuse existing runtime/auth/MCP code Rejected: Add a REPL-only slash command | diagnostics must work before a session starts Rejected: Split checks into multiple subcommands | higher surface area with less troubleshooting value Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Keep doctor checks bounded and non-destructive; if future probes become slower or stateful, gate them explicitly Tested: cargo fmt --all --check; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace; cargo run -p rusty-claude-cli -- doctor Not-tested: Positive live API-key validation path against a known-good production credential