An open API service indexing awesome lists of open source software.

https://github.com/j4rviscmd/vscode-copilot-usage

🚀 Display GitHub Copilot Premium Requests usage in the VSCode status bar
https://github.com/j4rviscmd/vscode-copilot-usage

ai-assistant code-assistant copilot developer-tools extension github github-copilot metrics monitoring premium-requests productivity quota resource-monitoring status-bar typescript usage-statistics usage-tracker visual-studio-code vscode vscode-extension

Last synced: 19 days ago
JSON representation

🚀 Display GitHub Copilot Premium Requests usage in the VSCode status bar

Awesome Lists containing this project

README

          

# VSCode Copilot Usage

![statusbar screenshot](./assets/screenshots/statusbar.png)

[![Latest Release](https://img.shields.io/github/v/release/j4rviscmd/vscode-copilot-usage?style=for-the-badge&color=green&label=Latest&logo=github&logoColor=white)](https://github.com/j4rviscmd/vscode-copilot-usage/releases/latest)
[![Last Commit](https://img.shields.io/github/last-commit/j4rviscmd/vscode-copilot-usage/main?style=for-the-badge&color=1F6FEB&label=Last%20Update&logo=git&logoColor=white)](https://github.com/j4rviscmd/vscode-copilot-usage/commits/main)
[![License](https://img.shields.io/badge/License-MIT-018FF5?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](LICENSE)

## A VSCode extension that displays GitHub Copilot Premium Requests usage in the status bar

## Features

- Displays Premium Requests usage percentage in the status bar
- Configurable label style (icon or text)
- Configurable display mode (used/remaining amount)
- Configurable refresh interval
- Automatic GitHub authentication

## Installation

Install from VSCode Marketplace:

1. Open VSCode
2. Press `Cmd+Shift+X` (macOS) or `Ctrl+Shift+X` (Windows/Linux) to open Extensions
3. Search for "Copilot Usage"
4. Click Install

## Requirements

- VSCode 1.85.0 or higher
- GitHub account with Copilot subscription

## Configuration

| Setting | Type | Default | Description |
| ------- | ---- | ------- | ----------- |
| `copilotUsage.labelStyle` | string | `"icon"` | Label style: `"icon"` or `"text"` |
| `copilotUsage.displayMode` | string | `"used"` | Display mode: `"used"` or `"remaining"` |
| `copilotUsage.refreshInterval` | number | 60 | Data refresh interval in seconds |
| `copilotUsage.statusBarPriority` | number | -1000 | Status bar display priority (higher = further left) |

## Usage

After installation, the extension will:
1. Request GitHub authentication (if not already authenticated)
2. Fetch your Copilot usage data
3. Display the usage percentage in the status bar

### PAT Authentication

You can use a Personal Access Token (PAT) instead of OAuth:

1. Create a PAT at [GitHub Settings > Developer settings > Personal access tokens](https://github.com/settings/tokens)
2. Select **Classic** token type
3. Select the `read:user` scope (this is the only required scope)
4. Run the `Copilot Usage: Set Personal Access Token` command and enter your token

### Commands

- `Copilot Usage: Toggle Label Style (Icon/Text)` - Switch between icon and text display
- `Copilot Usage: Toggle Display Mode (Used/Remaining)` - Switch between used amount and remaining amount display
- `Copilot Usage: Set Refresh Interval` - Change the data refresh interval

### Status Bar Display

- Icon mode: `🤖 n%`
- Text mode: `Copilot: n%`
- `-` - Unable to fetch data (error or unlimited plan)

## Development

```bash
# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch for changes
npm run watch
```

> [!WARNING]
> This extension uses GitHub's internal API (`api.github.com/copilot_internal/user`) which is not officially documented. The API may change without notice, which could break this extension.

## License

MIT