npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

github-copilot-receipt-generator

v1.1.0

Published

Generate quirky, shareable receipts for your GitHub Copilot usage

Downloads

293

Readme

copilot-receipts

Generate quirky, shareable receipts for your GitHub Copilot usage — with per-model pricing breakdowns. Inspired by claude-receipts.

  ●  GitHub Copilot  ●
  ╔═══════════════╗
  ║  < / >        ║
  ╚═══════════════╝

      Location: San Francisco, CA
        User: jane-doe
           Org: my-org
         2026-05-02 (Saturday)

════════════════════════════════════════
Claude-sonnet-4.6                  $1.24
────────────────────────────────────────
Interactions                          42
Code generations                      35
Acceptances                           28
Input tokens                     136,500
Output tokens                     40,600
Lines added                          310
Lines deleted                         85

════════════════════════════════════════
Gpt-5.3-codex                     $0.89
────────────────────────────────────────
Interactions                          20
Code generations                      15
Acceptances                           12
Input tokens                      62,500
Output tokens                     24,020
Lines added                          180
Lines deleted                         42

════════════════════════════════════════
TOTAL                              $2.13
════════════════════════════════════════

        CASHIER: GitHub Copilot

        Thank you for building!
      github.com/features/copilot

════════════════════════════════════════

Installation

npx copilot-receipts setup

This will:

  • Prompt for your GitHub organization name
  • Prompt for a GitHub token
  • Store configuration at ~/.copilot-receipts.config.json

Requirements

  • Node.js >= 20.0.0
  • A GitHub organization with GitHub Copilot Business or GitHub Copilot Enterprise enabled
  • A GitHub token with read:org or manage_billing:copilot scope
  • For enterprise reports: a token with enterprise:read scope

Note: GitHub Copilot's usage API is only available at the organization/enterprise level (not individual accounts).

Commands

generate

Generate a receipt for your organization's GitHub Copilot usage.

# Org-level receipt (most recent day)
npx copilot-receipts generate

# Specific date
npx copilot-receipts generate --date 2026-05-02

# Tune receipt width for your printer
npx copilot-receipts generate --width 30

# Per-user receipt with pricing breakdown
npx copilot-receipts generate --user jane-doe --date 2026-05-02

# Enterprise mode
npx copilot-receipts generate --enterprise my-enterprise --date 2026-05-02

# HTML output
npx copilot-receipts generate --output html

# Override org and token inline
npx copilot-receipts generate --org my-org --token ghp_...

Options:

  • -d, --date <YYYY-MM-DD> — Specific date to generate a receipt for (defaults to most recent)
  • -o, --output <format> — Output format: console (default) or html (supports multiple, comma-separated)
  • -l, --location <text> — Override location detection
  • --org <name> — GitHub organization name (overrides config)
  • --enterprise <slug> — GitHub Enterprise slug (uses enterprise API endpoint)
  • --user <login> — Generate a receipt for a specific user (with per-model pricing)
  • --width <chars> — Receipt width in characters (20-64, overrides config)
  • --token <token> — GitHub token (overrides config and GITHUB_TOKEN env var)

setup

Interactive wizard to configure copilot-receipts.

# Run interactive setup
npx copilot-receipts setup

# Clear stored configuration
npx copilot-receipts setup --uninstall

config

Manage configuration values.

# Show current configuration
npx copilot-receipts config --show

# Set a value
npx copilot-receipts config --set org=my-org
npx copilot-receipts config --set token=ghp_...
npx copilot-receipts config --set location="San Francisco, CA"
npx copilot-receipts config --set timezone="America/Los_Angeles"
npx copilot-receipts config --set receiptWidth=30

# Reset to defaults
npx copilot-receipts config --reset

Available settings:

| Key | Description | |--------------|--------------------------------------------------| | org | GitHub organization name | | enterprise | GitHub Enterprise slug | | token | GitHub personal access token | | location | Default location string (otherwise auto-detected) | | timezone | Timezone for date formatting (e.g. America/New_York) | | receiptWidth | Receipt width in characters (20-64, default 32) |

Configuration

Configuration is stored at ~/.copilot-receipts.config.json.

{
  "version": "1.0.0",
  "org": "my-org",
  "token": "ghp_...",
  "location": "San Francisco, CA",
  "timezone": "America/Los_Angeles",
  "receiptWidth": 32
}

The token can also be provided via the GITHUB_TOKEN or GH_TOKEN environment variable.

Automated Daily Receipts

Since GitHub Copilot doesn't have a "session end" hook, you can schedule daily receipt generation with a cron job:

# Open crontab
crontab -e

# Run every day at 6pm and save HTML
0 18 * * * npx copilot-receipts generate --output html

Or add it to a CI/CD pipeline to send receipts to your team.

How It Works

  1. GitHub API: Calls the Copilot metrics/reports API at the org or enterprise level
  2. Per-User Data: When --user is specified, fetches per-user daily reports and calculates estimated costs using GitHub Copilot model pricing
  3. Receipt Generation: Formats data into a terminal receipt or styled HTML page with per-model cost breakdowns
  4. Location Detection: Auto-detects your location via IP geolocation (offline, using geoip-lite), or uses your configured location
  5. HTML Output: Saves a styled receipt to ~/.copilot-receipts/receipts/ and opens it in your browser

License

MIT