Skip to content

About

Command-line tool showing current usage and remaining quota for Copilot plan

Resources

Stars

51 stars

Watchers

2 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

copilot-usage

copilot-usage is a Rust CLI tool that shows how fast you're consuming GitHub Copilot premium requests and whether that pace is sustainable for the rest of the month.

image

It fetches billing data through your logged-in gh session, then prints a compact terminal dashboard with:

  • month-to-date usage and remaining quota
  • average daily pace
  • a "today budget" progress bar
  • projected month-end cushion or overshoot
  • optional --full history details

Requirements

  • Rust and Cargo
  • GitHub CLI (gh)
  • a GitHub account with access to Copilot premium request billing data

Install

Install with cargo

cargo install copilot-usage

Build from a local checkout

git clone https://github.com/kevingosse/copilot-usage.git
cd copilot-usage
cargo build --release

The binary will be available at:

target\release\copilot-usage.exe

Install into Cargo's bin directory

git clone https://github.com/kevingosse/copilot-usage.git
cd copilot-usage
cargo install --path .

After that, you can run copilot-usage directly from your shell.

Authenticate with gh

Log in once:

gh auth login

If the billing endpoint complains about missing scopes, refresh the user scope:

gh auth refresh -h github.com -s user

You can verify your login with:

gh auth status

Usage

Run the default view:

copilot-usage

Show the full dashboard with recent daily detail and previous months:

copilot-usage --full

Override the username or quota if needed:

copilot-usage --username kevingosse --quota 1500

Show each gh command and the raw API response for troubleshooting:

copilot-usage --debug

Options

  • --username <USER>: GitHub username. If omitted, the tool tries GITHUB_USER, GH_USERNAME, then gh api user --jq .login
  • --quota <N>: monthly quota override, default 1500
  • --months <N>: number of previous months to compare in --full, default 6
  • --full: show the full dashboard with sparkline, previous months, and model breakdown
  • --debug: print each gh command plus raw stdout/stderr to stderr

About

Command-line tool showing current usage and remaining quota for Copilot plan

Resources

Stars

51 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages