JD.SemanticKernel.Connectors.GitHubCopilot 0.1.14

dotnet add package JD.SemanticKernel.Connectors.GitHubCopilot --version 0.1.14
                    
NuGet\Install-Package JD.SemanticKernel.Connectors.GitHubCopilot -Version 0.1.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JD.SemanticKernel.Connectors.GitHubCopilot" Version="0.1.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JD.SemanticKernel.Connectors.GitHubCopilot" Version="0.1.14" />
                    
Directory.Packages.props
<PackageReference Include="JD.SemanticKernel.Connectors.GitHubCopilot" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JD.SemanticKernel.Connectors.GitHubCopilot --version 0.1.14
                    
#r "nuget: JD.SemanticKernel.Connectors.GitHubCopilot, 0.1.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JD.SemanticKernel.Connectors.GitHubCopilot@0.1.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JD.SemanticKernel.Connectors.GitHubCopilot&version=0.1.14
                    
Install as a Cake Addin
#tool nuget:?package=JD.SemanticKernel.Connectors.GitHubCopilot&version=0.1.14
                    
Install as a Cake Tool

JD.SemanticKernel.Connectors.GitHubCopilot

License: MIT CI NuGet codecov

Use your GitHub Copilot subscription as an AI backend for Microsoft Semantic Kernel applications.

This connector reads your local Copilot OAuth credentials, exchanges them for short-lived API tokens, and injects authentication into SK's OpenAI-compatible chat completion — giving you access to GPT-4o, Claude, Gemini, and more through a single Copilot subscription.

Quick Start

dotnet add package JD.SemanticKernel.Connectors.GitHubCopilot
using JD.SemanticKernel.Connectors.GitHubCopilot;
using Microsoft.SemanticKernel;

// One-liner: reads credentials from your local Copilot installation
var kernel = Kernel.CreateBuilder()
    .UseCopilotChatCompletion()
    .Build();

// Use any model available through Copilot
var kernel = Kernel.CreateBuilder()
    .UseCopilotChatCompletion(CopilotModels.ClaudeSonnet4)
    .Build();

How It Works

┌──────────────────────┐     ┌─────────────────┐     ┌──────────────────────┐
│  Local Copilot Auth  │     │  Token Exchange  │     │    Copilot API       │
│  apps.json/hosts.json│────▶│  api.github.com  │────▶│  chat/completions    │
│  (ghu_* OAuth token) │     │  /copilot_internal│    │  (OpenAI-compatible) │
└──────────────────────┘     │  /v2/token       │     └──────────────────────┘
                             └─────────────────┘
                              ▲ Short-lived token
                              │ (~30 min TTL)
                              │ Auto-refreshed
  1. Reads your local Copilot OAuth token from %LOCALAPPDATA%/github-copilot/apps.json (Windows) or ~/.config/github-copilot/hosts.json (Linux/macOS)
  2. Exchanges it for a short-lived API token via GitHub's internal token endpoint
  3. Caches the API token with TTL-aware refresh (thread-safe, SemaphoreSlim double-check locking)
  4. Injects auth headers into every SK request via a DelegatingHandler

Available Models

Copilot provides access to 41+ models from multiple AI providers through a single subscription. Use CopilotModelDiscovery to discover all available models at runtime, or reference well-known constants:

Key Models (Constants)

Constant Model ID Provider Best For
Anthropic
CopilotModels.ClaudeOpus46 claude-opus-4.6 Anthropic Deep reasoning, complex analysis
CopilotModels.ClaudeOpus46Fast claude-opus-4.6-fast Anthropic Faster Opus variant
CopilotModels.ClaudeSonnet46 claude-sonnet-4.6 Anthropic Balanced quality/speed (default)
CopilotModels.ClaudeSonnet4 claude-sonnet-4 Anthropic Reliable completions
CopilotModels.ClaudeHaiku45 claude-haiku-4.5 Anthropic Fast, lightweight tasks
OpenAI
CopilotModels.Gpt53Codex gpt-5.3-codex OpenAI Latest code-specialized model
CopilotModels.Gpt52 gpt-5.2 OpenAI Complex reasoning
CopilotModels.Gpt51Codex gpt-5.1-codex OpenAI Code generation
CopilotModels.Gpt5Mini gpt-5-mini Azure OpenAI Fast general-purpose
CopilotModels.Gpt4o gpt-4o Azure OpenAI Multimodal
Google
CopilotModels.Gemini31Pro gemini-3.1-pro-preview Google Latest Gemini model
CopilotModels.Gemini3Pro gemini-3-pro-preview Google Long-context reasoning
CopilotModels.Gemini3Flash gemini-3-flash-preview Google Fast responses
xAI
CopilotModels.GrokCodeFast1 grok-code-fast-1 xAI Code generation

Runtime Discovery

var discovery = new CopilotModelDiscovery(provider, httpClient, logger);
var models = await discovery.DiscoverModelsAsync();
// Returns all 41+ models including embedding and legacy variants

Configuration

Options

var kernel = Kernel.CreateBuilder()
    .UseCopilotChatCompletion(CopilotModels.ClaudeSonnet46, options =>
    {
        // Override token file location
        options.TokenFilePath = "/custom/path/apps.json";

        // GitHub Enterprise Server
        options.GitHubHost = "github.enterprise.com";

        // Enterprise SSL bypass
        options.DangerouslyDisableSslValidation = true;

        // Custom endpoint
        options.CustomEndpoint = "https://proxy.internal/copilot";
    })
    .Build();

Dependency Injection

services.AddCopilotAuthentication(configuration);
// or
services.AddCopilotAuthentication(o => o.OAuthToken = "ghu_...");

Environment Variables

Variable Description
GITHUB_COPILOT_TOKEN Override OAuth token (skips file lookup)

Packages

Package Description
JD.SemanticKernel.Connectors.Abstractions Shared interfaces for multi-provider connectors
JD.SemanticKernel.Connectors.GitHubCopilot GitHub Copilot authentication connector
JD.Tools.CopilotChat jdcplt — Interactive chat CLI demo

Sample CLI: jdcplt

dotnet tool install -g JD.Tools.CopilotChat

# Interactive chat
jdcplt

# Single prompt
jdcplt --prompt "Explain async/await in C#"

# Choose a model
jdcplt --model claude-sonnet-4 --prompt "Write a haiku about code"

# List available models
jdcplt --list-models

# Enterprise SSL bypass
jdcplt --insecure

Documentation

Full documentation is available at GitHub Pages or in the docs/ directory:

Both connectors implement the shared JD.SemanticKernel.Connectors.Abstractions interfaces, enabling MCP server bridging across subscriptions.

Building

git clone https://github.com/JerrettDavis/JD.SemanticKernel.Connectors.GitHubCopilot.git
cd JD.SemanticKernel.Connectors.GitHubCopilot
dotnet build
dotnet test

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JD.SemanticKernel.Connectors.GitHubCopilot:

Package Downloads
JD.AI.Core

Core library for JD.AI — agents, providers, sessions, tools, orchestration, and event bus. Shared by the TUI, Gateway, and channel adapters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.14 623 2/27/2026
0.1.13 37 2/27/2026
0.1.12 37 2/27/2026
0.1.11 45 2/27/2026
0.1.10 39 2/27/2026
0.1.9 43 2/27/2026
0.1.8 43 2/27/2026
0.1.7 40 2/27/2026
0.1.6 39 2/27/2026
0.1.5 39 2/27/2026
0.1.4 39 2/27/2026