API Reference Copilot SDK v#2.5.1

Copy Markdown

Modules

Elixir SDK for the GitHub Copilot CLI.

Main client for interacting with the Copilot CLI.

Helper for defining tools to expose to the Copilot CLI.

GenServer-based JSON-RPC 2.0 client using Port for stdio communication.

SDK protocol version constant.

Represents a single conversation session with the Copilot CLI.

Type definitions for the Copilot SDK.

Context for a slash-command invocation.

Definition of a slash command registered with the session.

Options for creating a CopilotClient.

Configuration for a custom agent.

Context for an elicitation request from the server.

Result returned from an elicitation handler.

Response from auth.getStatus.

Response from status.get.

GitHub-anchored attachment variants.

Configuration for infinite sessions with automatic context compaction.

Configuration for a local/stdio MCP server.

Configuration for a remote MCP server (HTTP or SSE).

Opt-in persistent session memory.

Options for sending a message to a session.

Model billing information.

Model capabilities and limits.

Information about an available model.

Model policy state.

Model support flags.

Vision-specific limits.

Permission request from the server.

Result of a permission decision.

Response from ping.

Configuration for a custom API provider (BYOK).

Arguments passed to a BYOK bearer-token provider (per-session scoping).

Configuration for resuming an existing session.

Override operation for a single system prompt section.

Configuration for creating a session.

Configuration for a custom session filesystem provider.

File metadata returned by session filesystem operations.

Behaviour for session filesystem providers.

Configuration for session hooks.

Session lifecycle event notification.

Per-session AI-credit budget; set max_ai_credits to cap spend.

Metadata about a session.

Append mode: SDK foundation plus optional appended content.

Customize mode: override individual sections of the system prompt.

Replace mode: caller provides entire system message.

System-message section identifiers. The preamble/0 section targets only the identity preamble; preserve/0 protects an addressable section from removal.

Definition of a tool exposed to the Copilot CLI.

Binary result from a tool invocation.

Tool "defer" loading policy: auto/0 (lazy via search) or never/0 (eager pre-load).

Context passed to a tool handler when invoked.

Structured result of a tool invocation.

Request for user input from the agent (enables ask_user tool).

Response to a user input request.