@koinunopochi/ccusage-to-graph
v0.2.2
Published
Display ccusage JSON output as terminal graphs with Claude Pro/Pro Max threshold indicators
Downloads
10
Maintainers
Readme
ccusage-to-graph
Display ccusage JSON output as terminal graphs with Claude Pro/Pro Max threshold indicators.
Features
- 📊 Bar chart and line chart visualization
- 🎨 Color-coded cost ranges (green/yellow/red)
- 📏 Pro and Pro Max threshold lines ($20 and $200)
- 👑 Crown emoji marks the highest cost day
- 🚀 Lightweight and fast using asciichart
- 📝 TypeScript implementation
- 🔄 Compatible with ccusage JSON output format
Installation
Using npx (recommended)
No installation required! Just use with npx:
npx ccusage@latest --json | npx @koinunopochi/ccusage-to-graph@latestGlobal installation
npm install -g @koinunopochi/ccusage-to-graphLocal development
git clone https://github.com/koinunopochi/ccusage-to-graph.git
cd ccusage-to-graph
npm install
npm run buildUsage
With npx (no installation needed)
# Bar chart (default)
npx ccusage@latest --json | npx @koinunopochi/ccusage-to-graph@latest
# Line chart
npx ccusage@latest --json | npx @koinunopochi/ccusage-to-graph@latest --type line
# Hide threshold lines
npx ccusage@latest --json | npx @koinunopochi/ccusage-to-graph@latest --no-thresholdWith global installation
# After installing globally
ccusage --json | ccusage-graphTest with sample data
# Using local build
cat test-data.json | node dist/bin/ccusage-graph.js
cat test-data-threshold.json | node dist/bin/ccusage-graph.jsOptions
-t, --type <type>: Graph type (barorline, default:bar)-p, --period <period>: Time period to display (future feature)--no-threshold: Hide Pro and Pro Max threshold lines
Color Coding
- 🟢 Green: Under $20 (Less than Pro plan)
- 🟡 Yellow: $20-$200 (Exceeds Pro plan)
- 🔴 Red: Over $200 (Exceeds Pro Max plan)
License
MIT License - see LICENSE file for details
Author
koinunopochi
Contributing
Issues and Pull Requests are welcome!
