能力标签
Token用量追踪器
⚙️
Agent工作流

Token用量追踪器

基于 JavaScript · 无代码搭建完整 AI 自动化流程
英文名:TokenTracker
⭐ 500 Stars 🍴 46 Forks 💻 JavaScript 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
Token监控成本追踪多AI集成CLI工具开源
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,Token用量追踪器 获评「强烈推荐」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。

📚 深度解析

Token用量追踪器 是一套完整的 AI Agent 自动化工作流方案。随着 AI 能力的不断提升,基于 Agent 的自动化工作流正在成为提升个人和团队效率的核心方式。区别于传统的 RPA 自动化(模拟鼠标键盘操作),AI Agent 工作流通过理解任务意图、动态规划执行路径,能够处理更复杂的非结构化任务。

Token用量追踪器 工作流的设计遵循"最小配置,最大复用"原则:核心逻辑已经封装好,用户只需配置自己的 API Key 和业务参数即可快速上手。工作流内置错误处理和重试机制,在网络波动或 API 限速等情况下仍能稳定运行,适合作为生产环境的自动化基础设施。

在实际部署时,建议先在测试环境中运行 3-5 次,验证各个环节的输出结果符合预期,再部署到生产环境。AI Skill Hub 评分 8.2 分,是同类 Agent 工作流中的精选推荐。

📋 工具概览

Token用量追踪器 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。

GitHub Stars
⭐ 500
开发语言
JavaScript
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
MIT
AI 综合评分
8.2 分
工具类型
Agent工作流
Forks
46

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Token用量追踪器 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。

📌 核心特色
  • 可视化 Agent 工作流编排,无需编写复杂代码
  • 支持多步骤自动化任务链,实现全流程无人值守
  • 与外部 API、数据库和第三方服务无缝集成
  • 内置错误处理与自动重试机制,保障稳定运行
  • 提供可复用的自动化模板,快速在同类场景部署
🎯 主要使用场景
  • 自动化日常重复性工作,将精力集中于创造性任务
  • 构建数据采集 → 处理 → 输出的完整自动化管线
  • 实现跨平台、跨系统的数据流转和业务协同
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:npm 全局安装
npm install -g tokentracker

# 方式二:npx 直接运行(无需安装)
npx tokentracker --help

# 方式三:项目依赖安装
npm install tokentracker

# 方式四:从源码运行
git clone https://github.com/mm7894215/TokenTracker
cd TokenTracker
npm install
npm start
📋 安装步骤说明
  1. 访问 GitHub 仓库获取工作流文件
  2. 在对应平台(Dify / Flowise / Make 等)中找到「导入工作流」功能
  3. 上传工作流文件
  4. 按照提示配置必要的环境变量和 API Key
  5. 运行测试确认流程正常后投入使用
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
tokentracker --help

# 基本用法
tokentracker [options] <input>

# Node.js 代码中使用
const tokentracker = require('tokentracker');

const result = await tokentracker.run(options);
console.log(result);
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# tokentracker 配置说明
# 查看配置选项
tokentracker --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export TOKENTRACKER_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 86/100 含工作流图 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

