
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@ccusage/opencode
Advanced tools
Analyze OpenCode usage logs with the same reporting experience as
ccusage.
# Recommended - always include @latest
npx @ccusage/opencode@latest --help
bunx @ccusage/opencode@latest --help
# Alternative package runners
pnpm dlx @ccusage/opencode
pnpx @ccusage/opencode
# Using deno (with security flags)
deno run -E -R=$HOME/.local/share/opencode/ -S=homedir -N='raw.githubusercontent.com:443' npm:@ccusage/opencode@latest --help
Since npx @ccusage/opencode@latest is quite long to type repeatedly, we strongly recommend setting up a shell alias:
# bash/zsh: alias ccusage-opencode='bunx @ccusage/opencode@latest'
# fish: alias ccusage-opencode 'bunx @ccusage/opencode@latest'
# Then simply run:
ccusage-opencode daily
ccusage-opencode monthly --json
💡 The CLI looks for OpenCode usage data under
OPENCODE_DATA_DIR(defaults to~/.local/share/opencode).
# Daily usage grouped by date (default command)
npx @ccusage/opencode@latest daily
# Weekly usage grouped by ISO week
npx @ccusage/opencode@latest weekly
# Monthly usage grouped by month
npx @ccusage/opencode@latest monthly
# Session-level detailed report
npx @ccusage/opencode@latest session
# JSON output for scripting
npx @ccusage/opencode@latest daily --json
# Compact mode for screenshots/sharing
npx @ccusage/opencode@latest daily --compact
Useful environment variables:
OPENCODE_DATA_DIR – override the OpenCode data directory (defaults to ~/.local/share/opencode)LOG_LEVEL – control consola log verbosity (0 silent … 5 trace)--json--compact flag for narrow terminals, perfect for screenshotsOpenCode stores cost: 0 in message files, so this CLI calculates accurate costs from token usage data using the LiteLLM pricing database. All models supported by LiteLLM will have accurate pricing.
OpenCode stores usage data in:
~/.local/share/opencode/storage/message/{sessionID}/msg_{messageID}.json~/.local/share/opencode/storage/session/{projectHash}/{sessionID}.jsonEach message file contains token counts (input, output, cache.read, cache.write) and model information.
For detailed guides and examples, visit ccusage.com.
Check out ccusage: The Claude Code cost scorecard that went viral
MIT © @ryoppippi
FAQs
Deprecated compatibility package. Use npx ccusage instead.
The npm package @ccusage/opencode receives a total of 614 weekly downloads. As such, @ccusage/opencode popularity was classified as not popular.
We found that @ccusage/opencode 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.