Everything Command Code (commandcode.ai) usage: a terminal dashboard with a
built-in MCP server, and an opencode provider. One Cargo workspace shares the
plan table and window math via cmduse-core; the opencode plugin is a
separate TS package that registers the providers and delegates usage
rendering to the cmduse CLI.
| Component | Crate / dir | Install | Docs |
|---|---|---|---|
cmduse CLI |
cli/ (crate cmd-usage, bin cmduse) |
crates.io · brew | cli/README.md · man page |
| Shared core | core/ (crate cmduse-core) |
crates.io | docs.rs/cmduse-core · versioned on its own 1.x line, not as a pair with the CLI |
| opencode plugin | opencode/ (@jeffreyjyz/opencode-command-code) |
npm | opencode/src/index.ts |
brew install JeffreyJYZ/tap/cmduse # macOS (Homebrew)
cargo install cmd-usage # any platform with RustThen run cmduse for the live dashboard, or cmduse plans / cmduse models.
Full usage, config, and statusline docs live in cli/README.md.
cargo build # all Rust crates
cargo test # core + cli (host tests)
cargo fmt --all -- --check # formatting (CI gate)
cargo clippy --all-targets -- -D warnings
cargo package -p cmduse-core --allow-dirty # ships plans.json+gating.json
cd opencode && bun install && bun test # conformance vectors too
bun run extract # regen core/gating.json (needs CLI)Shared truth lives in core/: plans.json (plan table/caps), gating.json
(model categories + per-plan access), conformance.json (behavior vectors).
core/build.rs bakes plans/gating into Rust consts; the opencode plugin's
model-gating layer imports gating.json and asserts the gating subset of the
vectors (usage/window math is the Rust core's alone since plugin 0.2.0).
Providers (command-code-anthropic, command-code-openai), a live gated
model list, /usage (TUI slash command, alias /cmd-usage), and the
cmd_usage tool — for both opencode v1 (≥1.18.29) and v2 (≥2.0.0) from
one package.
Requires the cmduse CLI (usage windows/pace rendering live in the Rust
core — the plugin spawns it):
brew install JeffreyJYZ/tap/cmduseInstall (opencode v2 uses plugins; v1's singular plugin is auto-normalized):
{
"plugins": ["@jeffreyjyz/opencode-command-code"]
}Auth, in host order: opencode's own connection — /connect and pick
"Command Code" (or the CMD_API_KEY env method) — then our fallback
~/.commandcode/auth.json from cmd login. With no credential at all the
providers stay activation: "auto", so a later /connect lights them up
without a restart.
cmduse mcp runs an MCP stdio server (hand-rolled JSON-RPC, no extra deps)
exposing five tools: usage (dashboard), plans (comparison table),
models (live gated list), daily, and hourly — the same output the CLI
subcommands print, with auth and ~/.commandcode/auth.json shared.
Zed (~/.config/zed/settings.json):
{
"context_servers": {
"cmduse": { "source": "custom", "command": "cmduse", "args": ["mcp"] }
}
}Any other MCP host: run cmduse mcp as a stdio server. The opencode plugin
doesn't need it — it registers its own providers and spawns cmduse directly.
0.1.x duplicated pure logic across two Rust crates (e.g. the burn-rate pace
gate was patched in two files for one bug). The workspace moves all shared
math into core/; cli/ keeps only its presentation + I/O. The Zed
extension (deprecated 0.6.9) was replaced by the built-in MCP server — one
integration serves every MCP-capable host instead of one hand-maintained
WASM product per editor.
MIT — see cli/LICENSE-MIT, core/LICENSE-MIT, and opencode/LICENSE.