
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
opencode-usage
Advanced tools
CLI tool for tracking OpenCode AI coding assistant usage and costs.
# Run directly with bunx (recommended, fastest)
bunx opencode-usage
# Or with npx (Node.js fallback)
npx opencode-usage
# Or install globally
bun add -g opencode-usage
npm install -g opencode-usage
# Show all usage data (daily breakdown)
opencode-usage
# Filter by provider
opencode-usage --provider anthropic
opencode-usage -p openai
# Show last N days
opencode-usage --days 30
opencode-usage -d 7
# Date range filtering
opencode-usage --since 20251201 --until 20251231
opencode-usage --since 2025-12-01
opencode-usage --since 7d # last 7 days
opencode-usage --since 1w # last week
opencode-usage --since 1m # last month
# Monthly aggregation
opencode-usage --monthly
opencode-usage -m --since 2025-01-01
# JSON output (for scripting)
opencode-usage --json
opencode-usage --monthly --json > usage.json
# Watch mode (live refresh every 5s)
opencode-usage --watch
opencode-usage -w -d 1
# Combine filters
opencode-usage --provider anthropic --since 7d --json
# Launch the web dashboard
opencode-usage --commander
# Custom port
opencode-usage --commander --commander-port 5000

The Commander provides a single-page web UI with:
┌────────────┬───────────────────────────────────┬────────────────┬──────────────┬────────────────┬────────────┐
│ Date │ Models │ Input │ Output │ Total Tokens │ Cost │
├────────────┼───────────────────────────────────┼────────────────┼──────────────┼────────────────┼────────────┤
│ 2025-12-30 │ - claude-opus-4-5 │ 173,440,372 │ 691,955 │ 174,132,327 │ $167.42 │
│ │ - claude-sonnet-4-5 │ │ │ │ │
│ │ [anthropic] │ 161,029,288 │ 618,355 │ 161,647,643 │ $162.06 │
│ │ [openai] │ 7,109,638 │ 56,201 │ 7,165,839 │ $5.36 │
├────────────┼───────────────────────────────────┼────────────────┼──────────────┼────────────────┼────────────┤
│ Total │ │ 395,521,798 │ 1,617,158 │ 397,138,956 │ $417.81 │
└────────────┴───────────────────────────────────┴────────────────┴──────────────┴────────────────┴────────────┘
This tool reads OpenCode session data from the SQLite database (opencode.db):
~/.local/share/opencode/opencode.db~/.local/share/opencode/opencode.db%LOCALAPPDATA%/opencode/opencode.dbRequires OpenCode v1.2.0+ (SQLite storage). It aggregates token usage by day and calculates estimated costs based on current API pricing.
If you're using OpenCode with a Claude Max/Pro subscription or OpenCode Zen credits, the actual cost to you is your subscription fee, not the API-equivalent cost shown here. The cost column shows what the equivalent API usage would cost for reference.
MIT
FAQs
CLI tool for tracking OpenCode AI coding assistant usage and costs
The npm package opencode-usage receives a total of 59 weekly downloads. As such, opencode-usage popularity was classified as not popular.
We found that opencode-usage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.