Skip to content

docs(cli): the opencode quota subcommand is documented nowhere — no cli.mdx section, and neither of its env knobs is in the env table #1730

Open

Description

@dezren39

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 variadic provider argument ("Provider id, name, or alias (repeat for multiple)"), a --json flag, and an --all flag ("Include providers turned off in config (disabled_providers)").
  • The handler is substantial and behavior-rich: packages/cli/src/commands/handlers/quota.ts:29-47 header — 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.mdx documents 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 no quota section, and grep -n "quota" packages/web/src/content/docs/cli.mdx returns 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) and OPENCODE_QUOTA_CDP_URL (packages/ai/src/quota/cdp.ts:62, default http://127.0.0.1:19222) appear in no English docs page (grep -rn "OPENCODE_QUOTA" packages/web/src/content/docs services/www/src/docs/content outside 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.ts fails 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-vars is 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 ### quota section in the Commands list covering: the variadic provider argument (id/name/alias), --json, --all and 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) and OPENCODE_QUOTA_CDP_URL (default http://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 --json on 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-vars or record why the reverse check is not worth gating.

Activity

  1. added
    kind/docsDocumentation improvement or addition
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/cliPackage: cli (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 5, 2026
  2. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    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-375 defines the user-facing quota command (variadic provider arg, --json, --all), handlers/quota.ts:29-47 documents rich behavior in its header only, and English-docs greps return zero hits — no ### quota section in cli.mdx (which documents all 20 other subcommands), and neither OPENCODE_QUOTA_TIMEOUT_MS (handlers/quota.ts:50) nor OPENCODE_QUOTA_CDP_URL (cdp.ts:62) appears in any English docs page or the cli.mdx env table. check:doc-env-vars is 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.

  3. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · picked up for work; queue task 9979, lane 3fe37e8a-c61b-419c-9e97-769ecd264d5d.

  5. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 5, 2026
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · handed off to PR review. PR #1732 is open; local checks passed and no GitHub checks are currently reported.

  7. added
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/cliPackage: cli (pkgs/ or apps/ in this repo)area/typescriptTypeScript code areaeffort/sSmall: expected under 2 hours of workkind/docsDocumentation improvement or additionpriority/normalOrdinary priority (the default)queue/claimedA queue worker has claimed the task for this itemsource/creatorFiled by the new-issue-creator jobstatus/in-progressActively being workedtask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedAn agent holds this item via the queue (claimed task)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions