You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7971969
Browse filesBrowse the repository at this point in the historyBrowse files
* feat(nix): add runnable ccusage flake
Build the Rust CLI with Crane so the repository exposes ccusage as the default Nix package and app. The build uses rust-overlay for the pinned Rust toolchain and injects a locked LiteLLM pricing flake input, avoiding build-time network access in the Nix sandbox.
Add a shared jq filter, fallback sync check, and scheduled workflow so the checked-in non-Nix Cargo fallback pricing JSON can be regenerated when the locked LiteLLM input changes. Update the README and docs to document nix run usage and remove bundle-size messaging.
* fix(nix): track pricing snapshot changes
Emit cargo:rerun-if-changed for the CCUSAGE_PRICING_JSON_PATH file before reading it in build.rs.
This keeps Cargo rebuilds correct when Nix supplies a new locked LiteLLM pricing snapshot at the same environment variable name.
* docs: reduce nix mentions in guides
Keep the Nix quick-start path in getting-started only, while removing the broader Nix installation section and feature-page mention from public docs.
* ci: build native unix packages with nix
Use nix build for Linux and Darwin native package artifacts so CI can reuse Nix store caching instead of depending on Cargo target cache behavior.
Linux now builds the static musl binary through a ccusage-static flake package, preserving the existing portable native package contract. Windows continues to use cargo build because Nix is not part of that runner path.
* fix(nix): cross build static linux binaries
Use the musl cross package sets for the Linux static package instead of pkgsStatic. The CI build scripts need host executables while Cargo still targets the musl triples for the final binary, and pkgsStatic caused build-script links to mix static flags with dynamic glibc objects.
Keep the rust-overlay toolchain target-specific so nix flake evaluation exposes the same ccusage-static package names while avoiding the failed static build-script link path seen in CI.
* ci: cache windows cargo builds
Windows native package jobs still use Cargo because the Nix build path only replaces Unix package builds. Cache the Cargo registry, git checkout cache, and rust/target directory by runner OS, runner architecture, Cargo.lock, and rust-toolchain.toml so Windows x64 and arm64 builds can reuse dependencies and release artifacts do not pay a cold build cost every run.
* ci: keep nix macos binaries portable
Darwin native packages now build through Nix, but the resulting binary carried the Nix store install name for libiconv into the npm optional dependency. That works on a Nix-enabled builder but fails on ordinary macOS users and in preview E2E, where the store path is absent.
Rewrite the Darwin binary install name to the system libiconv after the final package install. Also extend the perf package URL wait because pkg.pr.new publishing can take longer now that native package dry-runs build all Nix artifacts first.
* ci: keep darwin package builds on cargo
Darwin npm optional dependency packages already worked when built by Cargo on the GitHub macOS runners. Building those distribution binaries with Nix introduced Nix store dylib references, which made the pkg.pr.new macOS E2E fail outside a Nix environment and risked extra packaging complexity.
Limit Nix native package builds to Linux static artifacts, where they replace the uncached musl setup. Darwin and Windows now share the Cargo build path with the same Cargo registry, git, and target cache, while the flake still supports nix run and Nix-built Darwin packages for Nix users.
<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->
13
12
<a href="https://github.com/hesreallyhim/awesome-claude-code"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Claude Code" /></a>
@@ -31,12 +30,15 @@ The main CLI tool for analyzing Claude Code, Codex, OpenCode, Amp, and pi-agent
31
30
32
31
### Quick Start (Recommended)
33
32
34
-
Thanks to ccusage's incredibly small bundle size ([](https://packagephobia.com/result?p=ccusage)), you can run it directly without installation:
33
+
You can run ccusage directly without a global installation:
- 🏗️ **Claude Instance Support**: Group Claude Code usage by project with `--instances` and filter by specific projects
111
113
- 🌍 **Timezone Support**: Configure timezone for date grouping with `--timezone` option
112
114
- ⚙️ **Configuration Files**: Set defaults with JSON configuration files, complete with IDE autocomplete and validation
113
-
- 🚀 **Ultra-Small Bundle**: Unlike other CLI tools, we pay extreme attention to bundle size - incredibly small even without minification!
114
115
115
116
## Documentation
116
117
@@ -136,6 +137,26 @@ nix develop
136
137
137
138
This ensures consistent tooling versions across all contributors and CI systems. The development environment is defined in `flake.nix` and automatically activated via direnv when entering the project directory.
138
139
140
+
### Nix Package
141
+
142
+
The flake exposes `ccusage` as the default package and app:
143
+
144
+
```bash
145
+
nix run github:ryoppippi/ccusage
146
+
nix run github:ryoppippi/ccusage -- codex daily --offline
147
+
nix build github:ryoppippi/ccusage
148
+
```
149
+
150
+
Nix builds embed the LiteLLM pricing file from the locked `litellm-pricing` flake input, so sandboxed builds do not fetch pricing at build time. To update the locked pricing snapshot and refresh the non-Nix Cargo fallback JSON:
151
+
152
+
```bash
153
+
nix flake update litellm-pricing
154
+
nix run .#update-pricing-fallback
155
+
nix flake check
156
+
```
157
+
158
+
The scheduled `update pricing` workflow runs the same commands and opens a PR when the locked input changes.
Copy file name to clipboardExpand all lines: docs/guide/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ ccusage reads the local usage files that coding CLIs already generate and provid
36
36
37
37
## Key Features
38
38
39
-
### 🚀 Ultra-Small Bundle Size
39
+
### 🚀 Direct Execution
40
40
41
-
Unlike many CLI tools, ccusage pays close attention to bundle size. You can run it directly without a global install using `bunx ccusage` (recommended), `pnpm dlx ccusage`, or `npx ccusage@latest`.
41
+
You can run ccusage without a global install using `bunx ccusage` (recommended), `pnpm dlx ccusage`, or `npx ccusage@latest`.
Copy file name to clipboardExpand all lines: docs/guide/installation.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,13 @@
2
2
3
3
ccusage can be installed and used in several ways depending on your preferences and use case.
4
4
5
-
## Why No Installation Needed?
5
+
## Why Direct Execution Works Well
6
6
7
-
Thanks to ccusage's incredibly small bundle size, you don't need to install it globally. Unlike other CLI tools, we pay extreme attention to bundle size optimization, achieving an impressively small footprint even without minification. This means:
7
+
You do not need to install ccusage globally before trying it. Direct package runners work well for ad hoc usage:
0 commit comments