{"id":50895220,"url":"https://github.com/flexdinesh/tokeninsights","last_synced_at":"2026-06-15T23:31:30.390Z","repository":{"id":353721201,"uuid":"1220061325","full_name":"flexdinesh/tokeninsights","owner":"flexdinesh","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-13T08:58:14.000Z","size":77514,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T10:25:03.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexdinesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-24T13:59:56.000Z","updated_at":"2026-06-13T08:58:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/flexdinesh/tokeninsights","commit_stats":null,"previous_names":["flexdinesh/tokeninspector","flexdinesh/tokeninsights"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flexdinesh/tokeninsights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Ftokeninsights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Ftokeninsights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Ftokeninsights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Ftokeninsights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexdinesh","download_url":"https://codeload.github.com/flexdinesh/tokeninsights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Ftokeninsights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34385031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-15T23:31:30.287Z","updated_at":"2026-06-15T23:31:30.384Z","avatar_url":"https://github.com/flexdinesh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TokenInsights\n\nLocal token usage dashboard for OpenCode, Pi, Codex, and Claude Code.\n\nTokenInsights is a sync-first Go CLI. It reads local harness artifacts, normalizes raw facts into canonical token usage data, and opens an interactive terminal usage dashboard.\n\n**Supported harnesses: opencode, pi, codex and claude-code.**\n\n![TokenInsights TUI showing token usage by model](assets/tokeninsights-view-models.png)\n\n## Install\n\n### Homebrew\n\n```sh\n# homebrew\nbrew install flexdinesh/tap/tokeninsights\n\n# go (stable)\ngo install github.com/flexdinesh/tokeninsights/packages/cli/cmd/tokeninsights@latest\n\n# go (dev branch)\ngo install github.com/flexdinesh/tokeninsights/packages/cli/cmd/tokeninsights@dev\n```\n\n## Usage\n\n### Sync Data\n\nRead harness artifacts and normalize data from supported harnesses.\n\n```sh\n# sync all supported harnesses\ntokeninsights sync --all\n\n# sync a specific harness\ntokeninsights sync --harness pi\n\n# other sync options\n## discover and parse files without writing to the database\ntokeninsights sync --all --dry-run\n\n## skip automatic canonical normalization after ingestion\ntokeninsights sync --all --no-normalize\n\n## override default harness source directory\ntokeninsights sync --all --source-dir /path/to/custom/fixtures\n```\n\n### Open TUI View\n\nLaunch the interactive terminal user interface (TUI) to view the token dashboard. You can pre-filter the data or set time buckets.\n\n```sh\n# open default view (this month, daily buckets)\ntokeninsights view\n\n# view preset date ranges\ntokeninsights view --today\ntokeninsights view --yesterday\ntokeninsights view --week\ntokeninsights view --month\ntokeninsights view --year\ntokeninsights view --all-time\n\n# filter view data and choose time buckets\ntokeninsights view --month --bucket day\ntokeninsights view --week --provider openai --model gpt-5\ntokeninsights view --harness pi\n\n```\n\n### Maintenance \u0026 Debugging\n\nThese commands are primarily used for debugging, diagnostics, or manual database management.\n\n#### Rebuild Canonical Tables\n\nRebuild canonical facts and diagnostic records from already-ingested raw facts. Typically run automatically by `sync`.\n\n```sh\n# Normalize all harnesses\ntokeninsights normalize\n\n# Dry-run normalization to preview canonical changes\ntokeninsights normalize --dry-run\n```\n\n#### Purge Canonical Tables\n\nPurge normalized canonical facts and diagnostics without deleting raw ingested facts.\n\n```sh\ntokeninsights reset-canonical --confirm\n```\n\n#### Reset Local Database\n\nCompletely wipe and recreate the local SQLite database and its sidecars to start fresh.\n\n```sh\ntokeninsights reset-all --confirm\n```\n\n### Default Database Path\n\n```text\n~/.local/share/tokeninsights/tokeninsights.sqlite\n```\n\n_You can customize the DB path using the `--db-path` flag or the `TOKENINSIGHTS_DB_PATH` environment variable._\n\n## Development\n\n```sh\n# Verify Go embeds and schema synchronization\npnpm run check-schema\n\n# Run all tests across the repository packages\npnpm run test\n\n# Build local binaries\npnpm run build\n\n# Install the locally compiled CLI binary\npnpm run install:cli\n```\n\n### Important Documentation\n\nFor deeper details, refer to:\n\n- **[Design Guide](docs/design.md)**: Core architecture, SQLite schema definition, data pipelines, and canonical invariants.\n- **[Development Guide](docs/development.md)**: Comprehensive setup, local testing, and package structure details.\n- **[Release Guide](docs/release.md)**: Details on CLI releases, tagging rules, and CI automation workflows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexdinesh%2Ftokeninsights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexdinesh%2Ftokeninsights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexdinesh%2Ftokeninsights/lists"}