src/: Rust crate for thecc-switch-cliCLI.src/cli/: command parsing + interactive TUI flows.src/services/: core business logic (providers, MCP, prompts, config, env).
tests/: Rust integration tests (*.rs).docs/: design/refactor notes, release notes, and internal plans.scripts/: release/versioning helpers (shell + Node scripts).
Run commands from the repo root unless noted.
- Build debug binary:
cargo build - Build release binary:
cargo build --release - Run locally:
cargo run --bin cc-switch-cli -- --help - Run tests:
cargo test - Format:
cargo fmt - Lint (recommended):
cargo clippy --all-targets -- -D warnings
- Rust formatting is standard
rustfmt; don’t hand-format—runcargo fmt. - Use Rust conventions:
snake_casefor modules/functions,CamelCasefor types,SCREAMING_SNAKE_CASEfor constants. - Keep CLI output stable and user-facing strings i18n-aware (see
src/cli/i18n.rs).
- Tests live in
tests/*.rsand should avoid touching real user data; follow the existing pattern that isolatesHOME. - Prefer focused integration tests that exercise commands/services end-to-end.
- Follow existing commit patterns (mostly Conventional Commits):
feat: …,fix(scope): …,refactor: …,docs: …,chore: …. - PRs should include: what changed, why, how to test (
cargo test), and any user-facing updates (README/CHANGELOG).
- Never commit real API keys or personal config files; the app manages data under
~/.cc-switch-cli/and writes “live” configs for Claude/Codex/Gemini under their respective home directories.