{"id":46609485,"url":"https://github.com/arrufat/tokenuze","last_synced_at":"2026-03-07T18:01:30.696Z","repository":{"id":323313396,"uuid":"1088805806","full_name":"arrufat/tokenuze","owner":"arrufat","description":"A CLI tool that summarizes token and cost usage from various LLM providers","archived":false,"fork":false,"pushed_at":"2026-02-04T01:18:16.000Z","size":287,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-04T13:31:22.705Z","etag":null,"topics":["ai-agent-tools","cli","token","usage-analytics","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arrufat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T13:36:20.000Z","updated_at":"2026-02-04T01:18:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/arrufat/tokenuze","commit_stats":null,"previous_names":["bfactory-ai/tokenuze","arrufat/tokenuze"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/arrufat/tokenuze","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrufat%2Ftokenuze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrufat%2Ftokenuze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrufat%2Ftokenuze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrufat%2Ftokenuze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arrufat","download_url":"https://codeload.github.com/arrufat/tokenuze/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrufat%2Ftokenuze/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30225406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent-tools","cli","token","usage-analytics","zig-package"],"created_at":"2026-03-07T18:01:29.876Z","updated_at":"2026-03-07T18:01:30.687Z","avatar_url":"https://github.com/arrufat.png","language":"Zig","readme":"# Tokenuze\n\nTokenuze is a CLI tool that summarizes token and cost usage from various LLM providers.\nIt scans session logs, aggregates token counts, and reports pricing.\nThe output is a table or JSON, suitable for dashboards.\n\n## Requirements\n- Zig 0.16.0-dev.2535+b5bd49460 or newer (if building from source)\n- `sqlite3` in your `PATH` (for Zed, Crush, and Opencode providers)\n- Network access to fetch remote pricing / uploading stats (optional)\n\n## Supported Providers\n- [Amp](https://ampcode.com/)\n- [Claude Code](https://www.claude.com/product/claude-code)\n- [Codex CLI](https://developers.openai.com/codex/cli/)\n- [Crush](https://github.com/charmbracelet/crush): project-based (supports recursive crawling with `-r`)\n- [Gemini CLI](https://geminicli.com/)\n- [Opencode](https://opencode.ai/)\n- [Zed](https://zed.dev/)\n\n## Installation\n\n- **Prebuilt binaries:** grab the latest release from the [Releases page](https://github.com/bfactory-ai/tokenuze/releases) and put `tokenuze` on your `PATH`.\n- **Build from source:** requires Zig 0.16.0-dev.2535+b5bd49460 or newer\n\n```bash\ngit clone https://github.com/bfactory-ai/tokenuze.git\ncd tokenuze\nzig build -Doptimize=ReleaseFast  # binary will be in zig-out/bin/\n```\n\n## Quick Start\n\nBy default it will display daily usage across all providers since the beginning of time:\n```bash\ntokenuze\n```\n\n### Options\n\nYou can restrict what `tokenuze` displays by filtering by date\n```bash\ntokenuze --since 20250101 --until 20250107\n```\nOr requesting specific providers\n```bash\ntokenuze --agent claude --agent codex\n```\nAnd combine everything\n```\ntokenuze --agent claude --agent codex --since 20250101 --until 20250107\n```\n\nUse the `-r` or `--recursive` flag to enable recursive searching (supported by providers like Crush):\n```bash\ntokenuze --agent crush --recursive\n```\n\nBy appending the `--sessions` flag you can display session usage instead of daily.\n\nUsing the `--json` flag will display the result as a JSON file, which can be pretty printed with `--pretty`.\n\nIf you are tracking the stats in a separate server you can append the `--upload` flag to send them there.\n\nFinally, you can see all this information typing `tokenuze --help`.\n\n### JSON Output Sample\n\n\u003cdetails\u003e\n\n```json\n{\n  \"daily\": [\n    {\n      \"date\": \"Nov 25, 2025\",\n      \"isoDate\": \"2025-11-25\",\n      \"inputTokens\": 248291670,\n      \"cachedInputTokens\": 236782489,\n      \"outputTokens\": 1188464,\n      \"reasoningOutputTokens\": 749903,\n      \"totalTokens\": 249489543,\n      \"costUSD\": 55.88007429999999,\n      \"models\": {\n        \"gemini-2.5-flash\": {\n          \"inputTokens\": 10992,\n          \"cachedInputTokens\": 0,\n          \"outputTokens\": 10,\n          \"reasoningOutputTokens\": 79,\n          \"totalTokens\": 11032,\n          \"costUSD\": 0.0033225999999999998,\n          \"pricingAvailable\": true,\n          \"isFallback\": false\n        },\n        \"gemini-3-pro-preview\": {\n          \"inputTokens\": 5664,\n          \"cachedInputTokens\": 10521,\n          \"outputTokens\": 1738,\n          \"reasoningOutputTokens\": 2048,\n          \"totalTokens\": 16781,\n          \"costUSD\": 0.0342882,\n          \"pricingAvailable\": true,\n          \"isFallback\": false\n        },\n        \"gpt-5.1-codex\": {\n          \"inputTokens\": 248275014,\n          \"cachedInputTokens\": 236771968,\n          \"outputTokens\": 1186716,\n          \"reasoningOutputTokens\": 747776,\n          \"totalTokens\": 249461730,\n          \"costUSD\": 55.842463499999994,\n          \"pricingAvailable\": true,\n          \"isFallback\": false\n        }\n      },\n      \"missingPricing\": []\n    }\n  ],\n  \"totals\": {\n    \"inputTokens\": 248291670,\n    \"cachedInputTokens\": 236782489,\n    \"outputTokens\": 1188464,\n    \"reasoningOutputTokens\": 749903,\n    \"totalTokens\": 249489543,\n    \"costUSD\": 55.88007429999999,\n    \"missingPricing\": []\n  }\n}\n```\n\nMissing pricing entries are listed under `missingPricing`.\n\n\u003c/details\u003e\n\n\n## Extending\nTo add a new provider:\n1. Create a new file in `src/providers/` and use the `provider.makeProvider` factory.\n2. Implement a parser for the provider's log format that emits `model.TokenUsageEvent` objects.\n3. Use helpers in `src/providers/provider.zig` for common tasks like JSON parsing and timestamp handling.\n4. Register the provider in `src/root.zig` and expose a `loadPricingData` function for fallback pricing.\n5. Add test fixtures in a new `fixtures/\u003cprovider\u003e` directory and write unit tests in your provider's file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrufat%2Ftokenuze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrufat%2Ftokenuze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrufat%2Ftokenuze/lists"}