Liking cljdoc? Tell your friends :D

GitHub Copilot SDK - Supercharged

GitHub Copilot SDK SUPERCHARGED

npm PyPI crates.io NuGet Maven Central Gem Hex Clojars LuaRocks GitHub Stars Registries Languages

npm downloads PyPI downloads crates.io downloads NuGet downloads RubyGems downloads Hex.pm downloads

40 languages. One SDK. Agents for every app.

Trusted by 100,000+ developers globally and growing daily.

Embed Copilot's agentic workflows in your application - now available in public preview as a programmable SDK for 40 languages.

The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-tested agent runtime you can invoke programmatically. No need to build your own orchestration - you define agent behavior, Copilot handles planning, tool invocation, file edits, and more.

⭐ If you find this SDK useful, star the repo! It helps others discover it and keeps us motivated to ship more.

Available SDKs

SDKLocationCookbookInstallation
.NET / C#dotnet/Cookbookdotnet add package CopilotSDK.Supercharged
Adaada/CookbookAlire
Cc/CookbookCMake
C++cpp/CookbookCMake
Clojureclojure/Cookbooknet.clojars.jeremiahisaacson/copilot-sdk-supercharged
COBOLcobol/CookbookGnuCOBOL
Crystalcrystal/Cookbookshards install
Ddlang/Cookbookdub add copilot
Dartdart/Cookbookpub
Delphi / Object Pascaldelphi/CookbookBoss / Manual
Elixirelixir/Cookbook{:copilot_sdk_supercharged, "~> 2.0"}
Erlangerlang/CookbookRebar3
F#fsharp/Cookbookdotnet add package CopilotSDK.Supercharged.FSharp
Fortranfortran/Cookbookfpm
Gogo/Cookbookgo get github.com/microsoft/copilot-sdk/go/v2
Groovygroovy/CookbookGradle
Haskellhaskell/CookbookCabal
Javajava/Cookbookio.github.jeremiahjordanisaacson:copilot-sdk-supercharged
Juliajulia/CookbookPkg.add("CopilotSDK")
Kotlinkotlin/CookbookGradle
Lualua/Cookbookluarocks install copilot-sdk-supercharged
MATLABmatlab/Cookbookaddpath
Nimnim/Cookbooknimble install copilot_sdk
Node.js / TypeScriptnodejs/Cookbooknpm install copilot-sdk-supercharged
Objective-Cobjc/CookbookCocoaPods / SPM
OCamlocaml/Cookbookopam install copilot-sdk-supercharged
Perlperl/CookbookCPAN
PHPphp/CookbookComposer
Pythonpython/Cookbookpip install copilot-sdk-supercharged
Rr/CookbookCRAN
Rubyruby/Cookbookgem install copilot-sdk-supercharged
Rustrust/Cookbookcargo add copilot-sdk-supercharged
Scalascala/Cookbooksbt
Shell / Bashshell/CookbookSource
Soliditysolidity/Cookbooknpm install copilot-sdk-solidity
Swiftswift/CookbookSwift Package Manager
Tcltcl/Cookbookpackage require copilot
V (Vlang)vlang/Cookbookv install copilot_sdk
Visual Basicvisualbasic/Cookbookdotnet add package CopilotSDK.Supercharged.VB
Zigzig/Cookbookzig fetch

See the individual SDK READMEs for usage examples and API reference. For architecture details, see MULTI_LANGUAGE_SDKS.md.

What's New in v3.0.0

Major release: SDK protocol 4 and the Microsoft Copilot SDK 2.0 sync. Copilot CLI 1.0.113 and newer speak SDK protocol 4, which groups session options (inference, tools, permissions, events, and more) and rejects the flat payloads that v2.x SDKs send, so every v2.x SDK fails to start against a current CLI. v3.0.0 moves all 40 SDKs to protocol 4. See the CHANGELOG for the full list.

  • Protocol 4 in all 40 SDKs: requires Copilot CLI (or runtime) 1.0.113 or newer; older runtimes are rejected at startup with a clear protocol version error.
  • Core SDKs track upstream Microsoft Copilot SDK 2.0 (Node.js, Python, Go, .NET): explicit client mode (coding-agent or empty), runtime connections with in-process hosting by default, grouped client and session options, and named BYOK providers. These are breaking changes; follow the v2 breaking changes guide. Registry package names do not change (copilot-sdk-supercharged, CopilotSDK.Supercharged); the .NET namespace is now Microsoft.Copilot and the Go module path is github.com/microsoft/copilot-sdk/go/v2.
  • The 36 additional SDKs stay source compatible: existing options keep working, and each SDK translates them into the protocol 4 grouped payload internally.
  • New in every SDK: named BYOK providers and model definitions, idempotent tools, client turn IDs, explicit client mode, tool.shell_output events, shell authentication prompts, a memory store callback, network proxy and authentication callbacks, Policy Helper failure details and recheck, and the permission-mode refusal reason.
  • Also new in the additional SDKs (the v2.6 feature wave): client info handshake, Auto routing tier, ask-user variant, session-scoped GitHub token provider, sandbox bypass, feature flag overrides, session detach, message source, managed settings cache clear, model allowlist, OAuth client metadata URL, max output tokens override, structured output, agent and hook directories, working directory trust, transcript recovery, image generation config, autopilot options, subagent lifecycle hooks, and the BYOK API key command.
  • Security and CI: refreshed test harness dependencies (0 npm audit findings), a new core SDK test workflow, and E2E harnesses that use the Copilot CLI 1.0.113 npm loader.

