convez.ai
AgenteDevOps & InfraestruturaIntermediário
sahil87

tu — Rastreador de Custos de Assistentes IA

sahil87/tu

Rastreie custos de tokens de assistentes IA com estilo via CLI

Ver no GitHub
InicialPluginScore · de 0 a 100

CLI para monitorar uso de tokens e custos em tempo real de assistentes de código como Claude Code, Codex e OpenCode. Oferece rastreamento diário, histórico mensal, sincronização multi-máquina e modo watch com animações interativas. Ideal para desenvolvedores que precisam controlar gastos com APIs de IA.

Instalação

$npx convez-ai sahil87/tu

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
4
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
v0.12.4
Issues abertas
3
Contribuidores
2

Casos de uso

  • Monitorar gastos com Claude Code e outras ferramentas IA
  • Auditar uso de tokens por dia/mês
  • Sincronizar métricas entre múltiplas máquinas de desenvolvimento

Veredito

Ferramenta bem estruturada e prática para quem trabalha com múltiplos assistentes de código. A capacidade de sincronização entre máquinas e visualização em tempo real adiciona valor real, embora seja nicotizada para um público específico de usuários de IA.

README

A tradução para o português deste README ainda está na fila.

tu

Part of @sahil87's open source toolkit — see all projects there.

Latest release Downloads Stars

AI coding assistant cost tracking CLI. Track your token usage in style!

Install

📖 Full walkthrough: the install guide covers install, shell completions, and multi-machine setup in depth.

brew tap sahil87/tap
brew install tu

Shell completions

# bash
echo 'eval "$(tu shell-init bash)"' >> ~/.bashrc

# zsh
echo 'eval "$(tu shell-init zsh)"' >> ~/.zshrc

# fish
tu shell-init fish > ~/.config/fish/completions/tu.fish

💡 Have other sahil87 tools? shll shell-install handles all of their shell integrations and autocompletions at once.

Update

tu update
# brew update
# brew upgrade tu

Usage

📖 See workflows for end-to-end recipes, and the full command reference for every command and flag.

tu                   # Today's cost, all tools
tu cc                # Today's cost, Claude Code
tu h                 # Daily cost history, all tools
tu cc mh             # Monthly cost history, Claude Code
tu m                 # This month's cost, all tools

Sources: cc (Claude Code), codex/co (Codex), oc (OpenCode), all (default)

Flags

  --json               Output data as JSON (data commands only)
  --sync               Sync metrics before fetching (multi mode)
  --fresh / -f         Bypass cache, fetch fresh data (data commands only)
  --watch / -w         Persistent polling mode with live display (data commands only)
  --interval / -i <s>  Poll interval in seconds (default: 10, range: 5-3600)
  --user / -u <user>   Show usage for a specific user (multi mode only)
  --by-machine         Show per-machine cost breakdown (data commands only)
  --no-color           Disable ANSI color output
  --no-rain            Disable matrix rain animation in watch mode

Setup (multi-machine sync)

tu init-conf         # Scaffold ~/.tu.conf
tu init-metrics      # Clone metrics repo
tu sync              # Push/pull metrics
tu status            # Show config and sync state

For end-to-end recipes — daily snapshots, history pivots, multi-machine sync, and watch mode — see workflows.

CI / branch protection

main is gated by a required status check named ci-gate. The CI workflow runs the build and the test suite on every pull request targeting main (and on pushes to main); the aggregating ci-gate job passes only when build-and-test succeeds. A branch ruleset on main requires ci-gate to be green before a PR can be merged.

Reproduce CI locally before opening a PR:

npm ci && npm run build && npm test
# or, with the task runner:
just test

Applying or adjusting the ruleset is an admin action (needs a gh token with admin scope on the repo). The exact, idempotent command is captured in scripts/ci-gate-ruleset.sh:

scripts/ci-gate-ruleset.sh           # dry-run: preview the ruleset payload
scripts/ci-gate-ruleset.sh --apply   # create/update the ruleset (admin only)

The script degrades gracefully — if gh is missing, unauthenticated, or lacks admin scope, it prints the manual steps instead of failing.

Ver o original no GitHub

Bom para

Relacionados