open-index/open-npm huggingface dataset:
npm package: @huakunshen/ocusage
Description: CLI tool to display per-session token usage statistics from OpenCode.
Author: Huakun Shen
Latest version: 0.0.0

# ocusage

A CLI tool to display per-session token usage statistics from [OpenCode](https://opencode.ai).

## Installation

### Using npx (npm)

```bash
npx @huakunshen/ocusage
```

### Using bunx (Bun)

```bash
bunx @huakunshen/ocusage
```

### Global Installation

```bash
# npm
npm install -g @huakunshen/ocusage

# bun
bun install -g @huakunshen/ocusage
```

## Usage

Display token usage statistics in a formatted table:

```bash
ocusage
```

Output detailed data as JSON:

```bash
ocusage --json
```

Write JSON output to a file:

```bash
ocusage --json --output usage.json
```

## Development

Install dependencies:

```bash
npm install
```

Run the unit tests:

```bash
npm run test
```

Build the library:

```bash
npm run build
```

## Requirements

- [OpenCode](https://opencode.ai) must be running locally (the tool connects to the OpenCode SDK)

## License

MIT