← ClaudeAtlas

copilot-sdklisted

Use this skill whenever the user wants to build Python applications or scripts using the GitHub Copilot SDK. Triggers include: building Copilot-powered agents or tools in Python, integrating GitHub Copilot CLI programmatically, using the copilot Python package, creating sessions with CopilotClient, defining custom tools for Copilot, handling streaming from Copilot, setting up custom LLM providers (BYOK/Ollama/Azure), permission handling for tool calls, or any workflow involving the `copilot` Python package (copilot-sdk). Use this skill even if the user only says "Copilot agent", "Copilot session", or "Copilot tool" in a Python context — they almost certainly need this.
Ronnasayd/aipp · ★ 3 · AI & Automation · score 62
Install: claude install-skill Ronnasayd/aipp
# GitHub Copilot Python SDK Python SDK for programmatic control of GitHub Copilot CLI via JSON-RPC. > **Requirements:** Python 3.11+, GitHub Copilot CLI installed and accessible. ## Installation ```bash pip install -e ".[telemetry,dev]" # or uv pip install -e ".[telemetry,dev]" ``` --- ## Core Pattern: CopilotClient + Session Always prefer async context managers — they handle startup and cleanup automatically. ```python 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: done = asyncio.Event() def on_event(event): if event.type.value == "assistant.message": print(event.data.content) elif event.type.value == "session.idle": done.set() session.on(on_event) await session.send("Hello!") await done.wait() asyncio.run(main()) ``` **Key rule:** `on_permission_request` is **required** in `create_session()` and `resume_session()`. Use `PermissionHandler.approve_all` for dev/trusted environments; write a custom handler for production. --- ## create_session() Parameters | Parameter | Type | Notes