✨ Features

  • 🔌 36 AI tools out of the box — Claude Code, Codex CLI, Cursor, Gemini CLI, Antigravity, Kiro, OpenCode, OpenClaw, Every Code, Hermes Agent, GitHub Copilot, Kimi Code, CodeBuddy, WorkBuddy, Grok Build, oh-my-pi, pi, Dots, Prime Agent, Craft Agents, Reasonix, Kilo CLI, Kilo Code, Roo Code, Zed Agent, Goose, Droid, Mimo Code, ZCode, Qoder, AnythingLLM Desktop, Claude Science, DeepSeek Harness, TRAE Work CN, LM Studio, Unsloth Studio
  • 🏠 100% local — Token data never leaves your machine. No account, no API keys.
  • 🚀 Zero config — Hooks auto-install on first run. From zero to dashboard in 30 seconds.
  • 📊 Beautiful dashboard — Usage trends, cost breakdowns by model, GitHub-style activity heatmap, project attribution
  • 🖥️ Native desktop app — macOS menu bar (+ widgets) and Windows system tray, each with an embedded server and the dashboard in a native webview
  • 🐾 Desktop pet — A pixel companion powered by real coding activity: it works when you work, celebrates streaks, and sleeps when you rest
  • 🎨 4 desktop widgets — Pin Usage / Activity Heatmap / Top Models / Usage Limits to your desktop
  • 🏆 15 achievement tracks — Turn daily usage, streaks, tools, models, and milestones into collectible badges worth sharing
  • 📈 Real-time usage limits — Claude / Codex / Cursor / Gemini / Kimi / Kiro / Grok / Copilot / Antigravity / ZCode / OpenCode Go / Qoder / Qoder CN quota windows, with last-good caching when a local provider app is temporarily closed
  • 🟢 Service Status page — live operational and incident status from 8 official provider status pages
  • 💰 Cost engine — 2,200+ models priced via LiteLLM (auto-refreshed daily) + curated overrides for niche tools (Kiro, Cursor Composer, Kimi, CodeBuddy hy3); 24h disk cache + bundled offline snapshot mean accurate USD without an internet connection. Models without published vendor pricing (e.g. Tencent hy3-preview) are tracked by tokens but show $0 cost until the vendor publishes a rate.
  • 🌐 Optional leaderboard — Compare with developers worldwide; drag-to-reorder columns to focus on the providers you care about (opt-in, sign in to participate)
  • 🔄 Cross-device account view — Opt in to cloud sync and the dashboard merges your usage across every machine you work on (laptop + desktop + server) into one combined view — totals, trends, heatmap and model breakdown all device-aggregated (opt-in, sign in; the default local-only experience stays instant and offline)
  • 🧩 Optional Skills tab — browse 250+ public skills from anthropics/skills, ComposioHQ/awesome-claude-skills, skills.sh and any GitHub repo you add; sync them across Claude / Codex / Grok / Antigravity / Gemini / OpenCode / Hermes with named targets and one-click Undo
  • 🔒 Privacy-first — Only token counts and timestamps. Never prompts, responses, or file contents.

---

Build dashboard + run CLI

cd dashboard && npm install && npm run build && cd .. node bin/tracker.js

Building the macOS App

cd TokenTrackerBar
npm run dashboard:build              # Build the dashboard bundle
./scripts/bundle-node.sh             # Bundle Node.js + tokentracker source
xcodegen generate                    # Generate the Xcode project
ruby scripts/patch-pbxproj-icon.rb   # Patch in the Icon Composer asset
xcodebuild -scheme TokenTrackerBar -configuration Release clean build
./scripts/create-dmg.sh              # Package the .app into a DMG

Requires Xcode 16+ and XcodeGen.

---

Track every AI token — then bring your usage to life

An accurate, local-first token usage and cost dashboard for 36 AI coding tools — plus a desktop pet, 4 native widgets, and 15 achievement tracks. No cloud account, no API keys, no setup.

npm version npm downloads Homebrew License: MIT CLI macOS app Windows app GitHub stars Featured in 阮一峰周刊 #393 Author tokens

<br/>

<strong>📊 See the token dashboard in action</strong>

<br/><br/>

<video src="https://github.com/user-attachments/assets/3275979d-bbed-4639-83e2-8b7d83bed6af" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" width="820"></video>

<br/><br/>

TokenTracker desktop pet powered by real AI coding activity TokenTracker desktop widgets for usage, heatmap, models, and limits
🐾 A living desktop companion
Codes, celebrates streaks, follows your cursor, and rests when you do.
🧩 Four native widgets
Usage, activity heatmap, top models, and rate limits at a glance.

<p> <img src="dashboard/public/achievements/token-titan.png" alt="Token Titan achievement" width="64" /> <img src="dashboard/public/achievements/streak.png" alt="Streak achievement" width="64" /> <img src="dashboard/public/achievements/multitool.png" alt="Multitool achievement" width="64" /> <img src="dashboard/public/achievements/night-owl.png" alt="Night Owl achievement" width="64" /> <img src="dashboard/public/achievements/project-devotion.png" alt="Project Devotion achievement" width="64" /> </p>

<strong>🏆 Unlock achievements from the way you actually code.</strong>