Coverage is enforced by scripts/verify-sdk-coverage.mjs, which now also checks that every additional SDK declares SDK protocol 4.

Previous releases

  • v2.5.3: PyPI package name fixed (copilot-sdk-supercharged), a High-severity ReDoS fix in the Python code generator, OIDC trusted publishing for npm, PyPI, and pub.dev, and "Recent Features (v2.4 to v2.5)" sections in all 40 SDK READMEs.
  • v2.5.2: user_setting permission source, optional login on AccountLoginRequest, and Jackson 2.18.10 for the Java SDK.
  • v2.5.0: session rewind, in-process (FFI) transport, additional session directories, disabled MCP servers and GitHub MCP tool config, canvas provider, reasoningEffort: max with tool search, and Agent Factories argsSchema.
  • v2.4.0: MCP OAuth host token handlers, BYOK bearer-token provider, session memory, WebSocket transport, citations, and per-session AI-credit budgets (sessionLimits).

Getting Started

For a complete walkthrough, see the Getting Started Guide.

Quick steps:

  1. (Optional) Install the Copilot CLI

The Node.js SDK installs its runtime through an optional @microsoft/copilot-sdk-<platform> package, and the .NET SDK downloads the CLI at build time, so no separate installation is required for them. For Python, Go, and the 36 additional SDKs, install the Copilot CLI 1.0.113 or newer (or point COPILOT_CLI_PATH at it); published Python packages can also download a pinned runtime with python -m copilot download-runtime --in-process.

  1. Install your preferred SDK using the commands above.

  2. See the SDK README for usage examples and API documentation.

Architecture

All SDKs drive the Copilot agent runtime over JSON-RPC. The 36 additional SDKs host the runtime in the Copilot CLI, started as a child process in server mode (or attach to an external CLI server):

Your Application
       ↓
  SDK Client
       ↓ JSON-RPC
  Copilot CLI (server mode)

The SDK manages the CLI process lifecycle automatically. You can also connect to an external CLI server. See the Getting Started Guide for details on running the CLI in server mode.

The four core SDKs (Node.js, Python, Go, .NET) follow Microsoft Copilot SDK 2.0 and load the native Copilot runtime into your application by default. They carry the same JSON-RPC messages over an in-memory connection through a C ABI, so no CLI process is started:

Your Application
       ↓
  SDK Client
       ↓ JSON-RPC (in memory, C ABI)
  Native Copilot runtime

The SDK manages its runtime host, but the native library remains loaded for the application process lifetime. In-process hosting provides neither crash isolation nor a sandbox. See Run the Copilot runtime in process for requirements and v2 migration options.

You can also run the runtime outside your application process:

  • Spawned child process: select a spawned stdio or TCP connection (RuntimeConnection.forSpawnedStdio() or RuntimeConnection.forSpawnedTcp() in TypeScript and Java; each SDK has an equivalent). The SDK starts the runtime as a child process and manages its lifecycle. Use it when you need crash isolation or per-client process configuration.
  • Standalone runtime server: run copilot-runtime --server yourself and attach to it over TCP with RuntimeConnection.forTcp(host, port). One multi-tenant runtime server can serve many SDK clients and concurrent sessions. See Connecting to a standalone runtime server.

Portable elicitation schemas

For form elicitation callbacks, the portable schema contract is an object form with modeled properties and optional required fields (type: "object" on the wire; an SDK may represent the object type implicitly). Applications that support multiple SDK languages must use the modeled property definitions and must not depend on additional schema metadata (such as a top-level title) or on the insertion order of properties.

