Skip to content

Commit 19ade3e

Browse files
committed
feat!: remove legacy ccusage packages
1 parent c5049ce commit 19ade3e

23 files changed

Lines changed: 13 additions & 372 deletions

File tree

.agents/skills/ccusage-agent-sources/SKILL.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ccusage amp daily
2121
ccusage pi daily
2222
```
2323

24-
Standalone agent binaries such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` are deprecated compatibility wrappers. Preserve compatibility when needed, but do not promote standalone binaries in new docs, tests, or examples.
24+
Standalone agent wrapper packages have been removed. Use the unified `ccusage <agent> ...` commands in docs, tests, and examples, and do not reintroduce wrapper commands such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, or `ccusage-pi`.
2525

2626
Cost modes:
2727

@@ -46,13 +46,12 @@ Read only the relevant reference before changing parser behavior, token mappings
4646
- Treat Codex, OpenCode, Amp, and pi-agent as agent subcommands under the unified `ccusage` CLI.
4747
- Reuse shared packages such as `@ccusage/terminal`, `@ccusage/internal`, pricing helpers, and logging where appropriate.
4848
- Keep command names and flag semantics aligned unless the source data forces a difference.
49-
- Internal workspace runtime libraries for bundled/private agent apps belong in `devDependencies`.
50-
- Deprecated wrapper packages must keep install-time runtime dependencies such as `ccusage` in `dependencies`.
49+
- Internal workspace runtime libraries for bundled/private packages belong in `devDependencies`.
5150

5251
## Adapter Layout
5352

5453
New or migrated agent implementations belong under `apps/ccusage/src/adapter/<agent>/`.
55-
Keep agent-specific code there, not in deprecated wrapper packages. Split files by responsibility when the implementation grows:
54+
Keep agent-specific code there. Split files by responsibility when the implementation grows:
5655

5756
- `index.ts` - thin public adapter surface: `detect<Agent>()`, `load<Agent>Rows()`, and high-level wiring.
5857
- `paths.ts` - environment variables, default directories, and path discovery.
@@ -76,7 +75,7 @@ Before adding or changing an adapter, read `apps/ccusage/src/adapter/ARCHITECTUR
7675
For each migrated or new agent:
7776

7877
- Put all source-specific runtime logic under `apps/ccusage/src/adapter/<agent>/`.
79-
- Keep deprecated wrapper packages as thin compatibility commands only.
78+
- Keep agent-specific package logic under `apps/ccusage/src/adapter/<agent>/`.
8079
- Implement fast detection that short-circuits once a usable source file is found.
8180
- Use shared file walking, JSONL byte marker scanning where applicable, worker gating, logging, pricing fetcher lifecycle, date formatting, table rendering, and all-agent aggregation.
8281
- Keep adapter code responsible for source paths, raw parsing, token mapping, model mapping, source metadata, and agent-specific pricing.

.agents/skills/ccusage-development/SKILL.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ description: Work in the ccusage monorepo with its unified ccusage command surfa
1010
This is a monorepo. Check the nearest package-specific `CLAUDE.md` before editing a package:
1111

1212
- `apps/ccusage/CLAUDE.md` - main Claude Code usage CLI and library
13-
- `apps/codex/CLAUDE.md` - Codex usage tracking CLI
14-
- `apps/opencode/CLAUDE.md` - OpenCode usage tracking CLI
15-
- `apps/amp/CLAUDE.md` - Amp usage tracking CLI
16-
- `apps/pi/CLAUDE.md` - pi-agent usage tracking CLI
1713
- `docs/CLAUDE.md` - VitePress documentation site
1814

1915
The canonical user-facing command is `ccusage` with agent subcommands:
@@ -26,9 +22,9 @@ ccusage amp daily
2622
ccusage pi daily
2723
```
2824

