Thanks for helping improve OpenUsage. This project is a Go terminal dashboard and local telemetry daemon for tracking AI coding tool usage, spend, quotas, and session activity.
- Search existing issues and pull requests before starting larger work.
- Open an issue or design note first for broad UI, telemetry, provider, storage, or workflow changes.
- Keep pull requests focused on one feature, fix, provider, or documentation change.
- Avoid committing credentials, local telemetry databases, API responses with sensitive headers, or user-specific config.
OpenUsage uses CGO because the Cursor and telemetry stores use SQLite through mattn/go-sqlite3.
make deps
CGO_ENABLED=1 go build ./cmd/openusageUseful commands:
make build
make run
make demo
make test
make vet
make fmtmake lint runs golangci-lint when the binary is installed and skips with a warning otherwise.
Use the existing package boundaries:
- CLI wiring lives in
cmd/openusage/. - Provider implementations live in
internal/providers/<provider>/. - Telemetry daemon, ingest, deduplication, and read models live in
internal/telemetry/andinternal/daemon/. - Bubble Tea views and components live in
internal/tui/. - Integration scripts and templates live in
plugins/. - Website and docs-site work lives under
website/anddocs/site/.
Provider changes should follow docs/skills/add-new-provider.md and update registration, detection, examples, and tests where
applicable.
- Use the standard Go
testingpackage. - Prefer table-driven tests with
t.Run. - Use
httptest.NewServerfor provider HTTP tests. - Use
t.TempDirfor filesystem tests. - Isolate and clean up environment variables in each test.
- Run targeted tests while developing, then run the broad checks before review:
go test ./internal/providers/... -v
go test ./internal/telemetry/... -v
go test ./internal/tui/... -v
make test
make vet- Run
make fmtbefore opening a pull request. - Keep imports grouped as standard library, third-party, then internal packages.
- Use
teaas the alias forgithub.com/charmbracelet/bubbletea. - Use
snake_casefor provider IDs and JSON fields. - Use pointer numerics for optional numeric values, such as
Limit *float64. - Return populated snapshots with
core.StatusAuth,core.StatusLimited, orcore.StatusErrorfor handled provider states. - Return an error for fatal execution failures.
- Prefix provider errors with the provider name, for example
fmt.Errorf("openai: ...: %w", err).
- Describe the user-facing behavior change.
- Link related issues.
- Add or update tests for changed behavior.
- Update docs or example config when behavior changes.
- List validation commands you ran.
- Do not include raw API keys, tokens, cookies, or private telemetry data in logs, fixtures, screenshots, or diagnostics.