npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ocusage

v1.0.2

Published

OpenCode usage tracker - Track and analyze your Claude Code usage with detailed reports

Readme

ocusage - opencode Usage Tracker

A command-line tool to track and analyze your opencode usage with detailed reports.

Overview

ocusage is an unofficial CLI tool designed to help developers track and analyze their usage of opencode. This utility provides detailed reports on token consumption, costs, and model breakdowns, helping you gain insights into your development activities.

Disclaimer: This tool is not affiliated with, endorsed by, or officially supported by the opencode project or its creators.

Features

  • Daily Reports: Get a summary of your opencode usage on a daily basis.
  • Weekly Reports: View aggregated usage data for each week.
  • Monthly Reports: Analyze your monthly opencode consumption and costs.
  • Session Reports: Track usage within specific coding sessions.
  • Hourly Reports: Break down usage by hour for granular analysis.
  • Today's Report: Quickly generate a report for the current day's usage.
  • JSON/XML Output: Export reports in machine-readable formats for further processing.
  • Detailed Model Breakdown: See which models are being used and their individual contributions to your overall usage.
  • Configurable Data Directory: Specify where your opencode usage data files are stored.

Installation

Global Installation (Recommended)

npm install -g ocusage

or with bun:

bun install -g ocusage

Local Installation

npm install ocusage

Development Installation

If you want to contribute or run from source:

  1. Clone the repository:

    git clone https://github.com/yourusername/ocusage.git
    cd ocusage
  2. Install dependencies:

    npm install
    # or
    bun install
  3. Build the project:

    npm run build
    # or
    bun run build
  4. Run during development:

    # With bun (arguments passed directly)
    bun run start today --show-models=false
       
    # With npm (requires -- to pass arguments)
    npm run start -- today --show-models=false

Usage

After global installation, use the ocusage command directly:

ocusage <command> [options]

General Options

These options can be used with most commands:

  • --data-dir <path>: Specify the directory where opencode usage data files are located. (Default: ~/.local/share/opencode/project)
  • --since <YYYY-MM-DD>: Start date for the report.
  • --until <YYYY-MM-DD>: End date for the report.
  • --json: Output the report in JSON format.
  • --xml: Output the report in XML format (overrides --json).
  • --show-models: Show detailed model breakdown in reports (default: true).

Commands

today

Generates a report for the current day's opencode usage.

ocusage today

daily

Generates a daily report of opencode usage within a specified date range.

ocusage daily --since 2023-01-01 --until 2023-01-31

weekly

Generates a weekly report of opencode usage.

ocusage weekly --since 2023-01-01 --until 2023-03-31

monthly

Generates a monthly report of opencode usage.

ocusage monthly --since 2023-01-01 --until 2023-12-31

session

Generates a report of opencode session usage.

ocusage session

hourly

Generates an hourly report of opencode usage.

ocusage hourly

live

(Experimental) Monitors opencode usage in real-time.

ocusage live

Configuration

The default data directory for opencode usage files is ~/.local/share/opencode/project. You can override this using the --data-dir option.

Acknowledgments

This project was inspired by and builds upon the excellent work of:

  • ccusage - A similar usage tracker that provided inspiration for the interface and functionality
  • opencode - The project that makes the usage data available for analysis

Special thanks to the maintainers and contributors of these projects for their innovative work in the developer tooling space.

Contributing

Contributions are welcome! If you'd like to contribute to ocusage, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and test them locally.
  4. Submit a pull request with a clear description of your changes.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.