This module is created by HDMowri
GitHub Copilot SDK integration for Amplifier via Copilot CLI.
- Python 3.11+
- GitHub Copilot subscription — Individual, Business, or Enterprise
- UV (optional) — Fast Python package manager (pip works too)
No Node.js required. The Copilot SDK binary is bundled with the Python package and discovered automatically.
Set a GitHub token as an environment variable. The provider checks these in order:
COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN.
Linux/macOS:
export GITHUB_TOKEN=$(gh auth token)Windows PowerShell:
$env:GITHUB_TOKEN = (gh auth token)One command to bridge your existing gh CLI authentication into Amplifier.
Tip: Many developers already have
ghCLI authenticated — if so, this is the fastest path to get started.
Linux/macOS:
export GITHUB_TOKEN="ghp_your_token_here"Windows PowerShell:
$env:GITHUB_TOKEN = "ghp_your_token_here"Use a GitHub Personal Access Token directly.
Linux/macOS:
# 1. Set token (if using gh CLI)
export GITHUB_TOKEN=$(gh auth token)
# 2. Install provider (includes SDK)
amplifier provider install github-copilot
# 3. Configure
amplifier initWindows PowerShell:
# 1. Set token (if using gh CLI)
$env:GITHUB_TOKEN = (gh auth token)
# 2. Install provider (includes SDK)
amplifier provider install github-copilot
# 3. Configure
amplifier initTip: For permanent token setup:
- Linux: Add
export GITHUB_TOKEN=$(gh auth token)to~/.bashrc- macOS: Add
export GITHUB_TOKEN=$(gh auth token)to~/.zshrc- Windows: Add
$env:GITHUB_TOKEN = (gh auth token)to your PowerShell profile ($PROFILE)
# Requires: GITHUB_TOKEN set AND provider installed
amplifier init --yesReference the provider directly in a bundle:
providers:
- module: provider-github-copilot
source: git+https://github.com/microsoft/amplifier-module-provider-github-copilot@main
config:
default_model: claude-sonnet-4# Interactive session
amplifier run -p github-copilot
# One-shot prompt
amplifier run -p github-copilot -m claude-sonnet-4 "Explain this codebase"
# List available models
amplifier provider models github-copilotAll 18 models available through your Copilot subscription are exposed at runtime:
Anthropic: claude-haiku-4.5, claude-opus-4.5, claude-opus-4.6, claude-opus-4.6-1m, claude-sonnet-4, claude-sonnet-4.5, claude-sonnet-4.6
OpenAI: gpt-4.1, gpt-5-mini, gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini, gpt-5.2, gpt-5.2-codex, gpt-5.3-codex, gpt-5.4
Google: gemini-3-pro-preview
Tip: Want intelligent routing across models? Use the Routing Matrix bundle to route prompts based on task type, cost, or latency.
Works with sensible defaults out of the box. Default model is claude-opus-4.5 with streaming enabled and a 1-hour request timeout.
All options can be set via provider config in your bundle or amplifier configuration. See the source code for the full list of configurable parameters.
Set raw: true to include raw API request/response payloads in llm:request and llm:response events.
- Streaming support
- Tool use (function calling)
- Extended thinking (on supported models)
- Vision capabilities (on supported models)
- Token counting and management
- Message validation before API calls (defense in depth)
| Field | Value |
|---|---|
| Module Type | Provider |
| Module ID | provider-github-copilot |
| Provider Name | github-copilot |
| Entry Point | amplifier_module_provider_github_copilot:mount |
| Source URI | git+https://github.com/microsoft/amplifier-module-provider-github-copilot@main |
The provider automatically detects and repairs incomplete tool call sequences in conversation history. If tool results are missing (due to context compaction, parsing errors, or state corruption), synthetic results are injected so the API accepts the request and the session continues.
Repairs are logged as warnings and emit provider:tool_sequence_repaired events for monitoring.
cd amplifier-module-provider-github-copilot
# Install dependencies (using UV)
uv sync --extra dev
# Or using pip
pip install -e ".[dev]"make test # Run tests
make coverage # Run with coverage report
make sdk-assumptions # Before upgrading SDK
make check # Full check (lint + test)Live tests require RUN_LIVE_TESTS=1 and valid GitHub Copilot authentication:
RUN_LIVE_TESTS=1 python -m pytest tests/integration/ -vOn Windows PowerShell:
$env:RUN_LIVE_TESTS="1"; python -m pytest tests/integration/ -v| Error | Cause | Solution |
|---|---|---|
Copilot SDK not installed |
Provider module not installed | Run amplifier provider install github-copilot |
Not authenticated to GitHub Copilot |
Token not set | Linux/macOS: export GITHUB_TOKEN=$(gh auth token) Windows: $env:GITHUB_TOKEN = (gh auth token) |
gh: command not found |
GitHub CLI missing | Install gh CLI |
Running amplifier init before authentication:
Linux/macOS:
❌ amplifier init # Fails with auth error
✅ export GITHUB_TOKEN=$(gh auth token) # Set token first
✅ amplifier provider install github-copilot
✅ amplifier init # Now worksWindows PowerShell:
❌ amplifier init # Fails with auth error
✅ $env:GITHUB_TOKEN = (gh auth token) # Set token first
✅ amplifier provider install github-copilot
✅ amplifier init # Now worksamplifier-core(provided by Amplifier runtime, not installed separately)github-copilot-sdk>=0.1.0,<0.2.0
Note: The
github-copilot-sdkis installed automatically when you runamplifier provider install github-copilot. It is NOT bundled with the mainamplifierpackage.