Prerequisites for Using the GitHub Copilot SDK: Complete Technical Setup Guide
Before using the GitHub Copilot SDK, you need a GitHub Copilot subscription (or BYOK configuration), a supported language runtime (Node ≥14, Python ≥3.8, Go ≥1.20, .NET ≥6, Java ≥11, or Rust stable), the Copilot CLI binary on your PATH (or use the bundled CLI for Node.js, Python, and .NET), and valid authentication credentials via OAuth or environment variables.
The GitHub Copilot SDK is a production-tested client library that enables your applications to drive Copilot’s agentic workflows across multiple programming languages. Before importing the SDK from the github/copilot-sdk repository, you must satisfy specific runtime, authentication, and tooling prerequisites for using the Copilot SDK. This guide covers every requirement based on the official source code and documentation.
Runtime and Language Requirements
Supported Language Versions
The SDK supports six language implementations, each with specific minimum runtime versions according to README.md#available-sdks:
- Node.js ≥14 (npm)
- Python ≥3.8 (pip)
- Go ≥1.20 (go get)
- .NET ≥6 (dotnet)
- Java ≥11 (Maven/Gradle)
- Rust stable (cargo)
Package Manager Installation
Install the SDK via your language's package manager as documented in the repository root README.md and individual language READMEs (e.g., nodejs/README.md, python/README.md, go/README.md).
Authentication and Subscription Prerequisites
GitHub Copilot Subscription or BYOK
According to README.md#faq, you need either:
- Standard: A paid GitHub Copilot subscription for regular usage
- BYOK (Bring-Your-Own-Key): Configuration allowing you to provide your own LLM API keys (OpenAI, Azure AI, Anthropic, etc.) instead of using GitHub authentication
Credential Configuration
As detailed in docs/auth/authenticate.md, the SDK accepts authentication via:
- Interactive OAuth: Run
copilot loginto authenticate interactively - Environment variables:
COPILOT_GITHUB_TOKEN,GH_TOKEN, orGITHUB_TOKEN - BYOK mode: Provider-specific variables such as
OPENAI_API_KEY
Copilot CLI Installation Requirements
The SDK communicates with the Copilot CLI via JSON-RPC. Requirements vary by language according to docs/setup/bundled-cli.md:
Bundled CLI (Automatic)
For Node.js, Python, and .NET, the CLI is bundled automatically during SDK installation. No additional binary management is required.
Manual CLI Installation
For Go, Java, and Rust, you must ensure the copilot binary is available on your system PATH. Alternatively, explicitly configure the bundled CLI option if available for your platform.
Network and Deployment Prerequisites
Network Access
Per docs/setup/backend-services.md, the SDK requires:
- Access to the Copilot CLI server (local socket or TCP)
- For BYOK configurations: Connectivity to external LLM provider endpoints
Optional: Docker and Server Mode
For multi-tenant server deployments documented in docs/setup/multi-tenancy.md, you need Docker or another container runtime, plus a host capable of exposing the CLI's TCP port for remote SDK connections.
Installation and Verification Examples
Node.js / TypeScript
// Install the SDK (bundled CLI is installed automatically)
npm install @github/copilot-sdk
import { Copilot } from '@github/copilot-sdk';
// Create a client – authentication is taken from the bundled CLI login
const client = new Copilot();
await client.run({
prompt: "Write a function to reverse a string in JavaScript"
});
Python
# Install the SDK (bundled CLI is installed automatically)
pip install github-copilot-sdk
from copilot_sdk import Copilot
# Authentication uses the logged‑in Copilot CLI or env vars
client = Copilot()
response = client.run(prompt="Generate a Dockerfile for a Flask app")
print(response)
Go
// Install the SDK and ensure the Copilot CLI binary is on PATH
go get github.com/github/copilot-sdk/go
import (
"context"
"github.com/github/copilot-sdk/go/copilot"
)
func main() {
client := copilot.New()
// If using BYOK, set provider keys in env vars before creating the client
result, _ := client.Run(context.Background(), "Explain Go modules")
fmt.Println(result)
}
.NET (C#)
// Install the SDK (bundled CLI is installed automatically)
// dotnet add package GitHub.Copilot.SDK
using GitHub.Copilot.SDK;
var client = new CopilotClient(); // picks up copilot login or env token
var response = await client.RunAsync("Write a LINQ query that groups customers by country");
Console.WriteLine(response);
Java
// Maven coordinates: com.github:copilot-sdk-java
// Add the dependency to your pom.xml and ensure `copilot` is on PATH
import com.github.copilot.sdk.CopilotClient;
CopilotClient client = new CopilotClient(); // authenticates automatically
String result = client.run("Generate a Spring Boot controller");
System.out.println(result);
Rust
# Cargo.toml
github-copilot-sdk = "0.5"
use github_copilot_sdk::Copilot;
#[tokio::main]
async fn main() {
// The CLI binary must be reachable; if not, set `COPILOT_BINARY` env var
let client = Copilot::new();
let resp = client.run("Write a Rust function to compute Fibonacci numbers").await;
println!("{}", resp);
}
Summary
- You need a GitHub Copilot subscription or BYOK configuration with third-party LLM API keys to authenticate API requests
- Language-specific runtimes range from Node ≥14 to Java ≥11, depending on your chosen SDK implementation
- The Copilot CLI is bundled automatically for Node.js, Python, and .NET, but requires manual PATH configuration for Go, Java, and Rust
- Authentication works via
copilot loginOAuth flow or environment variables (COPILOT_GITHUB_TOKEN,GH_TOKEN,GITHUB_TOKEN) - Network access must allow communication with the local CLI server and external LLM endpoints for BYOK setups
- Docker is required only for multi-tenant server deployments exposing the CLI via TCP
Frequently Asked Questions
Do I need a paid GitHub Copilot subscription to use the SDK?
Yes, a paid subscription is required for standard usage according to the FAQ in README.md. However, you can enable BYOK (Bring-Your-Own-Key) mode to use your own OpenAI, Azure AI, or Anthropic API keys instead of GitHub authentication, bypassing the subscription requirement.
Why does the Go/Java/Rust SDK require manual CLI installation while Node.js does not?
Per docs/setup/bundled-cli.md, the Node.js, Python, and .NET SDKs automatically bundle the Copilot CLI binary during installation through their respective package managers. For Go, Java, and Rust, you must manually ensure the copilot binary exists on your system PATH or explicitly configure the bundled CLI option in your environment.
Can I run the Copilot SDK in a Docker container or Kubernetes cluster?
Yes, according to docs/setup/multi-tenancy.md, you can deploy the SDK in multi-tenant server environments using Docker or other container runtimes. This setup requires exposing the CLI's TCP port and configuring the SDK to communicate via network sockets rather than local IPC, making it suitable for Kubernetes sidecar or service mesh deployments.
What authentication method should I use for CI/CD pipelines?
For automated environments, set the COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN environment variable rather than using interactive OAuth flows, as documented in docs/auth/authenticate.md. For BYOK deployments in CI/CD, use provider-specific keys like OPENAI_API_KEY or ANTHROPIC_API_KEY instead of GitHub tokens.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →