{"_id":"@aiusage/controller","_rev":"3-9728630ed88c6c8e78213ffaeb03d90a","name":"@aiusage/controller","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aiusage/controller","version":"0.1.0","keywords":["aiusage","claude-code","codex","tokens","cli","analytics"],"license":"MIT","_id":"@aiusage/controller@0.1.0","maintainers":[{"name":"thisethan","email":"yizhev@gmail.com"}],"bin":{"aiusage":"dist/cli.js"},"dist":{"shasum":"f5c4cf5b9fda35a7960577a497b5f557efddb22f","tarball":"https://registry.npmjs.org/@aiusage/controller/-/controller-0.1.0.tgz","fileCount":4,"integrity":"sha512-r0mdSQ12Onp4xrFaOYU4t1Xbr8XnL2eb9vB4EebzI+UXGdz+WO5tPzDQjlKqjmY/RMuZFXaTqgIKO9zuHAecLA==","signatures":[{"sig":"MEYCIQDUj/zzVinYmxNo39p6Q6AI4B6DHjjt8BWCh8ODJEkSPAIhAPOO/lU0kHSvkI+tQRJN0EhuUZlQbgTAw5tBjSo5wCHO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62442},"type":"module","engines":{"node":">=18"},"private":false,"scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","test":"echo 'no tests yet'","build":"rm -rf dist && node build.mjs"},"_npmUser":{"name":"thisethan","email":"yizhev@gmail.com"},"_npmVersion":"11.10.1","description":"AIUsage 本地统计与同步 CLI，支持 Claude Code 与 Codex token 使用分析。","directories":{},"_nodeVersion":"25.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.4","typescript":"^5","@types/node":"^22","@aiusage/shared":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/controller_0.1.0_1775053246588_0.4744781835851586","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aiusage/controller","version":"0.1.1","keywords":["aiusage","claude-code","codex","tokens","cli","analytics"],"license":"MIT","_id":"@aiusage/controller@0.1.1","maintainers":[{"name":"thisethan","email":"yizhev@gmail.com"}],"bin":{"aiusage":"dist/cli.js"},"dist":{"shasum":"4452529b3646a26f78c71774e6daad6bab6d2a62","tarball":"https://registry.npmjs.org/@aiusage/controller/-/controller-0.1.1.tgz","fileCount":4,"integrity":"sha512-2RznQuCE4VBVLtjVrrmtUzfv3rLqoWUcvwi3Cz/uosq1gpRtW9AQ7MgxGd9vWa5absUQwZj4G+fQy6tYfo0XGA==","signatures":[{"sig":"MEQCIGtjHsCSPMc5F6PdtrKALoUwTF9ojLn9RM/2kapa6ykrAiBr5Vh9YpZg/r8Spv5Kv19gSx/prI8ZeKo1VpYE9laAww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62422},"type":"module","engines":{"node":">=18"},"private":false,"scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","test":"echo 'no tests yet'","build":"rm -rf dist && node build.mjs"},"_npmUser":{"name":"thisethan","email":"yizhev@gmail.com"},"_npmVersion":"11.9.0","description":"CLI tool for tracking and syncing Claude Code & Codex token usage.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.27.4","typescript":"^5","@types/node":"^22","@aiusage/shared":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/controller_0.1.1_1775053339032_0.6185978445371165","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-01T14:20:46.347Z","modified":"2026-06-22T14:40:11.421Z","0.1.0":"2026-04-01T14:20:46.729Z","0.1.1":"2026-04-01T14:22:19.186Z"},"license":"MIT","keywords":["aiusage","claude-code","codex","tokens","cli","analytics"],"description":"CLI tool for tracking and syncing Claude Code & Codex token usage.","maintainers":[{"email":"qingnianxiaozhe@gmail.com","name":"qingnianxiaozhe"},{"email":"hi@yizhe.me","name":"thisethan"}],"readme":"# @aiusage/controller\n\n`@aiusage/controller` is the AIUsage command-line tool for:\n\n- scanning local Claude Code and Codex token usage\n- printing local usage summaries for the last 7 days, 30 days, 90 days, or all history\n- scheduling automatic sync to an AIUsage Worker\n- diagnosing configuration and connectivity issues\n\n## Install\n\n```bash\nnpm install -g @aiusage/controller\n```\n\nOr run it directly with `npx`:\n\n```bash\nnpx @aiusage/controller --help\n```\n\nAfter installation:\n\n```bash\naiusage --help\n```\n\n## Commands\n\n### report\n\nLocal usage report. No cloud upload required.\n\n```bash\naiusage report --range 7d\naiusage report --range 1m\naiusage report --range 3m\naiusage report --range all\naiusage report --range 7d --json\n```\n\nReads data from `~/.claude/projects` (Claude Code) and `~/.codex` (Codex).\n\nThe report includes events, token breakdowns (input / cache read / cache write / output / reasoning), grouped totals by source, daily trend, top models, and estimated USD cost based on public pricing.\n\n### scan\n\nScan a single day and print the breakdown.\n\n```bash\naiusage scan --date 2026-03-31\naiusage scan --date 2026-03-31 --json\n```\n\nDefaults to yesterday when `--date` is omitted.\n\n### init\n\nInitialize local configuration.\n\n```bash\naiusage init --server https://your-worker.example.com --site-id your-site-id\n```\n\n### health\n\nTest connectivity to the Worker.\n\n```bash\naiusage health\n```\n\n### enroll\n\nRegister this device with the Worker.\n\n```bash\naiusage enroll \\\n  --server https://your-worker.example.com \\\n  --site-id your-site-id \\\n  --enroll-token your-enroll-token \\\n  --device-name \"MacBook Pro\"\n```\n\n### sync\n\nUpload closed-day data to the Worker. Covers the last 7 days by default.\n\n```bash\naiusage sync\naiusage sync --date 2026-03-31\naiusage sync --lookback 14\n```\n\n### schedule\n\nManage automatic sync. Uses `launchd` on macOS and `cron` on Linux.\n\n```bash\naiusage schedule            # show status\naiusage schedule on         # enable, default every 1 hour\naiusage schedule on --every 2h\naiusage schedule on --every 30m\naiusage schedule off        # disable\n```\n\nSupported intervals: `10m` – `1d`. As long as your machine is awake for one interval within a day, yesterday's data will be uploaded.\n\n### doctor\n\nRun diagnostic checks on configuration, server connectivity, scanner directories, and schedule status.\n\n```bash\naiusage doctor\n```\n\n### config set\n\nManage local settings.\n\n```bash\naiusage config set device.alias \"MacBook Pro 工作机\"\naiusage config set privacy.projectVisibility masked\naiusage config set project.alias /Users/me/Projects/MyApp MyApp\n```\n\n## Configuration\n\nConfig file: `~/.aiusage/config.json`\n\nSync log (when scheduled): `~/.aiusage/sync.log`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}