gitmyhub

copilot-sdk

Java ★ 9.4k updated 1d ago

Multi-platform SDK for integrating GitHub Copilot Agent into apps and services

The GitHub Copilot SDK is a set of libraries that lets developers embed GitHub Copilot's AI agent capabilities directly into their own applications. Rather than building a custom AI agent from scratch, you use this SDK to hook into the same planning and execution engine that powers the Copilot CLI tool, and call it programmatically from your code.

The SDK is available for Python, Node.js and TypeScript, Go, .NET, Java, and Rust (in technical preview). Each language has its own package installable through the standard package manager for that language, such as pip for Python or npm for Node.js. All of the SDK packages communicate with a Copilot CLI server process running locally, using a JSON-RPC protocol. The SDK handles starting and managing that process automatically for most languages.

With the SDK, your application can describe agent behavior and then let Copilot handle the details of planning steps, invoking tools, making file edits, and so on. You define what the agent should do at a high level; the SDK and the underlying engine work out how to do it.

Using the SDK requires a GitHub Copilot subscription for standard usage. There is also a bring-your-own-key option that lets you supply API keys from providers like OpenAI, Anthropic, or Azure instead of using GitHub authentication. Authentication can be handled through stored GitHub credentials, OAuth tokens, environment variables, or the bring-your-own-key path.

The repository contains subdirectories for each language SDK, plus documentation for getting started, authentication setup, and connecting to an external CLI server if needed.