21 Languages · One SDK

Copilot SDK SUPERCHARGED

Embed GitHub Copilot's agentic workflows in your application. Custom tools, streaming, hooks, and full programmatic control — now in every major language.

Get Started View Examples
0
Languages
0
Package Registries
0
Source Files
npm PyPI crates.io NuGet RubyGems Hex Clojars LuaRocks

Every Language You Need

21 SDKs. Same protocol, same capabilities, idiomatic to each language.

Built for Real Applications

Every feature of the Copilot CLI, accessible through a clean programmatic API.

🛠

Custom Tools

Define tools that Copilot can call — database lookups, API calls, file operations. You write the handler, Copilot decides when to use it.

Streaming Responses

Get responses token-by-token as they're generated. Build real-time UIs with assistant.message_delta events.

🔗

Session Hooks

Intercept and modify behavior at every lifecycle point — pre/post tool use, prompt submission, session start/end, error handling.

🔑

BYOK Support

Bring your own API keys from OpenAI, Azure, or Anthropic. Use any compatible model without a Copilot subscription.

🔌

MCP Servers

Connect to Model Context Protocol servers for pre-built tool integrations — GitHub, databases, file systems, and more.

🤖

Custom Agents

Define specialized AI personas with custom prompts, tools, and MCP servers. Build a fleet of purpose-built assistants.

Get Started in Minutes

Five lines of code to your first Copilot-powered app.

import { CopilotClient } from "copilot-sdk-supercharged";

const client = new CopilotClient();
const session = await client.createSession();

const response = await session.sendAndWait({
    prompt: "What is 2 + 2?"
});
console.log(response?.data.content);

await client.stop();
from copilot import CopilotClient

async def main():
    client = CopilotClient()
    await client.start()

    session = await client.create_session()
    response = await session.send_and_wait({
        "prompt": "What is 2 + 2?"
    })

    print(response.data.content)
    await client.stop()
client := copilot.NewClient(nil)
client.Start(ctx)

session, _ := client.CreateSession(ctx, nil)
response, _ := session.SendAndWait(ctx,
    copilot.MessageOptions{
        Prompt: "What is 2 + 2?",
    },
)

fmt.Println(*response.Data.Content)
client.Stop()
using GitHub.Copilot.SDK;

await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync();

var response = await session.SendAndWaitAsync(
    new MessageOptions { Prompt = "What is 2 + 2?" }
);
Console.WriteLine(response?.Data.Content);
CopilotClient client = new CopilotClient();
CopilotSession session = client.createSession();

SessionEvent response = session.sendAndWait(
    new MessageOptions("What is 2 + 2?")
);
System.out.println(response.data.get("content"));

client.stop();
let client = CopilotClient::new(None);
client.start().await?;

let session = client.create_session(None).await?;
let response = session.send_and_wait(
    MessageOptions {
        prompt: "What is 2 + 2?".into(),
        ..Default::default()
    }, None
).await?;

client.stop().await?;
client = Copilot::CopilotClient.new
client.start!

session = client.create_session!
response = session.send_and_wait!(
    prompt: "What is 2 + 2?"
)

puts response.data["content"]
client.stop!
use GitHub\Copilot\CopilotClient;
use GitHub\Copilot\Types\MessageOptions;

$client = new CopilotClient();
$client->start();

$session = $client->createSession();
$response = $session->sendAndWait(
    new MessageOptions("What is 2 + 2?")
);
echo $response->data['content'];

$client->stop();
import CopilotSDK

let client = CopilotClient()
try await client.start()

let session = try await client.createSession()
let response = try await session.sendAndWait(
    MessageOptions(prompt: "What is 2 + 2?")
)
print(response?.data["content"])

try await client.stop()
val client = CopilotClient()
client.start()

val session = client.createSession()
val response = session.sendAndWait(
    MessageOptions(prompt = "What is 2 + 2?")
)
println(response?.data?.get("content"))

client.stop()
#include <copilot/client.h>

auto client = copilot::CopilotClient();
client.start();

auto session = client.createSession();
auto response = session->sendAndWait(
    copilot::MessageOptions{.prompt = "What is 2 + 2?"}
);
std::cout << response.data["content"];

client.stop();
#include <copilot/copilot.h>

copilot_client_t* client = copilot_client_create(NULL);
copilot_client_start(client);

copilot_session_t* session;
copilot_client_create_session(client, NULL, &session);

const char* response;
copilot_session_send_and_wait(session,
    "What is 2 + 2?", &response);
printf("%s\n", response);

copilot_client_stop(client);
copilot_client_free(client);
import 'package:copilot_sdk_supercharged/copilot_sdk.dart';

final client = CopilotClient();
await client.start();

final session = await client.createSession();
final response = await session.sendAndWait(
    MessageOptions(prompt: 'What is 2 + 2?'),
);
print(response?.data['content']);

await client.stop();
val client = new CopilotClient()
client.start()

val session = Await.result(
    client.createSession(), 30.seconds)
val response = Await.result(
    session.sendAndWait(
        MessageOptions("What is 2 + 2?")
    ), 60.seconds)

println(response.data("content"))
client.stop()
library(copilot.sdk.supercharged)

client <- CopilotClient$new()
client$start()

session <- client$create_session()
response <- session$send_and_wait(
    "What is 2 + 2?"
)
cat(response$data$content)

client$stop()
use GitHub::Copilot::Client;

my $client = GitHub::Copilot::Client->new();
$client->start();

my $session = $client->create_session();
my $response = $session->send_and_wait(
    "What is 2 + 2?"
);
say $response->{data}{content};

$client->stop();
local Client = require("copilot.client")

local client = Client:new()
client:start()

local session = client:create_session()
local response = session:send_and_wait(
    { prompt = "What is 2 + 2?" }
)
print(response.data.content)

client:stop()
source ./lib/copilot_sdk.sh

copilot_client_start
copilot_client_create_session

copilot_session_send_and_wait "What is 2 + 2?"
echo "$COPILOT_SESSION_LAST_RESPONSE"

copilot_session_destroy
copilot_client_stop
{:ok, client} = Copilot.Client.start_link()
Copilot.Client.start!(client)

{:ok, session} = Copilot.Client.create_session(client)
{:ok, response} = Copilot.Session.send_and_wait(
    session, "What is 2 + 2?"
)
IO.puts(response.data["content"])

Copilot.Client.stop(client)
import Copilot.Client
import Copilot.Session

main :: IO ()
main = do
    client <- startClient defaultClientOptions
    session <- createSession client Nothing
    response <- sendAndWait session
        "What is 2 + 2?" Nothing
    putStrLn (content response)
    stopClient client
(require '[copilot.client :as client])
(require '[copilot.session :as session])

(let [c (client/create-client)]
  (client/start! c)
  (let [s (client/create-session! c)]
    (let [resp (session/send-and-wait! s
               "What is 2 + 2?")]
      (println (:content (:data resp))))
    (session/destroy! s))
  (client/stop! c))

How It Works

All SDKs share the same architecture — JSON-RPC 2.0 over stdio to the Copilot CLI.

Your Application Any of 20 languages
SDK Client · JSON-RPC 2.0 Content-Length framing
Copilot CLI · Agent Runtime --headless --stdio
LLM Provider GitHub / OpenAI / Azure / BYOK