@codingstark/super-cmd
v0.3.3
Published
⚡ super-cmd: a friendly wrapper around the Command Code (cmd) CLI that adds live token usage, cost, budgets, and per-project/model spend. Run with `npx @codingstark/super-cmd` (installs the `scmd` command).
Maintainers
Readme
⚡ super-cmd
A friendly wrapper around the Command Code (
cmd) CLI that injects super tools — starting with live token usage & cost right in the bottom bar.
cmd is genuinely great — fast, clean, a joy to use. The one thing I kept wanting was to see my tokens and spend while I worked. So I built super-cmd: it wraps cmd and adds a live usage meter, budgets, session recaps, and per-project / per-model spend. It's an independent community tool, built with love for cmd. 💜
? for shortcuts $3.76 · 102.9M tok [ctrl+t] continuous learning ☐ TASTE
└──────────┬────────┘
injected by super-cmd╭─ ⚡ super-cmd · token usage · you ─╮
│ Spend $3.76 (avg $0.0036/run) │
│ Tokens 102.9M (102,869,508) │
│ ↑ input 102.0M 102,008,009 │
│ ↓ output 861.5K 861,499 │
│ Runs 1,037 ✓975 ✗62 │
│ Success 94.0% █████████████████░ │
╰─────────────────────────────────────────────────╯Install
No install needed — run it with npx:
npx @codingstark/super-cmd # pick your super tools, then launch cmdOr install globally:
npm i -g @codingstark/super-cmd
scmdRequires Node 18+ and the Command Code CLI (
npm i -g command-code). You must be logged in (cmd login) at least once.
Quick start — inject into cmd (recommended)
The easiest way: install once, then use everything inside cmd as slash
commands.
npx @codingstark/super-cmd install # pick features → adds /spend /cost /budget /recap … into cmdThen just run cmd and type:
/spend → token + $ cost dashboard, inside the chat
/cost → spend per project
/budget → set caps; the guard hook can deny tools over your daily cap
/recap → this session's $ + tokens + burn rate
/toolstats → which tools your runs concentrate on
/super-plan → plan-first with the super-planner agent
/harness → manage OmO skills
…
scmd uninstall # cleanly remove everything it injectedsuper-cmd never shadows cmd's own commands.
cmdhas built-in/usage,/context, and/plan— so our equivalents are named/spend,scmd context, and/super-plan. They sit alongside cmd's, never on top of them.
scmd install writes slash commands to ~/.commandcode/commands/, native agent
roles to agents/, and a verify hook to settings.json — all tracked and fully
reversible (it merges with, and never clobbers, your existing settings).
Or use it directly from the terminal
scmd # interactive: pick tools → launches cmd with them
scmd usage # one-off cost + token dashboard
scmd usage watch # live auto-refreshing dashboard (great in a tmux pane)
scmd bar install # show $ + tokens inside cmd's OWN bottom bar
scmd doctor # check everything is wired upHow it works (no magic, no scraping)
- The
cmdCLI stores your own API key at~/.commandcode/auth.json. - super-cmd reads that key and calls the same usage API your CLI already uses,
GET https://api.commandcode.ai/alpha/usage/summary— the data behind the/usagecommand. - It renders that data as a dashboard, a one-line statusline, or — if you opt
in — injected into
cmd's native bottom bar.
Your key never leaves your machine except in the Authorization header to
Command Code's own API. There is no estimation for the headline numbers —
cost and tokens come straight from the server. (Per-project/daily breakdowns
are local estimates from your transcripts, and are clearly labelled.)
Commands
| Command | What it does |
|---|---|
| scmd / scmd run | Pick super tools, then launch cmd (args after -- pass through) |
| scmd --pick | Force the tool picker |
| scmd usage | Cost + token dashboard (once) |
| scmd usage watch | Live auto-refreshing dashboard |
| scmd usage statusline | One line for tmux / shell prompts |
| scmd usage cost | Spend per project — real daily cost attributed to projects |
| scmd usage branches | Spend per git branch — real daily cost attributed to branches |
| scmd usage trend [--days N] | Daily spend curve — real cost per day |
| scmd usage anomaly | Today's spend vs your trailing average |
| scmd usage models | Spend per model — exact, needs scmd link (linked mode) |
| scmd usage json | Raw API JSON |
| scmd usage breakdown | Per-project token activity (local estimate) |
| scmd usage daily | Last 14 days of activity (local) |
Spend per project
╭─ 💸 spend per project (real daily cost) ─────────────────────────╮
│ PROJECT COST SHARE TOKENS │
│ acme-dashboard~ $4.99 ████████████████ 43.1% 131.9M │
│ side-project/web $1.41 █████░░░░░░░░░░░ 12.2% 46.6M │
│ … │
│ TOTAL $11.56 │
╰──────────────────────────────────────────────────────────────────╯The billing API isn't tagged with a project, but it supports since=<ISO>, which
returns cumulative spend from any instant to now. super-cmd computes the real
cost of each day you were active (since=day − since=day+1) and splits it
across the projects you touched that day, weighted by activity. Days you used a
single project are exact; days you bounced between projects are split
proportionally (marked ~). It costs ~1 API call per active day.
| scmd budget | Show today / session / month spend vs caps |
| scmd budget set --daily N --session N --mode warn\|block | Set spend caps |
| scmd recap [--notify] | This session's $ + tokens + burn rate |
| scmd report [--days N] [--out f] [--share] | Weekly markdown digest |
| scmd export [--days N] [--json] [--out f] | CSV/JSON spend export |
| scmd toolstats [--days N] | Which tools your runs concentrate on |
| scmd context [path] | Estimate session context size, flag bloat |
| scmd profile [add\|use\|remove] … | Multi-account: switch API keys |
| scmd tools | List super tools + live status |
| scmd enable/disable <id> | Toggle a tool for launch |
| scmd bar install/uninstall/status | Patch cmd's native bottom bar |
| scmd daemon | Run the background poller that feeds the bar |
| scmd config ... | Set interval / theme / segments / webhook / currency |
| scmd doctor | Diagnose auth, API, and patch state |
Budget guardrails
cmd has no spend controls. super-cmd adds them — caps for today, this session, and this month, computed from real spend windows:
scmd budget set --daily 5 --session 1 --mode warn # nudge when you cross a cap
scmd budget set --mode block # actually deny tools over the daily cap
scmd budget # gauges for today / session / monthIn warn mode you get a throttled heads-up in the bar; in block mode the
installed PreToolUse guard hook denies further tool calls once you're over the
daily cap (fail-open — any error allows the call, so it can never brick cmd).
Install the hook with scmd install (feature: Budget guardrails).
The older lifetime gauges still exist:
scmd config --max-cost 10 --max-tokens 150000000
scmd usage # shows lifetime budget bars + turns red near the limitSession recap
When a scmd run session ends you get a recap box — spend, tokens, runs, and
burn rate ($/hr) for that session. Run it any time with scmd recap, or add
--notify for a desktop ping. Inside cmd it's the /recap command.
Reports & export
scmd report --days 7 --out week.md # shareable markdown digest (totals, daily table, top projects)
scmd export --days 30 --out spend.csv # CSV (or --json) for accounting / invoicingInsights — where the spend goes
scmd toolstats # leaderboard of which tools your runs actually hit
scmd context # estimated context size of this session, with a bloat warningThese need the Insights feature installed (scmd install) — it adds a
PostToolUse hook that logs each tool call and warns when context gets large.
Alerts — desktop + webhook
scmd config --webhook https://hooks.slack.com/services/… # Slack or Discord URL, or any JSON endpoint
scmd config --notify false # turn off desktop notificationsBudget breaches, session recaps (--notify), and report --share route here.
Themes & bar segments
scmd config --theme ocean # default | mono | ocean | sunset
scmd config --segments cost,burn,budget # choose what the native bar showsBar segments: cost, tokens, burn ($/hr this session), budget (% of cap).
Profiles — multiple accounts
scmd profile add work --key user_… # or omit --key to snapshot the current login
scmd profile use work # work / personal / client, one switch
scmd profile # list (● = active)The active profile's key overrides ~/.commandcode/auth.json for every command.
Status line in tmux
set -g status-right '#(scmd usage statusline --no-color)'The native bar (optional)
cmd has no public statusline hook, so to draw inside its own footer
super-cmd applies a tiny, reversible patch to the installed cmd bundle:
- A one-time backup is written next to the bundle (
*.cmdmeter.bak). - It injects a 2-second-cached read of
~/.commandcode/.meter-linein front of the? for shortcutshint. scmd bar uninstallrestores the original byte-for-byte.
Keeping it fed. The bar only shows what something writes to .meter-line:
- Install the bar via
scmd install(feature: Native bottom bar) and a throttledPostToolUsehook refreshes it during a normalcmdsession — showing your lifetime spend + tokens (always populated). This is the zero-effort path: just usecmdas usual. - Launch via
scmd runand the bar shows this session's spend (session $0.12 · 1.2M tok, measured from launch viasince=). scmd daemonin a split pane is the manual fallback (lifetime totals).
Just
scmd bar install(patch only, no hook)? Then runcmdviascmd run, or keepscmd daemonrunning — otherwise the bar has nothing feeding it and will look static.
⚠️ Re-run scmd bar install after every cmd update — updates overwrite the
bundle. If cmd changes its UI code, the patch fails safely (it just won't
apply) and the dashboard / watch still work. Prefer zero-touch? Skip the bar
and keep scmd usage watch open in a split pane.
A
cmdupdate only ever affects the bar patch — your injected commands, agents, hooks, and all config survive.scmd doctortells you if the bar needs re-applying. Full details, plus clean-uninstall and manual-recovery steps, are in RECOVERY.md.
✅ Verified on cmd 0.40.15 (Jul 2026): patch re-applies cleanly; injected commands don't collide with cmd's built-ins; budget/insights hooks run on the supported
PreToolUse/PostToolUse/Stopevents.
Linked mode (per-model spend)
The CLI key only exposes lifetime/since totals — per-model spend lives in the web dashboard's per-run records. Opt in by storing a web session cookie:
scmd link # paste your commandcode.ai cookie (stored chmod 600, local only)
scmd usage models # exact $ per model: deepseek-v4-pro, MiniMax, web_search, …
scmd unlink # remove itWeb sessions expire every few days — re-run scmd link when they do. The cookie
is only ever sent to commandcode.ai.
Harness — bring OmO skills into cmd
Oh-My-OpenAgent (OmO) is a
powerful agent harness. Its skills use the same SKILL.md format cmd
already supports, so super-cmd can install them into cmd:
scmd harness list # list OmO skills (pulled from npm)
scmd harness install --all # or: install tech-debt-audit remove-deadcode …
scmd harness status
scmd harness uninstall --all⚠️ License: OmO is SUL-1.0 (Sustainable Use License — non-commercial), not MIT. super-cmd ships none of OmO's files: it pulls
oh-my-openagentfrom npm onto your machine (you accept their license) and copies the skills into your~/.commandcodefor personal, non-commercial use, keeping the license notice beside each skill. Only skills are bridged — OmO's multi-agent runtime, hooks, and MCPs are OpenCode/Codex-specific and are not ported. Simpler skills (tech-debt-audit,remove-deadcode,pre-publish-review) port best; ones that assume team-mode/MCPs may not fully work incmd.
Native harness (MIT)
scmd install (feature: Native harness) gives cmd an OmO-style
plan→execute→verify workflow, written from scratch and MIT-licensed:
- Agent roles in
agents/:super-planner,super-executor,super-verifier,super-explorer,super-oracle. - Loop commands:
/plan(decision-complete plan first),/start-work(execute step-by-step with verification),/loop(execute→verify until the verifier passes). - A verify-on-stop hook that reminds you (or runs
$VERIFY_CMD) before a turn is declared done.
This is inspired by OmO's design but contains none of its code — so it's yours to use and ship freely. For the real OmO skills/commands, use the OmO skills feature (SUL-1.0, non-commercial — see above).
Add your own super tool
super-cmd is a plugin host. A tool is just an object in src/tools/:
export default {
id: 'my-tool',
name: 'My Tool',
emoji: '✨',
hint: 'does a cool thing',
description: '…',
async status(cfg) { return 'ok'; }, // shown in `scmd tools`
async enable(cfg) { /* start */ return { stop(){}, summary(){} }; },
views: { /* `scmd usage <view>` style subcommands */ },
};Register it in src/tools/registry.mjs and it shows up in the picker, scmd
tools, and enable/disable. Already shipped: per-model cost split, session timer
- recap, git-aware cost-per-branch, budget guardrails, desktop/webhook alerts, anomaly detection, tool leaderboard, context-bloat warnings. Roadmap: team rollups across profiles, rate/throughput meter, cost-per-PR.
Development
npm test # zero-dependency checks incl. a patch round-trip
node bin/super-cmd.mjs doctorZero runtime dependencies. Pure ESM. Node's built-in fetch.
Disclaimer
Independent community project, not affiliated with or endorsed by Command Code. It only ever reads your own credentials and calls Command Code's own usage API with your key — no third-party servers, no scraping of other accounts. Use it on your own account. MIT licensed.
Made for the cmd community. If you like it, ⭐ the repo and tag the team. 🙌