29-
Standalone agent binaries such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` are deprecated compatibility wrappers. Keep backward compatibility where it already exists, but prefer `ccusage <agent> ...` in docs, tests, examples, and new behavior.
25+
Standalone agent wrapper packages have been removed. Prefer `ccusage <agent> ...` in docs, tests, examples, and new behavior, and do not reintroduce wrapper commands such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, or `ccusage-pi`.
3026

31-
Agent apps are still bundled runtime payloads. Treat runtime libraries as bundled assets: add dependencies to each app's `devDependencies` unless the user explicitly asks otherwise. Deprecated wrapper packages are the exception: keep install-time dependencies such as `ccusage` in `dependencies` when the wrapper needs them after installation.
27+
Agent implementations live inside the bundled `ccusage` package. Treat runtime libraries as bundled assets: add dependencies to each package's `devDependencies` unless the user explicitly asks otherwise.
3228

3329
## Common Commands
3430

@@ -59,7 +55,7 @@ Tools are managed by `flake.nix` and `package.json`. Use `comma` or `nix run` fo
5955
- Use Gunshi for CLI commands; use the `use-gunshi-cli` skill for details.
6056
- Only export constants, functions, and types used by other modules.
6157
- Keep internal-only files and helpers private where possible.
62-
- Dependency additions go in `devDependencies` for bundled/private packages, but keep install-time wrapper dependencies in `dependencies`.
58+
- Dependency additions go in `devDependencies` for bundled/private packages.
6359

6460
## Post-Change Workflow
6561

.agents/skills/ccusage-docs/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The docs build copies `apps/ccusage/config-schema.json` to `docs/public/config-s
2828
## Content Rules
2929

3030
- Prefer the unified command form in new or edited docs: `ccusage codex ...`, `ccusage opencode ...`, `ccusage amp ...`, and `ccusage pi ...`.
31-
- Standalone wrapper commands such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` are deprecated. Mention them only for migration or compatibility notes.
31+
- Standalone wrapper commands such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` have been removed. Do not promote or reintroduce them in docs.
3232
- Place screenshots immediately after the page H1 when a guide has a primary screenshot.
3333
- Use relative image paths such as `/screenshot.png` for files in `docs/public/`.
3434
- Always include descriptive alt text for screenshots and images.

CLAUDE.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ Use these skills before working in this repository:
2727
Check the nearest package-specific `CLAUDE.md` before editing package code:
2828

2929
- `apps/ccusage/CLAUDE.md` - main Claude Code usage CLI and library
30-
- `apps/codex/CLAUDE.md` - Codex usage tracking CLI
31-
- `apps/opencode/CLAUDE.md` - OpenCode usage tracking CLI
32-
- `apps/amp/CLAUDE.md` - Amp usage tracking CLI
33-
- `apps/pi/CLAUDE.md` - pi-agent usage tracking CLI
3430
- `docs/CLAUDE.md` - VitePress documentation site
3531

3632
## Always-On Reminders
3733

3834
- The canonical user-facing CLI is `ccusage` with agent subcommands such as `ccusage amp`, `ccusage codex`, `ccusage opencode`, and `ccusage pi`.
39-
- Standalone agent binaries such as `ccusage-amp`, `ccusage-codex`, `ccusage-opencode`, and `ccusage-pi` are deprecated compatibility wrappers. Do not add new docs, tests, or features that promote them as the primary interface.
40-
- Agent apps are still bundled runtime payloads. Put runtime libraries in each app's `devDependencies` unless explicitly requested otherwise. Deprecated wrapper packages may keep install-time dependencies such as `ccusage` in `dependencies`.
35+
- Standalone agent wrapper packages have been removed. Do not add docs, tests, or features that promote `ccusage-amp`, `ccusage-codex`, `ccusage-opencode`, or `ccusage-pi`.
36+
- Runtime libraries for bundled packages belong in `devDependencies` unless explicitly requested otherwise.
4137
- Prefer tools provided by the Nix dev shell before falling back to ad hoc installs: `rg`, `fd`, `fzf`, `delta`, `dust`, `jq`, `gh`, `hyperfine`, `similarity`, `typos`, and `typos-lsp`. When a missing tool would be useful for repeated agent work in this repository, add it to `flake.nix`.
4238
- Use `logger.ts` instead of `console.log`.
4339
- Use `.ts` extensions for local imports.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pnpm typecheck
4949
pnpm run test
5050
```
5151

52-
Use the canonical `ccusage` command in docs and tests. Deprecated compatibility wrappers such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` should not be promoted as the primary interface.
52+
Use the canonical `ccusage` command in docs and tests. Standalone wrapper packages such as `ccusage-codex`, `ccusage-opencode`, `ccusage-amp`, and `ccusage-pi` have been removed and should not be reintroduced.
5353

