Repository navigation
Description
docs(cli): the opencode quota subcommand is documented nowhere — no cli.mdx section, and neither of its env knobs is in the env table
Verified 2026-11-05 on origin/main 255fa099f2d2028df0ba6374596c136ab4dbd15c (merge of PR #1728), in a laptop worktree, by direct reads (each grep run against the English docs tree):
Evidence
- The command exists and is user-facing:
packages/cli/src/commands/commands.ts:360-375—Spec.make("quota", { description: "Show provider quota usage", … })with a variadicproviderargument ("Provider id, name, or alias (repeat for multiple)"), a--jsonflag, and an--allflag ("Include providers turned off in config (disabled_providers)"). - The handler is substantial and behavior-rich:
packages/cli/src/commands/handlers/quota.ts:29-47header — assembles quota from the running server's credential list with a read-only local credential-store fallback, skips disabled providers unless--all, always fetches named providers, and exits non-zero when a requested provider produced no successful result. None of this behavior is discoverable from the docs. packages/web/src/content/docs/cli.mdxdocuments every other subcommand in its own###section (agent, attach, auth, github, mcp, models, run, serve, session, stats, export, import, web, acp, plugin, pr, db, debug, uninstall, upgrade — lines 55-660). There is noquotasection, andgrep -n "quota" packages/web/src/content/docs/cli.mdxreturns zero hits.- Both env knobs are likewise undocumented:
OPENCODE_QUOTA_TIMEOUT_MS(packages/cli/src/commands/handlers/quota.ts:50, default 30_000, accepted range 1..2_147_483_647) andOPENCODE_QUOTA_CDP_URL(packages/ai/src/quota/cdp.ts:62, defaulthttp://127.0.0.1:19222) appear in no English docs page (grep -rn "OPENCODE_QUOTA" packages/web/src/content/docs services/www/src/docs/contentoutside locale dirs: zero hits), including cli.mdx's Environment variables table (line 676+). - The existing guard cannot catch this direction:
script/check-doc-env-vars.tsfails only when a documented variable has no reader (docs→code). A whole subcommand plus its knobs landing with no docs at all (PRs feat(ai): provider quota functions and opencode quota subcommand #1722/fix(ai): retire anti-slop findings in quota code #1728, ~4,700 lines of quota code) passes every gate —check:doc-env-varsis green on this main.
Why it matters
Quota is this fork's headline surface — routes demote, gate, and fail over on quota readings (#587 design: one quota signal, three consumers), and the handler header calls opencode quota "the single source for quota info (code#6125)". A user who does not already know the command exists cannot find it: it is absent from the canonical CLI reference they copy from, and its two tuning knobs (timeout, CDP bridge URL) are discoverable only by reading source. This is the reverse of the #103-#116 dead-docs class the doc-env gate was built for, and it is currently ungated.
Acceptance criteria
- cli.mdx gains a
### quotasection in the Commands list covering: the variadic provider argument (id/name/alias),--json,--alland the disabled-provider rule, where credentials come from (running server, local-store fallback), and the non-zero exit when a requested provider yields no successful result. - cli.mdx's Environment variables table documents
OPENCODE_QUOTA_TIMEOUT_MS(default 30000, valid range) andOPENCODE_QUOTA_CDP_URL(defaulthttp://127.0.0.1:19222, what the CDP bridge is for). - The section's examples match the real output shape of the handler (verify against
opencode quota/opencode quota --jsonon a configured machine, not invented output). - Optional but welcome: note the reverse-direction gap (implemented-but-undocumented commands/knobs) on the doc-env gate — either extend
check:doc-env-varsor record why the reverse check is not worth gating.
Activity
dezren39 commentedon Nov 5, 2026
state: filed
agent: new-issue-creator-opencode
Found via: filed this run (2026-11-05) — verified on origin/main 255fa09 (PR #1728 merge) in a laptop worktree:
commands.ts:360-375defines the user-facingquotacommand (variadic provider arg,--json,--all),handlers/quota.ts:29-47documents rich behavior in its header only, and English-docs greps return zero hits — no### quotasection in cli.mdx (which documents all 20 other subcommands), and neitherOPENCODE_QUOTA_TIMEOUT_MS(handlers/quota.ts:50) norOPENCODE_QUOTA_CDP_URL(cdp.ts:62) appears in any English docs page or the cli.mdx env table.check:doc-env-varsis green on this main because it only guards the docs→code direction. Dedup: title/keyword search over open + closed issues returned no covering issue (nearest are the closed reverse-direction dead-docs class #103-#116 and mcpx precedent #47). Queued as a triage packet on repo-health-opencode-pilot. Not self-solved: the section's examples must be verified against real handler output on a configured machine, which is the worker's step.dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up for work; queue task 9979, lane 3fe37e8a-c61b-419c-9e97-769ecd264d5d.
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off to PR review. PR #1732 is open; local checks passed and no GitHub checks are currently reported.