1 Commits

Author SHA1 Message Date
Yeachan-Heo
b200198df7 Make local environment failures diagnosable from the CLI
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
2026-04-01 00:59:57 +00:00
4 changed files with 728 additions and 481 deletions

3
rust/Cargo.lock generated
View File

@@ -1091,11 +1091,8 @@ dependencies = [
"compat-harness",
"crossterm",
"pulldown-cmark",
"reqwest",
"runtime",
"serde",
"serde_json",
"sha2",
"syntect",
"tokio",
"tools",

View File

@@ -84,15 +84,6 @@ cargo run -p rusty-claude-cli -- logout
This removes only the stored OAuth credentials and preserves unrelated JSON fields in `credentials.json`.
### Self-update
```bash
cd rust
cargo run -p rusty-claude-cli -- self-update
```
The command checks the latest GitHub release for `instructkr/clawd-code`, compares it to the current binary version, downloads the matching binary asset plus checksum manifest, verifies SHA-256, replaces the current executable, and prints the release changelog. If no published release or matching asset exists, it exits safely with an explanatory message.
## Usage examples
### 1) Prompt mode
@@ -171,7 +162,6 @@ cargo run -p rusty-claude-cli -- --resume session.json /memory /config
- `dump-manifests` — print extracted upstream manifest counts
- `bootstrap-plan` — print the current bootstrap skeleton
- `system-prompt [--cwd PATH] [--date YYYY-MM-DD]` — render the synthesized system prompt
- `self-update` — update the installed binary from the latest GitHub release when a matching asset is available
- `--help` / `-h` — show CLI help
- `--version` / `-V` — print the CLI version and build info locally (no API call)
- `--output-format text|json` — choose non-interactive prompt output rendering

View File

@@ -11,11 +11,8 @@ commands = { path = "../commands" }
compat-harness = { path = "../compat-harness" }
crossterm = "0.28"
pulldown-cmark = "0.13"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
runtime = { path = "../runtime" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10"
syntect = "5"
tokio = { version = "1", features = ["rt-multi-thread", "time"] }
tools = { path = "../tools" }

File diff suppressed because it is too large Load Diff