<br/><br/>

<strong>🎬 Meet TokenTracker</strong>

<br/><br/>

<video src="https://github.com/user-attachments/assets/5e709422-5af8-4e4c-8109-f5bb711eb3f8" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" width="820"> <img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" alt="Token Tracker Dashboard" width="820" /> </video>

<br/><br/>

If TokenTracker saves you time, please star it on GitHub — it helps other developers find it.

<br/>

ko-fi

</div>

---

⚡ Quick Start

Requirements: Node.js 20+ (CLI runs on macOS / Linux / Windows; native desktop app ships for macOS (menu bar), Windows (system tray) and Linux (AppImage, tray). Cursor token reading uses the system sqlite3 CLI when available and falls back to node:sqlite on supported Node releases).
npx tokentracker-cli

That's it. First run installs hooks, syncs your data, and opens the dashboard at http://localhost:7680.

What you get in 30 seconds: - 📊 A local dashboard at localhost:7680 with usage trends, model breakdown, cost analysis - 🔌 Auto-detected hooks for every supported AI tool you have installed - 🏠 100% local — no account, no API keys, no network calls (except optional leaderboard) - 🧩 Optional: a Skills tab that browses 250+ public skills and syncs them across Claude · Codex · Grok · Antigravity · Gemini · OpenCode · Hermes

Want a native desktop app? - macOSDownload TokenTrackerBar.dmg → drag to Applications. Menu bar status icon, desktop widgets, and the dashboard in a WKWebView. - WindowsDownload TokenTracker-Setup.exe → run the per-user installer (no admin needed). System-tray app with the dashboard in WebView2. Portable zip also on the releases page. - LinuxDownload TokenTracker-linux-x86_64.AppImagechmod +x and run. Tray app with the dashboard in a WebKitGTK window. It carries its own GTK/WebKit, so it needs nothing from your distro beyond a current glibc; on GNOME the tray icon still needs the AppIndicator extension. .deb and .rpm packages are also on the releases page — those link the distro's webkit2gtk-4.1, gtk3 and appindicator instead, so the .deb will not install on Debian 12 (use the AppImage there).

Install globally for shorter commands:

npm i -g tokentracker-cli

tokentracker              # Open the dashboard
tokentracker sync         # Manual sync
tokentracker status       # Check hook status
tokentracker status --json     # Machine-readable summary (pipe to jq, ingest from AI agents)
tokentracker status --light    # Plain ASCII table (CI / SSH, no spinner)
tokentracker doctor       # Health check

🖼️ Showcase

Dashboard — usage trends, model breakdown, cost analysis

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" alt="Dashboard" />

</td> <td width="50%">

Desktop Widgets — pin usage to your desktop

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/widgets-overview.png" alt="Desktop Widgets" />

</td> </tr> <tr> <td width="50%">

Menu Bar App — animated Clawd companion + native panels

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/menubar.gif" alt="Menu Bar App" />

</td> <td width="50%">

Global Leaderboard — compare with developers worldwide

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/leaderboard.png" alt="Leaderboard" />

</td> </tr> <tr> <td colspan="2">

Skills Manager — browse 250+ public skills from GitHub & skills.sh, install once, sync to Claude / Codex / Grok / Antigravity / Gemini / OpenCode / Hermes. Per-target toggles, one-click Undo, no manual file copying.

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/skills.png" alt="Skills Manager" />

</td> </tr> <tr> <td colspan="2">

Desktop Pet — a pixel companion that floats on your desktop and reacts to your real token burn: it codes when you code, celebrates streaks, and sleeps when you rest. Import community pets from codex-pets.net with a link or a .codex-pet.zip — V2 pets even turn their head to follow your cursor in 16 directions. macOS, Windows, and web.

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/pet.png" alt="Desktop Pet" />

</td> </tr> <tr> <td colspan="2">

Achievements — 15 tracks turn usage milestones, streaks, tools, and models into collectible badges — with progress visible before each unlock.

<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/achievements.png" alt="TokenTracker Achievements" />

</td> </tr> </table>

---

📦 Configuration

Most users never need this — defaults are sensible. For advanced setups:

