Overview
The GitHub Copilot SDK exposes Copilot CLI's production-tested agent runtime for programmatic use with over 9,500 GitHub stars. It supports six official platforms (Python, TypeScript, Go, .NET, Java, Rust) and provides access to Copilot's agent loop, tools, and skills — eliminating the need to build orchestration from scratch.
Features
- ✓Six official platforms: TS, Python, Go, .NET, Java, Rust
- ✓Access to Copilot CLI's production agent runtime
- ✓Custom agents, skills, and tools per application
- ✓BYOK for cost control and data privacy
- ✓Multiple authentication methods
- ✓Streaming and non-streaming agent APIs
Installation
npm install @github/copilot-sdkPros
- +Officially supported by GitHub — production-quality
- +Six official platforms cover most stacks
- +Access to Copilot CLI's battle-tested tooling
- +BYOK for cost control and data privacy
- +Backed by GitHub's scale and reliability
Cons
- −Tied to GitHub's ecosystem and roadmap
- −Requires Copilot subscription for full features
- −New SDK with limited production examples
- −Less flexible for non-GitHub use cases
Alternatives
Documentation
GitHub Copilot SDK
Overview
The GitHub Copilot SDK is an officially released, multi-platform SDK that exposes GitHub Copilot CLI's production-tested agent runtime for programmatic use. With over 9,500 GitHub stars, it enables developers to embed Copilot's agentic workflows directly into their applications, services, and development tools.
The SDK's key proposition is simple: instead of building custom agent orchestration, you define agent behavior and Copilot handles planning, tool invocation, file edits, and more. It supports six official platforms (Python, TypeScript/Node.js, Go, .NET, Java, Rust) and gives applications access to Copilot CLI's first-party tooling.
Features
- Multi-Platform Support: Python, TypeScript/Node.js, Go, .NET, Java, Rust (official); Clojure and C++ (community)
- Copilot Agent Runtime: Access to the same engine that powers Copilot CLI
- Custom Agents: Define behavior, tools, and skills per application
- BYOK (Bring Your Own Key): Use your own API keys for cost control and privacy
- Multiple Authentication Methods: GitHub OAuth, environment variables, and more
- First-Party Tool Access: Copilot CLI's default tools available by default
- Customizable Tool Availability: Control which tools each application can access
- Runtime Model Selection: Choose models per invocation
Installation
TypeScript / Node.js:
npm install @github/copilot-sdk
Python:
pip install github-copilot-sdk
Go:
go get github.com/github/copilot-sdk/go
.NET:
dotnet add package GitHub.Copilot.SDK
Rust:
cargo add github-copilot-sdk
Java (Maven):
<dependency>
<groupId>com.github</groupId>
<artifactId>copilot-sdk-java</artifactId>
</dependency>
Quick Start
TypeScript:
import { createAgent } from '@github/copilot-sdk';
const agent = createAgent({
model: 'gpt-4o',
tools: ['filesystem', 'shell', 'web-search'],
});
const result = await agent.run('Find and fix the bug in src/auth.ts');
console.log(result.output);
Python:
from github_copilot_sdk import create_agent
agent = create_agent(
model="gpt-4o",
tools=["filesystem", "shell"]
)
result = agent.run("Refactor the database module for async support")
print(result.output)
Core Concepts
Agent Runtime
The SDK provides a production-tested runtime that handles agent looping, tool dispatch, error recovery, and context management — all tested at GitHub's scale.
Tools
Tools are the building blocks of agent capabilities. The SDK includes filesystem, shell, web search, and more, and applications can add custom tools for domain-specific workflows.
Skills
Skills define reusable workflows that agents can invoke. The SDK is compatible with GitHub's skill ecosystem and supports custom skill definitions.
Advanced Features
Custom Agent with BYOK
const agent = createAgent({
apiKey: process.env.MY_OPENAI_KEY,
model: 'claude-4.7-opus',
tools: ['filesystem', 'shell', 'custom-analysis'],
permissions: {
network: 'allow',
filesystem: 'read-write',
},
});
Streaming Agent Output
for await (const chunk of agent.stream('Explain this codebase architecture')) {
process.stdout.write(chunk.text);
}
Examples
- CI/CD Agent: Embed a Copilot agent in your CI pipeline for automated code review and fix suggestions
- IDE Plugin: Build a custom editor extension with Copilot's agent capabilities
- CLI Tool: Create domain-specific CLI tools powered by the Copilot agent runtime
- Internal Developer Platform: Provide agents for onboarding, documentation, and debugging
Pros
- ✅ Officially supported by GitHub — production-quality runtime
- ✅ Six official platforms cover most development stacks
- ✅ Access to Copilot CLI's battle-tested tooling
- ✅ BYOK for cost control and data privacy
- ✅ No need to build orchestration from scratch
- ✅ Backed by GitHub's scale and reliability
Cons
- ❌ Tied to GitHub's ecosystem and roadmap
- ❌ Requires GitHub Copilot subscription for full feature access
- ❌ New SDK with limited real-world production examples
- ❌ Less flexible than general-purpose frameworks for non-GitHub use cases
- ❌ Custom tool and skill APIs still maturing
When to Use
Use the GitHub Copilot SDK when building applications that benefit from GitHub's production-tested agent runtime, especially within GitHub's ecosystem (CI/CD, IDE plugins, developer tools). Ideal for teams already on Copilot who want to extend agentic capabilities into custom workflows.