Node.js and Rust pass through the wire schema, including additional metadata and property order. Python, Go, .NET, and Java reconstruct the callback schema from the modeled fields and do not offer that same preservation guarantee. Treat wire-schema preservation as a language-specific capability, not a cross-language requirement.

Agent Finder Skill installation APIs

Runtimes that grant skill-confirmed-installation expose skills.planInstall, skills.applyInstall, skills.planUninstall, skills.applyUninstall, skills.installations.list/recover/status/cancel, and skills.installations.setEnabled. Skill install reviews include the full verified SKILL.md content up to 256 KiB, catalogue identity, file manifest, and non-absolute personal target location. Summaries report ownershipState, configuredEnabled, sessionState, retained catalogue identity and installedAt.

FAQ

Do I need a GitHub Copilot subscription to use the SDK?

Yes, a GitHub Copilot subscription is required to use the Microsoft Copilot SDK, unless you are using BYOK (Bring Your Own Key). With BYOK, you can use the SDK without GitHub authentication by configuring your own API keys from supported LLM providers. For standard usage (non-BYOK), refer to the GitHub Copilot pricing page, which includes a free tier with limited usage.

How does billing work for SDK usage?

Billing for the GitHub Copilot SDK is based on the same model as the Copilot CLI, with each prompt being counted towards your premium request quota. For more information on premium requests, see Requests in GitHub Copilot.

Does it support BYOK (Bring Your Own Key)?

Yes, the GitHub Copilot SDK supports BYOK (Bring Your Own Key). You can configure the SDK to use your own API keys from supported LLM providers (e.g. OpenAI, Azure AI Foundry, Anthropic) to access models through those providers. See the BYOK documentation for setup instructions and examples.

Note: BYOK uses key-based authentication only. Microsoft Entra ID (Azure AD), managed identities, and third-party identity providers are not supported.

What authentication methods are supported?

The SDK supports multiple authentication methods:

  • GitHub signed-in user - Uses stored OAuth credentials from copilot CLI login
  • OAuth GitHub App - Pass user tokens from your GitHub OAuth app
  • Environment variables - COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN
  • BYOK - Use your own API keys (no GitHub auth required)

See the Authentication documentation for details on each method.

Do I need to install the Copilot CLI separately?

It depends on the SDK. The core SDKs need a compatible native runtime rather than a separately running CLI: the Node.js SDK installs it through an optional platform package, the .NET SDK downloads it at build time, published Python packages download a pinned runtime on demand, and Go needs application-level bundling (see the Go README) or an explicit runtime path. The 36 additional SDKs start the Copilot CLI as a child process, so install the Copilot CLI 1.0.113 or newer, or set COPILOT_CLI_PATH.

Advanced: every SDK can attach to an external runtime or CLI server over TCP instead (for example RuntimeConnection.forTcp(host, port) in the core TypeScript SDK; see each SDK's README for its option).

What tools are enabled by default?

By default, the SDK will operate the Copilot CLI in the equivalent of --allow-all being passed to the CLI, enabling all first-party tools, which means that the agents can perform a wide range of actions, including file system operations, Git operations, and web requests. You can customize tool availability by configuring the SDK client options to enable and disable specific tools. Refer to the individual SDK documentation for details on tool configuration and Copilot CLI for the list of tools available.

Can I use custom agents, skills or tools?

Yes, the Microsoft Copilot SDK allows you to define custom agents, skills, and tools. You can extend the functionality of the agents by implementing your own logic and integrating additional tools as needed. Refer to the SDK documentation of your preferred language for more details.

Are there instructions for Copilot to speed up development with the SDK?

Yes, check out the custom instructions for each SDK:

What models are supported?

All models available via Copilot CLI are supported in the SDK. The SDK also exposes a method which will return the models available so they can be accessed at runtime.

Is the SDK production-ready?

The GitHub Copilot SDK is currently in Public Preview. While it is functional and can be used for development and testing, it may not yet be suitable for production use.

How do I report issues or request features?

Please use the GitHub Issues page to report bugs or request new features. We welcome your feedback to help improve the SDK.

Quick Links

License

MIT

Can you improve this documentation? These fine people already did:
Jeremiah Isaacson, copilot-cli-release-app[bot], Patrick Nikoletich, Bruno Borges, Copilot, Stephen Toub, Scott Addie, Aaron Powell, Ashley Wolf, Ed Burns, copilot-sdk-mirror-writer[bot], Sanzo, Karl Krukow, mohamed_amine_hamdi, Quim Muntal, kirankashyap, coleflennikenmsft, Adrien Friggeri, Steve Sanderson, Rob Emanuele & Andy Feller
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close