VariableDescriptionDefault
TOKENTRACKER_DEBUGEnable debug output (1 to enable)
TOKENTRACKER_NO_TELEMETRYDisable all anonymous telemetry — daily heartbeat and dashboard analytics (1 to disable; the DO_NOT_TRACK standard is also respected)
TOKENTRACKER_HTTP_TIMEOUT_MSHTTP timeout in milliseconds20000
TOKENTRACKER_DISABLE_GIT_ATTRIBUTIONSkip Git commit attribution (1 to disable). Attribution runs git log inside the working directory of each recent session. Disabling keeps TokenTracker out of your project directories entirely — the Outcomes view then shows only manually recorded outcomes
TOKENTRACKER_GIT_ATTRIBUTION_PROTECTED_DIRSLet Git attribution enter macOS TCC-protected locations (1 to allow). By default sessions under ~/Documents, ~/Downloads, ~/Desktop, ~/Library, the media folders and /Volumes are skipped, because macOS raises a separate folder-access prompt for each one. Enable this only if you keep repositories there and don't mind granting access
TOKENTRACKER_WSL_MODEWSL install resolution behavior on Windows (for aggregating native and WSL installations). wsl-first (prefer WSL), native-first, wsl-only, native-only, both (aggregate both installs)wsl-first
CODEX_HOMEOverride Codex CLI directory~/.codex
GEMINI_HOMEOverride Gemini CLI directory~/.gemini
TOKENTRACKER_GROK_HOMEOverride Grok Build directory for the Grok integration and Skills Manager~/.grok
GROK_HOMELegacy Grok Build directory override, used when TOKENTRACKER_GROK_HOME is unset~/.grok
TOKENTRACKER_ANTIGRAVITY_HOMEForce a single Antigravity Skills directory (auto-detects ~/.gemini/antigravity + ~/.gemini/antigravity-ide otherwise)auto
TOKENTRACKER_LMSTUDIO_HOMEOverride the LM Studio data directory used by the passive server-log reader~/.lmstudio
TOKENTRACKER_UNSLOTH_DBOverride the Unsloth Studio database file used by the passive usage reader$UNSLOTH_STUDIO_HOME/studio.db

CLI only

