A plugin for OpenCode that displays your GitHub Copilot premium requests quota after each conversation.
Inspired by sst/opencode#768.
Add to your opencode.json:
{
"plugins": ["opencode-copilot-usage-toast"]
}That's it. The plugin reads your Copilot authentication from OpenCode automatically.
- Listens for the
session.idleevent (when a conversation ends) - Checks if the last message came from
github-copilot - Reads your auth token from
~/.local/share/opencode/auth.json - Fetches quota from GitHub's internal Copilot API
- Displays a toast with usage info
- OpenCode authenticated with GitHub Copilot (run
opencodeand sign in)
"Not authenticated with GitHub Copilot"
- Make sure you've signed in to GitHub Copilot in OpenCode
"Failed to fetch quota"
- Your auth token may have expired - re-authenticate in OpenCode
MIT
