Replace custom device-flow OAuth and token exchange with the official @github/copilot-sdk. The SDK manages a Copilot CLI subprocess for authentication and API access. Changes: - Add @github/copilot-sdk dependency (v0.1.19) - Create github-copilot-sdk.ts as core SDK wrapper - Rename github-copilot-auth.ts to github-copilot-login.ts - Merge github-copilot-token.ts into github-copilot-sdk.ts - Remove extensions/copilot-proxy plugin entirely - Update login flow to verify CLI auth status instead of device flow - Add SDK-based model discovery via listCopilotModels() - Update docs and UI labels to reflect SDK-based authentication - Remove copilot-proxy from auth choices and plugin auto-enable BREAKING CHANGE: GitHub Copilot now requires the Copilot CLI to be installed and authenticated via 'copilot auth login' before use.
64 lines
1.5 KiB
Markdown
64 lines
1.5 KiB
Markdown
---
|
|
summary: "Sign in to GitHub Copilot from Moltbot using the official SDK"
|
|
read_when:
|
|
- You want to use GitHub Copilot as a model provider
|
|
- You need the `moltbot models auth login-github-copilot` flow
|
|
---
|
|
# Github Copilot
|
|
|
|
## What is GitHub Copilot?
|
|
|
|
GitHub Copilot is GitHub's AI coding assistant. It provides access to Copilot
|
|
models for your GitHub account and plan. Moltbot uses the official
|
|
`@github/copilot-sdk` to integrate with Copilot.
|
|
|
|
## Prerequisites
|
|
|
|
The official SDK requires the **Copilot CLI** to be installed and authenticated:
|
|
|
|
```bash
|
|
# Install Copilot CLI (if not already installed)
|
|
npm install -g @github/copilot-cli
|
|
|
|
# Authenticate with GitHub
|
|
copilot auth login
|
|
```
|
|
|
|
## CLI setup
|
|
|
|
After authenticating with the Copilot CLI, verify your auth in Moltbot:
|
|
|
|
```bash
|
|
moltbot models auth login-github-copilot
|
|
```
|
|
|
|
This checks your Copilot CLI authentication status and creates an auth profile.
|
|
|
|
### Optional flags
|
|
|
|
```bash
|
|
moltbot models auth login-github-copilot --profile-id github-copilot:work
|
|
moltbot models auth login-github-copilot --yes
|
|
```
|
|
|
|
## Set a default model
|
|
|
|
```bash
|
|
moltbot models set github-copilot/gpt-4o
|
|
```
|
|
|
|
### Config snippet
|
|
|
|
```json5
|
|
{
|
|
agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } }
|
|
}
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Requires the Copilot CLI (`copilot`) to be installed and in your PATH.
|
|
- Run `copilot auth login` first to authenticate with GitHub.
|
|
- Model availability depends on your Copilot subscription plan.
|
|
- The official SDK manages token exchange internally.
|