brew install xiufengsun/tokentracker/tokentracker ```

Upgrade with brew upgrade --cask xiufengsun/tokentracker/tokentracker. The tap auto-bumps within an hour of every new release.

🆚 Why TokenTracker? <a id="ccusage-alternative"></a>

Looking for a ccusage alternative with a GUI? TokenTracker covers 36 tools (not just Claude Code), adds native macOS and Windows apps + desktop widgets, and de-duplicates token records correctly across providers — so your numbers match the providers' own billing.
**TokenTracker**ccusageCursor stats
**AI tools supported****36**1 (Claude)1 (Cursor)
**Local-first, no account**
**Native desktop app**✅ macOS + Windows
**Desktop widgets**✅ 4 widgets
**Rate-limit tracking**✅ 13 providersCursor only
**Accurate multi-provider dedup**❌ ¹

<sub>¹ reqId-based deduplication over-counts providers that omit a request ID (DeepSeek / Kimi / MiniMax / Claude sub-agents) by 1.6–3.7×. TokenTracker dedups on a composite key, so totals match each provider's own billing dashboard.</sub>

---

🔧 Troubleshooting

ZCode totals decreased after v0.96.0? This release corrects historical cache/reasoning double counting, including previously uploaded months. See the ZCode history correction for the accounting change and local backup details.

🇨🇳 中文文档镜像 AI 翻译 2026-05-30
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

TokenTracker 是一款专为开发者设计的 AI Token 使用量监控工具。它能够实时追踪各类 AI 编程工具的 Token 消耗情况,帮助你直观掌握 AI 辅助编程的成本与使用频率,实现对 AI 资源的高效管理。

⚡ 功能介绍

TokenTracker 开箱即用,内置支持 Claude Code、Cursor、GitHub Copilot、Gemini CLI、Roo Code 等 22 款主流 AI 工具。项目坚持 100% 本地化运行,所有 Token 数据均存储在你的本地机器中,无需注册账号或配置 API Key,确保隐私安全。此外,它采用 Zero config 设计,Hooks 会自动安装,实现零配置快速上手。

🛠 安装步骤(Docker/pip/源码)

你可以通过源码构建 Dashboard 并运行 CLI。首先进入 dashboard 目录执行 npm install 并完成 build,随后回到根目录运行 node bin/tracker.js。若需构建 macOS 桌面应用,需按照特定脚本流程进行 xcodegen 生成、Xcode 项目构建及 DMG 打包。请确保系统环境已准备好相应的构建工具。

🚀 使用教程

快速上手非常简单:确保你的 Node.js 版本在 20+ 以上,在终端直接运行 `npx tokentracker-cli` 即可。首次运行时,程序会自动安装必要的 Hooks 并同步数据,随后会自动在浏览器中打开 Dashboard 界面(http://localhost:7680)。只需 30 秒,你就能开始监控 AI 工具的使用情况。

⚙️ 配置说明(含 MCP / env)

对于大多数用户,TokenTracker 的默认配置已足够好用。如果你需要进行高级自定义,可以通过环境变量进行配置。例如,使用 `TOKENTRACKER_DEBUG` 开启调试模式,或通过 `TOKENTRACKER_HTTP_TIMEOUT_MS` 调整 HTTP 超时时间。部分特定工具如 Codex CLI 的路径也可以通过 `CODEX_HOME` 进行覆盖。

🔌 API 说明

目前 TokenTracker 主要以 CLI 形式提供服务。你可以通过 Homebrew 进行便捷安装:`brew install mm7894215/tokentracker/tokentracker`。后续可以通过 `brew upgrade` 命令进行版本更新,该 Tap 仓库会在新版本发布后一小时内自动同步更新。

❓ FAQ 摘要

本章节包含针对 TokenTracker 使用过程中可能遇到的常见问题及故障排除指南,帮助开发者快速解决环境配置或数据同步过程中的异常情况。

🎯 aiskill88 AI 点评 A 级 2026-05-20

专业的多AI平台成本管理工具,解决开发者关键痛点。JavaScript实现易于扩展,社区活跃度良好,实用价值高。

📚 实用指南(长尾问题)
适合谁
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
部署方案
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台

⚡ 核心功能

  • 可视化 Agent 工作流编排,无需编写复杂代码
  • 支持多步骤自动化任务链,实现全流程无人值守
  • 与外部 API、数据库和第三方服务无缝集成
  • 内置错误处理与自动重试机制,保障稳定运行
  • 提供可复用的自动化模板,快速在同类场景部署
👥 适合谁
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)

👥 适合人群

自动化工程师和运维人员项目经理和业务分析师希望减少重复性工作的专业人士数字化转型团队

🎯 使用场景

  • 自动化日常重复性工作,将精力集中于创造性任务
  • 构建数据采集 → 处理 → 输出的完整自动化管线
  • 实现跨平台、跨系统的数据流转和业务协同

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +大幅减少重复性人工操作
  • +可视化流程,清晰直观
  • +可扩展性强,支持复杂场景
⚠️ 不足
  • 初始配置和调试需投入一定时间
  • 强依赖外部服务的稳定性
  • 复杂场景需具备一定技术基础
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🗺️ 相关解决方案

❓ 常见问题 FAQ

TokenTracker 是一款JavaScript开发的AI辅助工具。开源AI工作流:Track token usage across 16 AI agent CLIs — Claude Code, Codex, Cursor, Gemini, 。⭐500 · JavaScript 主要应用场景包括:AI代理成本管理、开发工作流优化、Token使用量统计。
💡 AI Skill Hub 点评

AI Skill Hub 点评:Token用量追踪器 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 Token用量追踪器
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 TokenTracker
原始描述 开源AI工作流:Track token usage across 16 AI agent CLIs — Claude Code, Codex, Cursor, Gemini, 。⭐500 · JavaScript
Topics Token监控成本追踪多AI集成CLI工具开源
GitHub https://github.com/mm7894215/TokenTracker
License MIT
语言 JavaScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/mm7894215/TokenTracker 🌐 官方网站  https://www.tokentracker.cc

收录时间:2026-05-20 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。