5454
Do not proactively create documentation files unless the change requires user-facing documentation.
5555

apps/amp/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/amp/index.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/amp/package.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

apps/ccusage/README.md

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,10 @@
2323

2424
> Analyze coding (agent) CLI token usage and costs from local data.
2525
26-
## ccusage Family
27-
28-
### 📊 [ccusage](https://www.npmjs.com/package/ccusage) - Coding (Agent) CLI Usage Analyzer
26+
## Supported Sources
2927

3028
The main CLI tool for analyzing Claude Code, Codex, OpenCode, Amp, and pi-agent usage from local data. Track daily, weekly, monthly, and session-based usage with beautiful tables.
3129

32-
### 🤖 [@ccusage/codex](https://www.npmjs.com/package/@ccusage/codex) - Codex Compatibility Wrapper
33-
34-
Compatibility wrapper for OpenAI Codex usage. Prefer `ccusage codex` or `ccusage codex daily`.
35-
36-
### 🚀 [@ccusage/opencode](https://www.npmjs.com/package/@ccusage/opencode) - OpenCode Compatibility Wrapper
37-
38-
Compatibility wrapper for [OpenCode](https://github.com/opencode-ai/opencode) usage. Prefer `ccusage opencode`.
39-
40-
### 🥧 [@ccusage/pi](https://www.npmjs.com/package/@ccusage/pi) - pi-agent Compatibility Wrapper
41-
42-
Compatibility wrapper for [pi-agent](https://github.com/badlogic/pi-mono) usage. Prefer `ccusage pi`.
43-
44-
### [@ccusage/amp](https://www.npmjs.com/package/@ccusage/amp) - Amp Compatibility Wrapper
45-
46-
Compatibility wrapper for [Amp](https://ampcode.com/) usage. Prefer `ccusage amp`.
47-
4830
## Installation
4931

5032
### Quick Start (Recommended)
@@ -64,15 +46,6 @@ npx ccusage@latest
6446
> 💡 **Runtime**: `bunx ccusage` is recommended for everyday use. If you use `npx`, include `@latest` and use Node.js 22+.
6547
> Because the published CLI shebang targets Node.js, package runners can start ccusage under Node.js even when launched through `bunx`. When ccusage finds `bun` in `PATH`, it automatically re-runs the bundled entrypoint with Bun for better warm runtime performance. Set `CCUSAGE_BUN_AUTO_RUN=0` to force Node.js.
6648
67-
### Compatibility Packages
68-
69-
```bash
70-
npx @ccusage/codex@latest # Deprecated wrapper for: ccusage codex
71-
npx @ccusage/opencode@latest # Deprecated wrapper for: ccusage opencode
72-
npx @ccusage/pi@latest # Deprecated wrapper for: ccusage pi
73-
npx @ccusage/amp@latest # Deprecated wrapper for: ccusage amp
74-
```
75-
7649
## Usage
7750

7851
```bash

apps/ccusage/src/adapter/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Use small files under each adapter directory:
3939
- `pricing.ts` or `pricing-macro.ts` - model aliases, provider filters, and bundled pricing.
4040
- `types.ts` - adapter-local types.
4141

42-
Do not put new source logic in deprecated standalone packages. Those packages are compatibility wrappers; ccusage adapter directories are the implementation home.
42+
Do not put source logic outside the ccusage adapter directories. The standalone wrapper packages have been removed, and `apps/ccusage/src/adapter/<agent>/` is the implementation home.
4343

4444
When migrating an existing root-level implementation into an adapter, update internal import sites to point at `adapter/<agent>/...` directly. Avoid root-level re-export shims unless the path is part of the package's declared public exports or a dedicated bundled worker entry. `apps/ccusage/src/data-loader.ts` is such an entry: it keeps the optimized Claude loader in the separate `data-loader` chunk introduced by PR #984, while source logic stays under `adapter/claude/`.
4545

0 commit comments

Comments
 (0)