Skip to content

feat: add status CLI subcommand for terminal diagnostics#170

Open
H-TTTTT wants to merge 1 commit into
slkiser:mainfrom
H-TTTTT:feat/issue-163-status-cli
Open

feat: add status CLI subcommand for terminal diagnostics#170
H-TTTTT wants to merge 1 commit into
slkiser:mainfrom
H-TTTTT:feat/issue-163-status-cli

Conversation

@H-TTTTT

@H-TTTTT H-TTTTT commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Fixes #163

Adds opencode-quota status — a terminal equivalent of the /quota_status slash command, so CI scripts, SSH sessions, and desktop debugging can access diagnostics without launching OpenCode.

Features

  • Plain-text output (same format as /quota_status)
  • --json for scripts: { version, generatedAt, config, providers, pricing, liveProbes }
  • --provider <id> to filter to one provider
  • Exit codes: 0 success, 1 error/disabled, 2 no comparable data (--json only)
  • --threshold rejected with redirect to show --json --threshold
  • Fully local and deterministic — no LLM/model API calls

Implementation

Reuses existing buildQuotaStatusReport via extracted buildStatusReportData (refactor; TUI behavior unchanged).

Test plan

  • 13 new cli-status tests + 3 dispatch tests
  • Full suite: 1215 passed (121 files)
  • pnpm run typecheck + pnpm run build — clean
  • Prettier clean

Adds `opencode-quota status` so terminal users can access the same
diagnostics as the `/quota_status` slash command without launching
OpenCode.

- Plain-text report reuses buildQuotaStatusReport (identical format to
  the slash command). Report gathering is extracted into a shared,
  exported buildStatusReportData() that returns both the rendered text
  and a structured payload, keeping the slash-command path unchanged.
- --json emits { version, generatedAt, config, providers, pricing,
  liveProbes }.
- --provider <id> filters provider availability and live probes to one
  provider.
- Rejects --threshold with a redirect to `show --json --threshold`.
- Exit codes: 0 success, 1 error/disabled, 2 no comparable provider
  data (--json only).
- Fully local/deterministic report building; no LLM/model API calls.

Fixes slkiser#163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Add opencode-quota status CLI subcommand for terminal diagnostics

1 participant