Skip to content

feat(opencode): add opencode-go support#71

Open
aaronflorey wants to merge 3 commits into
onllm-dev:mainfrom
aaronflorey:feat/add-opencode-go
Open

feat(opencode): add opencode-go support#71
aaronflorey wants to merge 3 commits into
onllm-dev:mainfrom
aaronflorey:feat/add-opencode-go

Conversation

@aaronflorey
Copy link
Copy Markdown

Summary

Add OpenCode Go provider tracking to onWatch. OpenCode Go (from opencode.ai) provides AI code completion through the Claude Code CLI ecosystem with a subscription-based quota model.

Changes

  • New provider: opencodego — cookie-based auth, scrapes usage from opencode.ai's dashboard
  • Three quota windows: Rolling, Weekly, Monthly (with reset timers and rate-limit status)
  • Config: OPENCODEGO_COOKIE (required) + OPENCODEGO_WORKSPACE_ID (optional, skips workspace resolution)
  • Dashboard: Full card + both-chart views with per-window color mapping
  • Store & tracker: Snapshot persistence, reset cycle detection, per-window summaries
  • Agent: Background polling with notification support

Setup

Set OPENCODEGO_COOKIE to the opencode_session cookie value from opencode.ai. Optionally set OPENCODEGO_WORKSPACE_ID to skip automatic workspace resolution.

Files

internal/api/opencodego_client.go       # HTTP client (dashboard scraping)
internal/api/opencodego_types.go        # Types + parsing
internal/api/opencodego_types_test.go   # Parsing tests
internal/agent/opencodego_agent.go      # Polling agent
internal/tracker/opencodego_tracker.go  # Usage tracker
internal/store/opencodego_store.go      # SQLite persistence
internal/config/config.go               # Config + env vars
internal/web/handlers.go               # API endpoints
internal/web/static/app.js             # Dashboard charts
main.go                                # Wiring

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.

1 participant