GitHub Copilot SDK Technical Requirements: Language Runtimes, CLI Setup, and Authentication

The GitHub Copilot SDK requires specific language runtime versions—Node.js 20.19+, Python 3.9+, Go 1.22+, .NET 8+, Rust 1.78+, or Java JDK 17+—along with the GitHub Copilot CLI, which is either bundled automatically or must be installed manually depending on the language, plus valid GitHub or third-party LLM authentication tokens.

The GitHub Copilot SDK is a collection of language-specific client libraries that embed the GitHub Copilot CLI runtime to enable programmatic AI interactions. According to the source code in github/copilot-sdk, each language binding has distinct technical requirements regarding minimum runtime versions, CLI bundling behavior, and dependency management. Understanding these prerequisites ensures proper SDK initialization and runtime connectivity.

Language-Specific Runtime Requirements

Each SDK targets a specific minimum language version and handles CLI distribution differently.

Node.js and TypeScript

The Node.js SDK requires Node.js 20.19 or newer (or Node.js ≥22.12) as specified in nodejs/README.md. The GitHub Copilot CLI is bundled automatically with the npm package, so no separate CLI installation is required.

Python

The Python SDK requires Python 3.9 or newer according to python/README.md. The CLI is bundled as a dependency when you install via pip install github-copilot-sdk.

Go

The Go SDK requires Go 1.22 or newer as documented in go/README.md. Unlike Node.js and Python, the CLI is not bundled; you must install the copilot binary manually and ensure it is available on your system PATH, or provide a custom RuntimeConnection via TCP or URI.

.NET

The .NET SDK requires .NET 8 or newer per dotnet/README.md. The CLI is bundled automatically when you add the NuGet package GitHub.Copilot.SDK.

Rust

The Rust SDK requires Rust 1.78 or newer according to rust/README.md. The CLI is not bundled, so you must install it manually or ensure copilot is on your $PATH.

Java

The Java SDK requires JDK 17 or newer as specified in java/README.md. The CLI is not bundled; use Maven or Gradle coordinates com.github:copilot-sdk-java and install the CLI separately.

Copilot CLI and Runtime Architecture

All SDKs communicate with the GitHub Copilot CLI via JSON-RPC. The CLI distribution model varies by language:

  • Bundled automatically: Node.js, Python, and .NET SDKs include the CLI binary as part of the package installation.
  • Manual installation required: Go, Rust, and Java require you to install the CLI separately and ensure the binary is executable on your system path.

For advanced deployment scenarios, the SDK supports custom RuntimeConnection configurations (e.g., TCP sockets or custom URIs) as detailed in docs/setup/index.md, enabling multi-tenant deployments and remote CLI management.

Authentication and Network Prerequisites

Internet Connectivity

Active internet connectivity is required to download models from configured providers (OpenAI, Azure, Anthropic, Ollama, etc.) unless you are running a self-hosted provider entirely within your network.

Authentication Tokens

The SDK supports two authentication modes as implemented in the root README.md:

  • GitHub Copilot authentication: Provide a valid Copilot subscription token via environment variables COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN.
  • BYOK (Bring Your Own Key): For custom providers, supply an API key or bearer token for supported LLM providers such as OpenAI, Azure OpenAI, or Ollama.

Supported Operating Systems

The GitHub Copilot CLI runs on Linux, macOS, and Windows via bundled binaries, ensuring cross-platform compatibility for all SDK languages.

Optional Telemetry

If you require OpenTelemetry traces, provide a telemetry configuration in the client options. No additional dependencies are required beyond the SDK itself, as noted in nodejs/README.md.

Implementation Examples by Language

Node.js Quick Start

The following example creates a client, starts a session with automatic tool approval, and streams a response. This requires Node.js 20.19+ and @github/copilot-sdk:

import { CopilotClient, approveAll } from "@github/copilot-sdk";

async function main() {
  const client = new CopilotClient();
  await client.start();

  const session = await client.createSession({
    model: "gpt-4o-mini",
    onPermissionRequest: approveAll,
  });

  const done = new Promise<void>((resolve) => {
    session.on("assistant.message_delta", (e) => process.stdout.write(e.data.deltaContent));
    session.on("session.idle", resolve);
  });

  await session.send({ prompt: "Explain the difference between async and sync in JavaScript." });
  await done;
  await client.stop();
}

