GitHub Copilot usage tracker CLI - Terminal-based tool written in Rust to visualize GitHub Copilot Pro usage with an interactive dashboard, multiple themes, and Waybar integration for Hyprland.
Tested on Linux - specifically designed and tested on Linux systems with Hyprland window manager.
- Interactive Dashboard with segmented progress bars (green → orange → red)
- 9 Visual Themes: dark, nord, monokai, gruvbox, catppuccin, onedark, tokyonight, solarized, kanagawa
- Async Architecture with smooth animations (20 FPS)
- Smart Caching with configurable TTL (default: 5 minutes)
- Interactive Modals: theme selector, command menu, help, cache info
- Waybar Integration for Hyprland status bar (tested on Hyprland)
- Interactive Setup for first-time configuration
git clone https://github.com/tu-usuario/copilot-usage.git
cd copilot-usage
./install.sh./quick-install.sh# Compile and install
cargo install --path . --force
# Or traditional
cargo build --release
cp target/release/copilot-usage ~/.local/bin/The first time you run the program, an interactive setup will start:
copilot-usage- Go to: https://github.com/settings/personal-access-tokens/new
- Token name: Any name (e.g., "Copilot Usage CLI")
- Resource owner: Select your account
- Expiration: Choose your preferred duration
- Repository access: "Public repositories" is sufficient
- Account permissions (IMPORTANT):
- Look for "Plan" (NOT "Copilot Requests")
- Select "Read-only"
- Generate and copy the token
Note: The required permission is "Plan", not "Copilot Requests". These are different permissions.
After entering the token, choose your preferred theme from the 9 available options. Configuration is saved to: ~/.config/copilot-usage/config.toml
copilot-usagecopilot-usage --refreshcopilot-usage --cache-statuscopilot-usage --theme nordcopilot-usage --waybarcopilot-usage reconfigurecopilot-usage configcopilot-usage reset| Key | Action |
|---|---|
r |
Refresh data from API |
t |
Open theme selector |
/ |
Open command menu |
c |
Show cache information |
? |
Show help |
Esc or q |
Close modal / Exit |
This integration has been specifically tested on Hyprland window manager. To display Copilot usage in your Waybar:
"custom/copilot": {
"exec": "copilot-usage --waybar",
"interval": 300,
"return-type": "json",
"format": "{}",
"tooltip": true,
"class": "copilot-usage"
}#custom-copilot {
padding: 0 10px;
margin: 0 5px;
}
#custom-copilot.copilot-critical {
color: #f38ba8;
}
#custom-copilot.copilot-warning {
color: #fab387;
}
#custom-copilot.copilot-normal {
color: #f9e2af;
}
#custom-copilot.copilot-low {
color: #a6e3a1;
}Note: While Waybar is supported on various Wayland compositors, this integration has been primarily tested on Hyprland.
Terminal UI (ratatui)
├─ UI Components (Header, Progress Bar, Model Table)
├─ Event Loop (50ms poll, 20 FPS)
└─ Async Handler (tokio)
├─ Background API calls
├─ Cache operations
└─ mpsc channels
↓
GitHub API
└─ /users/{username}/settings/billing/premium_request/usage
- Async Architecture: tokio + mpsc channels + non-blocking event loop
- State Machine: AppState enum with explicit transitions
- Pure Components: Rendering functions with no side effects
- Consistent Colors: Warning (orange) and Error (red) constant across all themes
~/.config/copilot-usage/
└── config.toml # Configuration (token, theme, TTL)
~/.cache/copilot-usage/
└── usage.json # Usage data cache
Example of ~/.config/copilot-usage/config.toml:
token = "github_pat_xxxxxxxx"
theme = "nord"
cache_ttl_minutes = 5
waybar_format = "{percentage}%"
username = "your-username"- token: GitHub Personal Access Token with
Plan (Read)permission - theme: One of: dark, nord, monokai, gruvbox, catppuccin, onedark, tokyonight, solarized, kanagawa
- cache_ttl_minutes: Cache TTL in minutes (default: 5)
- waybar_format: Format for Waybar (uses
{percentage},{used},{limit},{remaining}) - username: Your GitHub username (auto-detected)
# Format code
cargo fmt
# Run linter
cargo clippy -- -D warnings
# Run tests
cargo test
# Build release
cargo build --releasecargo build --release && cargo clippy -- -D warnings && cargo fmt -- --check- Rust 1.70+ (to compile)
- GitHub Personal Access Token with
Plan (Read)permission - Linux (tested on Linux systems with Hyprland)
- Terminal with Unicode support (for progress bar characters)
- Verify the token has
Plan (Read)permission - Fine-grained tokens need account permission, not repository permission
- Try a classic token with
read:userscope
- Your terminal needs Braille Unicode character support
- Test with Alacritty, Kitty, or GNOME Terminal
- Verify:
echo "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
- Verify the file exists:
ls ~/.cache/copilot-usage/ - Check permissions:
ls -la ~/.cache/copilot-usage/ - Default TTL is 5 minutes
This tool has been developed and tested exclusively on Linux systems. While it may work on other platforms, it is specifically designed for:
- Linux terminals with Unicode support
- Hyprland window manager for Waybar integration
- XDG-compliant directory structure (
~/.config/,~/.cache/)
Built with Rust for Linux systems



