Add GitHub Copilot support (#191)

- OAuth login for GitHub Copilot via /login command
- Support for github.com and GitHub Enterprise
- Models sourced from models.dev (Claude, GPT, Gemini, Grok, etc.)
- Dynamic base URL from token's proxy-ep field
- Use vscode-chat integration ID for API compatibility
- Documentation for model enablement at github.com/settings/copilot/features

Co-authored-by: cau1k <cau1k@users.noreply.github.com>
This commit is contained in:
Mario Zechner 2025-12-15 19:05:17 +01:00
parent ce4ba70d33
commit b66157c649
7 changed files with 664 additions and 726 deletions

View file

@ -125,6 +125,23 @@ pi
/login # Select "Anthropic (Claude Pro/Max)", authorize in browser
```
**GitHub Copilot:**
```bash
pi
/login # Select "GitHub Copilot", authorize in browser
```
During login, you'll be prompted for an enterprise domain. Press Enter to use github.com, or enter your GitHub Enterprise Server domain (e.g., `github.mycompany.com`).
Some models require explicit enablement before use. If you get "The requested model is not supported" error, enable the model at:
**https://github.com/settings/copilot/features**
For enterprise users, check with your organization's Copilot administrator for model availability and policies.
Note: Enabling some models (e.g., Grok from xAI) may involve sharing usage data with the provider. Review the terms before enabling.
Tokens stored in `~/.pi/agent/oauth.json` (mode 0600). Use `/logout` to clear.
### Quick Start