Skip to content

Guide · Open source

How to use copilot-sdk: install and run your first agent

Updated · written with AI from the project's own documentation and checked against our catalogue data

The GitHub Copilot SDK (copilot-sdk) lets your own code call the same agent engine that powers Copilot CLI. You define the agent's behavior, and Copilot handles planning, tool calls and file edits. This guide is for developers who want to add agent features to an existing app or service, and it shows how to install the SDK and what you need in place before you start.

Copilot SDKgithub/copilot-sdk · ★ 10.6k · MIT

Quick start

  1. 1Check your subscription or BYOK setup. Confirm you have a GitHub Copilot subscription, or plan to use BYOK with your own LLM provider keys.
  2. 2Pick your language SDK. Choose one of Node.js/TypeScript, Python, Go, .NET, Java or Rust.
  3. 3Install the Copilot CLI if needed. Node.js, Python and .NET bundle it automatically. For Go, Java and Rust, install it manually or put copilot on your PATH.
  4. 4Install the SDK package. Run the package-manager command for your language, such as npm install @github/copilot-sdk.
  5. 5Read the Getting Started guide. Follow the Getting Started Guide and your SDK's README for usage examples and API reference.

What copilot-sdk is and who it is for

The SDK exposes the agent runtime behind Copilot CLI so you can invoke it programmatically instead of building your own agent orchestration. The README says it is available for Python, TypeScript/Node.js, Go, .NET, Java and Rust.

It fits teams already working in one of those languages who want agent features inside an application or service. If you only want to use Copilot interactively, the Copilot CLI or IDE tools are a better fit.

Check the requirements before you install

A GitHub Copilot subscription is required unless you use BYOK (Bring Your Own Key). With BYOK you configure API keys from supported LLM providers and can skip GitHub authentication.

The Copilot CLI is the engine the SDK talks to. For Node.js, Python and .NET it is bundled automatically. For Go, Java and Rust you install it manually or make sure `copilot` is on your PATH.

  • Subscription or BYOK setup
  • Copilot CLI: bundled for Node.js, Python and .NET; install manually for Go, Java and Rust
  • A project in one of the six supported languages

Install the SDK for your language

Use your language's package manager. The README lists these commands for each SDK. Java is installed through Maven coordinates; see the Java README for Maven and Gradle instructions.

  • Node.js / TypeScript: npm install @github/copilot-sdk
  • Python: pip install github-copilot-sdk
  • Go: go get github.com/github/copilot-sdk/go
  • Rust: cargo add github-copilot-sdk
  • Java: Maven coordinates com.github:copilot-sdk-java
  • Install the SDK for .NET with dotnet add package GitHub.Copilot.SDK
npm install @github/copilot-sdk

How the SDK talks to the Copilot CLI

All SDKs communicate with the Copilot CLI server over JSON-RPC. Your application calls the SDK client, which sends JSON-RPC to the Copilot CLI running in server mode.

The SDK manages the CLI process lifecycle automatically. You can also connect to an external CLI server; the Getting Started Guide covers running the CLI in server mode.

Read the Getting Started guide and SDK README

The README points to a Getting Started Guide for a full walkthrough and to each SDK's own README for usage examples and API reference. Language-specific cookbooks are linked from the main README table.

Some elicitation schema behaviour differs by language. The README notes that Node.js and Rust pass the wire schema through, while Python, Go, .NET and Java rebuild it from modeled fields, so portable apps should rely only on modeled properties.

What people use it for

  • Adding an agent that plans and edits files inside an existing Node.js or .NET service
  • Calling Copilot's tool invocation from a Python backend without writing your own orchestration
  • Embedding agent workflows in a Go or Rust application that already runs the Copilot CLI

Frequently asked questions

Do I need a GitHub Copilot subscription to use copilot-sdk?

Yes, the README says a GitHub Copilot subscription is required unless you use BYOK (Bring Your Own Key). With BYOK you configure your own API keys from supported LLM providers and can use the SDK without GitHub authentication.

How do I install copilot-sdk?

Use your language's package manager. The README lists npm install @github/copilot-sdk for Node.js and TypeScript, pip install github-copilot-sdk for Python, dotnet add package GitHub.Copilot.SDK for .NET, and go get github.com/github/copilot-sdk/go for Go.

Is copilot-sdk free?

The source does not state pricing. It says a GitHub Copilot subscription is required unless you use BYOK, so check the subscription terms yourself. The repository is licensed under MIT.

Do I have to install the Copilot CLI separately?

Not for Node.js, Python and .NET, where the CLI is bundled automatically. For Go, Java and Rust you install the CLI manually or make sure copilot is available in your PATH.

Which languages does copilot-sdk support?

The README lists Python, TypeScript/Node.js, Go, .NET, Java and Rust. The source does not mention other languages, so languages outside these six are not covered.

How does copilot-sdk compare to LangChain or Semantic Kernel?

The source does not compare them directly. Copilot SDK's distinct point, per the README, is that it exposes the same agent engine as Copilot CLI and handles planning, tool calls and file edits for you. Projects like LangChain, Microsoft Semantic Kernel and OpenAI Agents SDK are alternatives to evaluate against your needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use copilot-sdk if you are a developer adding agent features to an app or service in Node.js, Python, Go, .NET, Java or Rust and you have a Copilot subscription or plan to use BYOK. If you only need Copilot interactively, or you work in another language, the Copilot CLI, IDE tools or a framework like LangChain or Semantic Kernel may suit you better.

Install options & downloads