Copilot SDK
intellectronica/agent-skills
This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java.
Build agentic applications with GitHub Copilot SDK. An agent skill from github/awesome-copilot.
$ npx skills add github/awesome-copilot --skill copilot-sdk -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install github/awesome-copilot copilot-sdk --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/copilot-sdk .claude/skills/copilot-sdk && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .claude/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdkType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add github/awesome-copilot --skill copilot-sdk -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install github/awesome-copilot copilot-sdk --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/copilot-sdk .agents/skills/copilot-sdk && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .agents/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add github/awesome-copilot --skill copilot-sdk -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install github/awesome-copilot copilot-sdk --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/copilot-sdk .cursor/skills/copilot-sdk && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .cursor/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/github/awesome-copilot.git --path skills/copilot-sdk--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add github/awesome-copilot --skill copilot-sdk -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install github/awesome-copilot copilot-sdk --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/copilot-sdk .gemini/skills/copilot-sdk && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .gemini/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install github/awesome-copilot copilot-sdkInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add github/awesome-copilot --skill copilot-sdk -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/copilot-sdk .github/skills/copilot-sdk && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .github/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add github/awesome-copilot --skill copilot-sdk -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install github/awesome-copilot copilot-sdk --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/copilot-sdk .opencode/skills/copilot-sdk && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "copilot-sdk" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/copilot-sdk into .opencode/skills/copilot-sdk/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "copilot-sdk", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
copilot-sdkBuild agentic applications with GitHub Copilot SDK. An agent skill from github/awesome-copilot.
Copilot SDK is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.
Its SKILL.md is about 6.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering LLM API integration, MCP servers and Embeddings. It works with Model Context Protocol, GitHub, Python and .NET. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 727ff2e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dotnetnpmgopippythonnpxFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
api.githubcopilot.comAlso links to:
github.comdocs.github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Copilot SDK loads about 6.3k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 699 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from github/awesome-copilot at commit 727ff2e, republished under its MIT licence (© github). 699 words, ~6,264 tokens.
.claude/skills/copilot-sdk/SKILL.md (or your agent's skills folder).Embed Copilot's agentic workflows in any application using Python, TypeScript, Go, or .NET.
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.
The TypeScript, Python, and .NET packages use a bundled Copilot runtime by default, so they do not need a separate CLI installation.
mkdir copilot-demo && cd copilot-demo
npm init -y --init-type module
npm install @github/copilot-sdk tsxpip install github-copilot-sdk
# Optional: pre-download the bundled runtime instead of downloading it on first use
python -m copilot download-runtimePublished Python wheels include a pinned runtime version. The pre-download command caches that runtime locally; if skipped, the SDK attempts to download it automatically on first use.
mkdir copilot-demo && cd copilot-demo
go mod init copilot-demo
go get github.com/github/copilot-sdk/godotnet new console -n CopilotDemo && cd CopilotDemo
dotnet add package GitHub.Copilot.SDKimport { CopilotClient, approveAll } from "@github/copilot-sdk";
const client = new CopilotClient();
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
});
const response = await session.sendAndWait({ prompt: "What is 2 + 2?" });
console.log(response?.data.content);
await client.stop();
process.exit(0);Run: npx tsx index.ts
import asyncio
from copilot import CopilotClient, PermissionHandler
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
) as session:
response = await session.send_and_wait("What is 2 + 2?")
print(response.data.content)
asyncio.run(main())package main
import (
"fmt"
"log"
"os"
copilot "github.com/github/copilot-sdk/go"
)
func main() {
client := copilot.NewClient(nil)
if err := client.Start(); err != nil {
log.Fatal(err)
}
defer client.Stop()
session, err := client.CreateSession(&copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-4.1",
})
if err != nil {
log.Fatal(err)
}
response, err := session.SendAndWait(copilot.MessageOptions{Prompt: "What is 2 + 2?"}, 0)
if err != nil {
log.Fatal(err)
}
fmt.Println(*response.Data.Content)
os.Exit(0)
}using GitHub.Copilot.SDK;
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
OnPermissionRequest = PermissionHandler.ApproveAll,
Model = "gpt-4.1",
});
var response = await session.SendAndWaitAsync(new MessageOptions { Prompt = "What is 2 + 2?" });
Console.WriteLine(response?.Data.Content);Run: dotnet run
Enable real-time output for better UX:
import { CopilotClient, approveAll, SessionEvent } from "@github/copilot-sdk";
const client = new CopilotClient();
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
streaming: true,
});
session.on((event: SessionEvent) => {
if (event.type === "assistant.message_delta") {
process.stdout.write(event.data.deltaContent);
}
if (event.type === "session.idle") {
console.log(); // New line when done
}
});
await session.sendAndWait({ prompt: "Tell me a short joke" });
await client.stop();
process.exit(0);import asyncio
import sys
from copilot import CopilotClient, PermissionHandler
from copilot.generated.session_events import SessionEventType
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
streaming=True,
) as session:
def handle_event(event):
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
sys.stdout.write(event.data.delta_content)
sys.stdout.flush()
if event.type == SessionEventType.SESSION_IDLE:
print()
session.on(handle_event)
await session.send_and_wait("Tell me a short joke")
asyncio.run(main())session, err := client.CreateSession(&copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-4.1",
Streaming: true,
})
session.On(func(event copilot.SessionEvent) {
if event.Type == "assistant.message_delta" {
fmt.Print(*event.Data.DeltaContent)
}
if event.Type == "session.idle" {
fmt.Println()
}
})
_, err = session.SendAndWait(copilot.MessageOptions{Prompt: "Tell me a short joke"}, 0)await using var session = await client.CreateSessionAsync(new SessionConfig
{
OnPermissionRequest = PermissionHandler.ApproveAll,
Model = "gpt-4.1",
Streaming = true,
});
session.On(ev =>
{
if (ev is AssistantMessageDeltaEvent deltaEvent)
Console.Write(deltaEvent.Data.DeltaContent);
if (ev is SessionIdleEvent)
Console.WriteLine();
});
await session.SendAndWaitAsync(new MessageOptions { Prompt = "Tell me a short joke" });Define tools that Copilot can invoke during reasoning. When you define a tool, you tell Copilot:
import { CopilotClient, approveAll, defineTool, SessionEvent } from "@github/copilot-sdk";
const getWeather = defineTool("get_weather", {
description: "Get the current weather for a city",
parameters: {
type: "object",
properties: {
city: { type: "string", description: "The city name" },
},
required: ["city"],
},
handler: async (args: { city: string }) => {
const { city } = args;
// In a real app, call a weather API here
const conditions = ["sunny", "cloudy", "rainy", "partly cloudy"];
const temp = Math.floor(Math.random() * 30) + 50;
const condition = conditions[Math.floor(Math.random() * conditions.length)];
return { city, temperature: `${temp}°F`, condition };
},
});
const client = new CopilotClient();
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
streaming: true,
tools: [getWeather],
});
session.on((event: SessionEvent) => {
if (event.type === "assistant.message_delta") {
process.stdout.write(event.data.deltaContent);
}
});
await session.sendAndWait({
prompt: "What's the weather like in Seattle and Tokyo?",
});
await client.stop();
process.exit(0);import asyncio
import random
import sys
from copilot import CopilotClient, PermissionHandler
from copilot.tools import define_tool
from copilot.generated.session_events import SessionEventType
from pydantic import BaseModel, Field
class GetWeatherParams(BaseModel):
city: str = Field(description="The name of the city to get weather for")
@define_tool(description="Get the current weather for a city")
async def get_weather(params: GetWeatherParams) -> dict:
city = params.city
conditions = ["sunny", "cloudy", "rainy", "partly cloudy"]
temp = random.randint(50, 80)
condition = random.choice(conditions)
return {"city": city, "temperature": f"{temp}°F", "condition": condition}
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
streaming=True,
tools=[get_weather],
) as session:
def handle_event(event):
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
sys.stdout.write(event.data.delta_content)
sys.stdout.flush()
session.on(handle_event)
await session.send_and_wait(
"What's the weather like in Seattle and Tokyo?"
)
asyncio.run(main())type WeatherParams struct {
City string `json:"city" jsonschema:"The city name"`
}
type WeatherResult struct {
City string `json:"city"`
Temperature string `json:"temperature"`
Condition string `json:"condition"`
}
getWeather := copilot.DefineTool(
"get_weather",
"Get the current weather for a city",
func(params WeatherParams, inv copilot.ToolInvocation) (WeatherResult, error) {
conditions := []string{"sunny", "cloudy", "rainy", "partly cloudy"}
temp := rand.Intn(30) + 50
condition := conditions[rand.Intn(len(conditions))]
return WeatherResult{
City: params.City,
Temperature: fmt.Sprintf("%d°F", temp),
Condition: condition,
}, nil
},
)
session, _ := client.CreateSession(&copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-4.1",
Streaming: true,
Tools: []copilot.Tool{getWeather},
})using GitHub.Copilot.SDK;
using Microsoft.Extensions.AI;
using System.ComponentModel;
var getWeather = AIFunctionFactory.Create(
([Description("The city name")] string city) =>
{
var conditions = new[] { "sunny", "cloudy", "rainy", "partly cloudy" };
var temp = Random.Shared.Next(50, 80);
var condition = conditions[Random.Shared.Next(conditions.Length)];
return new { city, temperature = $"{temp}°F", condition };
},
"get_weather",
"Get the current weather for a city"
);
await using var session = await client.CreateSessionAsync(new SessionConfig
{
OnPermissionRequest = PermissionHandler.ApproveAll,
Model = "gpt-4.1",
Streaming = true,
Tools = [getWeather],
});When Copilot decides to call your tool:
Copilot decides when to call your tool based on the user's question and your tool's description.
Build a complete interactive assistant:
import { CopilotClient, approveAll, defineTool, SessionEvent } from "@github/copilot-sdk";
import * as readline from "readline";
const getWeather = defineTool("get_weather", {
description: "Get the current weather for a city",
parameters: {
type: "object",
properties: {
city: { type: "string", description: "The city name" },
},
required: ["city"],
},
handler: async ({ city }) => {
const conditions = ["sunny", "cloudy", "rainy", "partly cloudy"];
const temp = Math.floor(Math.random() * 30) + 50;
const condition = conditions[Math.floor(Math.random() * conditions.length)];
return { city, temperature: `${temp}°F`, condition };
},
});
const client = new CopilotClient();
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
streaming: true,
tools: [getWeather],
});
session.on((event: SessionEvent) => {
if (event.type === "assistant.message_delta") {
process.stdout.write(event.data.deltaContent);
}
});
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
console.log("Weather Assistant (type 'exit' to quit)");
console.log("Try: 'What's the weather in Paris?'\n");
const prompt = () => {
rl.question("You: ", async (input) => {
if (input.toLowerCase() === "exit") {
await client.stop();
rl.close();
return;
}
process.stdout.write("Assistant: ");
await session.sendAndWait({ prompt: input });
console.log("\n");
prompt();
});
};
prompt();import asyncio
import random
import sys
from copilot import CopilotClient, PermissionHandler
from copilot.tools import define_tool
from copilot.generated.session_events import SessionEventType
from pydantic import BaseModel, Field
class GetWeatherParams(BaseModel):
city: str = Field(description="The name of the city to get weather for")
@define_tool(description="Get the current weather for a city")
async def get_weather(params: GetWeatherParams) -> dict:
conditions = ["sunny", "cloudy", "rainy", "partly cloudy"]
temp = random.randint(50, 80)
condition = random.choice(conditions)
return {"city": params.city, "temperature": f"{temp}°F", "condition": condition}
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
streaming=True,
tools=[get_weather],
) as session:
def handle_event(event):
if event.type == SessionEventType.ASSISTANT_MESSAGE_DELTA:
sys.stdout.write(event.data.delta_content)
sys.stdout.flush()
session.on(handle_event)
print("Weather Assistant (type 'exit' to quit)")
print("Try: 'What's the weather in Paris?'\n")
while True:
try:
user_input = input("You: ")
except EOFError:
break
if user_input.lower() == "exit":
break
sys.stdout.write("Assistant: ")
await session.send_and_wait(user_input)
print("\n")
asyncio.run(main())Connect to MCP (Model Context Protocol) servers for pre-built tools. Connect to GitHub's MCP server for repository, issue, and PR access:
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
mcpServers: {
github: {
type: "http",
url: "https://api.githubcopilot.com/mcp/",
},
},
});async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
mcp_servers={
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
},
},
) as session:
...session, _ := client.CreateSession(&copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-4.1",
MCPServers: map[string]copilot.MCPServerConfig{
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
},
},
})await using var session = await client.CreateSessionAsync(new SessionConfig
{
OnPermissionRequest = PermissionHandler.ApproveAll,
Model = "gpt-4.1",
McpServers = new Dictionary<string, McpServerConfig>
{
["github"] = new McpServerConfig
{
Type = "http",
Url = "https://api.githubcopilot.com/mcp/",
},
},
});Define specialized AI personas for specific tasks:
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
customAgents: [{
name: "pr-reviewer",
displayName: "PR Reviewer",
description: "Reviews pull requests for best practices",
prompt: "You are an expert code reviewer. Focus on security, performance, and maintainability.",
}],
});async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
custom_agents=[{
"name": "pr-reviewer",
"display_name": "PR Reviewer",
"description": "Reviews pull requests for best practices",
"prompt": "You are an expert code reviewer. Focus on security, performance, and maintainability.",
}],
) as session:
...Customize the AI's behavior and personality:
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
systemMessage: {
content: "You are a helpful assistant for our engineering team. Always be concise.",
},
});async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
system_message={
"content": "You are a helpful assistant for our engineering team. Always be concise.",
},
) as session:
...Run the CLI in server mode separately and connect the SDK to it. Useful for debugging, resource sharing, or custom environments.
copilot --server --port 4321const client = new CopilotClient({
cliUrl: "localhost:4321"
});
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
});from copilot import CopilotClient, PermissionHandler, RuntimeConnection
async with CopilotClient(
connection=RuntimeConnection.for_uri("localhost:4321")
) as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
) as session:
...client := copilot.NewClient(&copilot.ClientOptions{
CLIUrl: "localhost:4321",
})
if err := client.Start(); err != nil {
log.Fatal(err)
}
session, _ := client.CreateSession(&copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-4.1",
})using var client = new CopilotClient(new CopilotClientOptions
{
CliUrl = "localhost:4321"
});
await using var session = await client.CreateSessionAsync(new SessionConfig
{
OnPermissionRequest = PermissionHandler.ApproveAll,
Model = "gpt-4.1",
});Note: When configured to use an external server, the SDK manages only its connection and does not manage the external process.
| Event | Description |
|---|---|
user.message | User input added |
assistant.message | Complete model response |
assistant.message_delta | Streaming response chunk |
assistant.reasoning | Model reasoning (model-dependent) |
assistant.reasoning_delta | Streaming reasoning chunk |
tool.execution_start | Tool invocation started |
tool.execution_complete | Tool execution finished |
session.idle | No active processing |
session.error | Error occurred |
| Option | Description | Default |
|---|---|---|
cliPath | Path to Copilot CLI executable | System PATH |
cliUrl | Connect to existing server (e.g., "localhost:4321") | None |
port | Server communication port | Random |
useStdio | Use stdio transport instead of TCP | true |
logLevel | Logging verbosity | "info" |
autoStart | Launch server automatically | true |
autoRestart | Restart on crashes | true |
cwd | Working directory for CLI process | Inherited |
| Option | Description |
|---|---|
model | LLM to use ("gpt-4.1", "claude-sonnet-4.5", etc.) |
sessionId | Custom session identifier |
tools | Custom tool definitions |
mcpServers | MCP server connections |
customAgents | Custom agent personas |
systemMessage | Override default system prompt |
streaming | Enable incremental response chunks |
availableTools | Whitelist of permitted tools |
excludedTools | Blacklist of disabled tools |
Save and resume conversations across restarts:
const session = await client.createSession({
onPermissionRequest: approveAll,
sessionId: "user-123-conversation",
model: "gpt-4.1"
});const session = await client.resumeSession("user-123-conversation", { onPermissionRequest: approveAll });
await session.send({ prompt: "What did we discuss earlier?" });const sessions = await client.listSessions();
await client.deleteSession("old-session-id");try {
const client = new CopilotClient();
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
});
const response = await session.sendAndWait(
{ prompt: "Hello!" },
30000 // timeout in ms
);
} catch (error) {
if (error.code === "ENOENT") {
console.error("Copilot CLI not installed");
} else if (error.code === "ECONNREFUSED") {
console.error("Cannot connect to Copilot server");
} else {
console.error("Error:", error.message);
}
} finally {
await client.stop();
}process.on("SIGINT", async () => {
console.log("Shutting down...");
await client.stop();
process.exit(0);
});const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
});
await session.sendAndWait({ prompt: "My name is Alice" });
await session.sendAndWait({ prompt: "What's my name?" });
// Response: "Your name is Alice"await session.send({
prompt: "Analyze this file",
attachments: [{
type: "file",
path: "./data.csv",
displayName: "Sales Data"
}]
});const timeoutId = setTimeout(() => {
session.abort();
}, 60000);
session.on((event) => {
if (event.type === "session.idle") {
clearTimeout(timeoutId);
}
});Query available models at runtime:
const models = await client.getModels();
// Returns: ["gpt-4.1", "gpt-4o", "claude-sonnet-4.5", ...]sendAndWait with timeout for long operationsYour Application
|
SDK Client
| JSON-RPC
Copilot CLI (server mode)
|
GitHub (models, auth)The SDK manages the CLI process lifecycle automatically. All communication happens via JSON-RPC over stdio or TCP.
This SDK is in Technical Preview and may have breaking changes. Not recommended for production use yet.
© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/copilot-sdk of github/awesome-copilot.
Open the folder on GitHubat commit 727ff2e
We found 14 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in github/awesome-copilot, which our catalogue first saw on October 7, 2026.
Copilot SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Copilot SDK this skillgithub/awesome-copilot | 40k | 5 repos | ~6.3k | Automated safety check: Pass | MIT | |
| Copilot SDKintellectronica/agent-skills | 295 | — | ~3.2k | Automated safety check: Pass | CC0-1.0 | |
| Copilot SDKmicrosoft/skills | 3.1k | — | ~7.1k | Automated safety check: Pass | MIT | |
| Strandsstrands-agents/harness-sdk | 8.7k | — | ~1k | Automated safety check: Pass | Apache-2.0 | |
| Ydc Openai Agent SDK IntegrationLeoYeAI/openclaw-master-skills | 2.2k | — | ~4.4k | Automated safety check: Notes | MIT | |
| Gemini API DevAyuilos/Miffan | 182 | 1 repos | ~1.4k | Automated safety check: Pass | AGPL-3.0 |
intellectronica/agent-skills
This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java.
microsoft/skills
Build applications powered by GitHub Copilot using the Copilot SDK.
strands-agents/harness-sdk
Build, extend, evaluate, or migrate applications with Strands Agents in Python or TypeScript.
LeoYeAI/openclaw-master-skills
Integrate OpenAI Agents SDK with You.com MCP server - Hosted and Streamable HTTP support for Python and TypeScript.
Ayuilos/Miffan
A skill your agent uses when building applications with Gemini API hosted models, including Gemini and Gemma 4, working with multimodal content (text, images, audio, video), implementing function…
comet-ml/opik-mcp
Reference for the Opik SDK — tracing, span types, framework integrations, threads, and the prompt library (Python, TypeScript, REST).
github/awesome-copilot
Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.
github/awesome-copilot
Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.
github/awesome-copilot
Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.
github/awesome-copilot
Cleans raw credit data and screens variables before loan modeling, dropping unstable, noisy or redundant features and writing an Excel report of every step.
github/awesome-copilot
Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.
github/awesome-copilot
End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI.
Categories
Build agentic applications with GitHub Copilot SDK. An agent skill from github/awesome-copilot. Copilot SDK is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Build agentic applications with GitHub Copilot SDK.
Copilot SDK fits situations like: embedding AI agents in apps; creating custom tools; implementing streaming responses; managing sessions.
Run `npx skills add github/awesome-copilot --skill copilot-sdk -a claude-code`. Or copy the skill folder (skills/copilot-sdk in github/awesome-copilot) into .claude/skills/copilot-sdk in your project. Claude Code loads it when a task matches its description.
Run `npx skills add github/awesome-copilot --skill copilot-sdk -a codex`. Or copy the skill folder (skills/copilot-sdk in github/awesome-copilot) into .agents/skills/copilot-sdk in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill copilot-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/copilot-sdk, .gemini/skills/copilot-sdk, .github/skills/copilot-sdk and .opencode/skills/copilot-sdk in your project.
Going by SKILL.md and its folder, Copilot SDK needs the command-line tools its instructions call (dotnet, npm, go, pip, python and npx). Our summary lists: Python 3; Node.js.
SKILL.md names 3 domains. In commands or code: api.githubcopilot.com; the agent is likely to contact it when it follows the instructions. As links in the text: github.com and docs.github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Copilot SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.3k tokens (SKILL.md is roughly 25k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Copilot SDK: Copilot SDK (intellectronica/agent-skills, 295 stars), Copilot SDK (microsoft/skills, 3.1k stars), Strands (strands-agents/harness-sdk, 8.7k stars) and Ydc Openai Agent SDK Integration (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,748 GitHub stars. The repository holds 417 skills in this directory. The repository was last updated on October 7, 2026.
Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.