github-copilot-sdk
Python SDK for GitHub Copilot CLI
What it is and what it does
This is a Python SDK that wraps GitHub Copilot CLI and exposes it as a programmatic JSON-RPC client. It lets you build applications that send messages to Copilot, receive streamed responses, and manage sessions—all via async Python code. The SDK handles three transport modes: stdio (spawning a local CLI process), TCP (connecting to a local server), and in-process FFI (loading the runtime's native library directly). It depends on httpx for HTTP, pydantic for data validation, and python-dateutil for timestamp handling.
The SDK is actively maintained and requires Python 3.11 or later. It ships as a pure wheel and automatically downloads a pinned Copilot runtime binary on first use (cached locally), though you can override this with environment variables or provide your own binary. Sessions are managed via async context managers for automatic cleanup, and the API supports real-time event streaming, session history retrieval, and custom permission handlers. Type hints are provided throughout.
Use it for:
- Build a chat application that streams Copilot responses in real-time to end users.
- Integrate Copilot into an IDE or editor plugin for programmatic code completion and suggestions.
- Automate code review or documentation generation by sending code snippets to Copilot and capturing responses.
- Create a multi-turn conversation system that maintains session state and event history across requests.
- Deploy Copilot as a backend service by connecting multiple clients to a shared TCP-based runtime server.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for programmatic control of GitHub Copilot CLI via JSON-RPC, supporting stdio, TCP, and in-process FFI transports with async/await and real-time streaming events.
Yes. The SDK is actively maintained, has no known vulnerabilities, supports current Python versions (3.11–3.14), and offers low install friction. It is suitable for production use if you need programmatic access to Copilot. The in-process FFI transport is marked experimental; use stdio or TCP for stability if that matters to your use case.
Install
github-copilot-sdk on PyPI
pip
pip install github-copilot-sdkuv
uv add github-copilot-sdkpoetry
poetry add github-copilot-sdkInstalling github-copilot-sdk
Before you install
Low install friction with a pure-wheel distribution. Active maintenance as of 2026-08-14 with no known vulnerabilities. Requires Python 3.11+ and downloads a pinned runtime binary on first use (or via explicit `download-runtime` command), which may require network access and disk space.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install github-copilot-sdk
import asyncio
from copilot import CopilotClient
from copilot.session import PermissionHandler
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-5"
) as session:
await session.send("What is 2+2?")
asyncio.run(main())
Python 3.11+ required. SDK downloads a pinned Copilot CLI runtime binary on first use (cached locally); set COPILOT_SKIP_CLI_DOWNLOAD=1 to disable auto-download if providing your own binary via COPILOT_CLI_PATH.
Verify before relying
- Whether the runtime download is required for all use cases or only specific transports (e.g., in-process FFI).
- Performance characteristics and latency of different transport modes (stdio vs. TCP vs. FFI).
- Whether the in-process FFI transport is production-ready despite being marked experimental.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — python-dateutil, pydantic, httpx |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,132,167/month — #2,161 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: github_copilot_sdk-1.0.11-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
agent-framework-github-copilotIntegrates GitHub Copilot's agentic…
permissive · top 15,000 on PyPI
pykodiPyKodi provides an async Python interface to…
permissive · top 15,000 on PyPI
microsoft-agents-copilotstudio-clientConnects Python applications to AI agents…
permissive · top 15,000 on PyPI
agent-framework-copilotstudioIntegrates Microsoft Copilot Studio published…
permissive · top 15,000 on PyPI
ajsonrpcImplements the JSON-RPC 2.0 protocol with an…
permissive · top 5,000 on PyPI
copilotkitCopilotKit is a Python SDK for building AI…
permissive · top 15,000 on PyPI
jsonrpcclientGenerates JSON-RPC request objects and parses…
unclear · top 15,000 on PyPI
google-cloud-service-controlPython client library for Google Cloud Service…
permissive · top 15,000 on PyPI
json-rpcImplements JSON-RPC 2.0 and 1.0 protocol…
permissive · top 5,000 on PyPI
agent-client-protocolProvides Python models, async transports, and…
unclear · top 1,000 on PyPI