main().catch(console.error);

Python Minimal Setup

This Python example demonstrates basic session creation and prompt handling. Requires Python 3.9+ and pip install github-copilot-sdk:

from github_copilot_sdk import CopilotClient, approve_all

client = CopilotClient()
client.start()

session = client.create_session(
    model="gpt-4o-mini",
    on_permission_request=approve_all,
)

session.send({"prompt": "Summarize the main ideas in the Theory of Relativity."})
session.wait_until_idle()
client.stop()

Go with Custom Provider (BYOK)

This Go example connects to a local Ollama instance. Requires Go 1.22+, go get github.com/github/copilot-sdk/go, and the copilot binary on your PATH:

package main

import (
    "context"
    "log"

    copilot "github.com/github/copilot-sdk/go"
)

func main() {
    client, err := copilot.NewClient()
    if err != nil { log.Fatal(err) }
    defer client.Stop(context.Background())

    sess, err := client.CreateSession(context.Background(), copilot.SessionConfig{
        Model: "deepseek-coder-v2:16b",
        Provider: &copilot.ProviderConfig{
            Type:    "openai",
            BaseURL: "http://localhost:11434/v1",
        },
        OnPermissionRequest: copilot.ApproveAll,
    })
    if err != nil { log.Fatal(err) }

    _, err = sess.Send(context.Background(), copilot.MessageOptions{
        Prompt: "Write a Go function that reverses a slice.",
    })
    if err != nil { log.Fatal(err) }

    sess.WaitUntilIdle(context.Background())
}

.NET Basic Usage

This C# example shows async/await patterns with the bundled CLI. Requires .NET 8+ and dotnet add package GitHub.Copilot.SDK:

using GitHub.Copilot.SDK;

var client = new CopilotClient();
await client.StartAsync();

var session = await client.CreateSessionAsync(new SessionConfig {
    Model = "gpt-4o-mini",
    OnPermissionRequest = PermissionHandlers.ApproveAll,
});

await session.SendAsync(new MessageOptions { Prompt = "List the top 3 features of C# 12." });

await session.WaitUntilIdleAsync();

await client.StopAsync();

Summary

  • Runtime versions: Node.js 20.19+, Python 3.9+, Go 1.22+, .NET 8+, Rust 1.78+, or Java JDK 17+ are required depending on your language.
  • CLI distribution: Node.js, Python, and .NET bundle the CLI automatically; Go, Rust, and Java require manual CLI installation.
  • Authentication: Supply COPILOT_GITHUB_TOKEN for GitHub Copilot access, or provider-specific API keys for BYOK configurations.
  • Connectivity: Internet access is required for cloud model providers unless using fully self-hosted solutions.
  • Cross-platform: The SDK supports Linux, macOS, and Windows across all language implementations.

Frequently Asked Questions

Do I need to install the GitHub Copilot CLI separately for every language?

No. If you use the Node.js, Python, or .NET SDK, the CLI is bundled automatically with the package. However, if you use Go, Rust, or Java, you must install the CLI manually and ensure the copilot binary is available on your system PATH before initializing the client.

Can I use the Copilot SDK with my own LLM provider instead of GitHub's Copilot?

Yes. The SDK supports BYOK (Bring Your Own Key) configurations for providers like OpenAI, Azure OpenAI, and Ollama. You must provide the Provider configuration with Type and BaseURL parameters, along with your provider-specific API key, rather than using GitHub authentication tokens.

What authentication token should I use if I'm building a tool for personal use?

Set the COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN environment variable with a valid GitHub personal access token that has Copilot access. For organization-wide deployments, ensure the token has the appropriate scopes for Copilot usage as defined in your GitHub organization settings.

Are there any operating system restrictions for running the Copilot SDK?

No. The GitHub Copilot SDK supports Linux, macOS, and Windows across all language variants. The underlying CLI binaries are bundled for these platforms, though Java, Go, and Rust developers must download the appropriate CLI binary for their specific OS separately if not using a bundled SDK.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →