agentsclimarketplace

Copilot sdk

Skill hevangel/media-agent-skills/skills/copilot-sdk

Use GitHub Copilot SDK to programmatically call Copilot from Python. Use when integrating AI capabilities via Copilot CLI into applications.From its SKILL.md

Install
npx -y skills add hevangel/media-agent-skills --skill copilot-sdk

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.0 KB, as published. Nobody here has run it

GitHub Copilot SDK for Python

The GitHub Copilot SDK is a multi-platform SDK for integrating GitHub Copilot Agent into apps and services. It exposes the same engine behind Copilot CLI, providing a production-tested agent runtime you can invoke programmatically.

Note: This SDK is in technical preview and may change in breaking ways.

Reference

Prerequisites

  1. GitHub Copilot Subscription: Required
  2. Copilot CLI: Must be installed (gh extension install github/gh-copilot)
  3. Authentication: Must be logged into GitHub CLI (gh auth login)

Installation

uv pip install github-copilot-sdk

Architecture

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

API Reference

CopilotClient Options

OptionTypeDefaultDescription
cli_pathstr"copilot"Path to CLI executable
cli_urlstrNoneURL of existing CLI server
cwdstrNoneWorking directory for CLI process
portint0Server port (0 = random)
use_stdioboolTrueUse stdio transport
auto_startboolTrueAuto-start server
auto_restartboolTrueAuto-restart on crash

CopilotClient Methods

MethodDescription
await client.start()Start the CLI server
await client.stop()Stop the CLI server
await client.create_session(config)Create a conversation session
await client.resume_session(session_id)Resume existing session
await client.get_models()Get available models

SessionConfig

OptionTypeDescription
modelstrModel to use ("gpt-5", "claude-sonnet-4.5", etc.)
toolslist[Tool]Custom tools exposed to the CLI
streamingboolEnable streaming responses
mcp_serversdictMCP server configurations

Event Types

Event TypeDescription
assistant.messageFinal assistant message
assistant.message_deltaStreaming message chunk
session.idleSession finished processing
tool.callTool invocation
errorError event

Available Free Models

  • gpt-5-mini

Basic Usage

import asyncio
from copilot import CopilotClient

async def main():
    client = CopilotClient()
    await client.start()
    session = await client.create_session({"model": "gpt-4.1"})
    response = await session.send_and_wait({"prompt": "What is Python?"})
    print(response.data.content)
    await session.destroy()
    await client.stop()

asyncio.run(main())

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.