Skip to content

Options Reference

Native API methods accept JSON-encoded option objects. Wrapper methods accept PHP arrays and encode them before calling the native extension.

Most option names use camelCase. Many extension-specific keys also accept snake_case aliases.

GroupUsed by
Client optionsnew Copilot\Client($optionsJson), CopilotConfig::$clientOptions
Transport optionsclientOptions['transport']
Telemetry optionsclientOptions['telemetry']
Session optionscreateSession(), resumeSession(), CopilotConfig::$sessionConfig, Copilot::ask()
Message optionssend(), sendAndWaitJson(), Copilot::ask()
Set-model optionsCopilot\Session::setModel()

Client options control Copilot CLI process startup, authentication, transport, and telemetry.

OptionTypeAliasDescription
programPathstringprogram_pathExplicit Copilot CLI path.
cwdstringnoneWorking directory for the CLI server.
envarray<string,string>noneExtra child-process environment map.
envRemovestring[]env_removeEnvironment variable names to remove.
prefixArgsstring[]prefix_argsArguments inserted before CLI server flags.
extraArgsstring[]extra_argsExtra CLI arguments after transport flags.
githubTokenstringgithub_tokenToken passed through the SDK auth-token flow.
useLoggedInUserbooluse_logged_in_userAllows existing logged-in CLI credentials.
logLevelstringlog_levelnone, error, warning, warn, info, debug, all, or trace.
sessionIdleTimeoutSecondsintsession_idle_timeout_secondsCLI server idle timeout in seconds.
copilotHomestringcopilot_homeIsolated Copilot state directory.
tcpConnectionTokenstringtcp_connection_tokenToken for TCP/external transport.
remoteboolnoneEnables remote session support.
transportarraynoneTransport config. See Transport Options.
telemetryarraynoneTelemetry config. See Telemetry Options.
$client = new Copilot\Client(json_encode([
'cwd' => getcwd(),
'githubToken' => getenv('GITHUB_COPILOT_TOKEN'),
'useLoggedInUser' => false,
'copilotHome' => __DIR__ . '/../var/copilot',
'logLevel' => 'info',
], JSON_THROW_ON_ERROR));

transport.type controls how the extension talks to the Copilot CLI server.

TypeOptionsExample
stdionone['transport' => ['type' => 'stdio']]
tcpport, defaults to 0['transport' => ['type' => 'tcp', 'port' => 4141]]
externalhost, port; host defaults to 127.0.0.1, port defaults to 0['transport' => ['type' => 'external', 'host' => '127.0.0.1', 'port' => 4141]]

Telemetry options configure SDK telemetry export. Avoid captureContent unless your application is allowed to persist prompt and response content.

OptionTypeAliasDescription
otlpEndpointstringotlp_endpointOTLP HTTP endpoint.
filePathstringfile_pathTelemetry output file.
sourceNamestringsource_nameTelemetry source name.
captureContentboolcapture_contentInclude prompt/response content in telemetry.
exporterTypestringexporter_typeotlp-http, otlpHttp, or file.
$client = new Copilot\Client(json_encode([
'telemetry' => [
'exporterType' => 'file',
'filePath' => __DIR__ . '/../var/copilot-telemetry.jsonl',
'sourceName' => 'my-php-app',
'captureContent' => false,
],
], JSON_THROW_ON_ERROR));

Session options configure a Copilot conversation session. The wrapper merges CopilotConfig::$sessionConfig with per-call session config.

OptionTypeDescription
sessionIdstringResume target. Injected by resumeSession().
modelstringModel name.
clientNamestringApp/client display name.
reasoningEffortstringRequested reasoning effort.
streamingboolEnables streaming events.
systemMessagestringSession system instructions.
availableToolsarrayTool allow-list passed to the SDK.
excludedToolsarrayTool deny-list passed to the SDK.
mcpServersarrayMCP server configuration passed to the SDK.
enableConfigDiscoveryboolAllows SDK config discovery.
requestUserInputmixedSDK user-input callback/config field.
requestPermissionmixedSDK permission callback/config field.
requestElicitationmixedSDK elicitation callback/config field.
requestExitPlanModemixedSDK exit-plan callback/config field.
requestAutoModeSwitchmixedSDK auto-mode callback/config field.
skillDirectoriesstring[]Skill directories.
instructionDirectoriesstring[]Instruction directories.
disabledSkillsstring[]Skills to disable.
customAgentsarrayCustom agent definitions.
defaultAgentstringDefault agent name.
agentstringAgent for the session.
infiniteSessionsboolEnables infinite sessions when supported by SDK.
providerstringProvider override.
enableSessionTelemetryboolEnables session telemetry.
configDirstringConfig directory.
workingDirectorystringSession working directory.
gitHubTokenstringSession-level GitHub token field accepted by the SDK.
includeSubAgentStreamingEventsboolIncludes sub-agent streaming events.
permissionPolicystringExtension helper: deny_all, denyAll, approve_all, or approveAll. Defaults to deny_all.
$session = $client->createSession(json_encode([
'model' => 'gpt-5',
'clientName' => 'my-php-app',
'streaming' => true,
'permissionPolicy' => 'deny_all',
], JSON_THROW_ON_ERROR));

Message options configure prompt delivery and wait behavior.

OptionTypeAliasDescription
modestringnoneDelivery mode, commonly enqueue or immediate.
timeoutSecondsinttimeout_secondsWait timeout in seconds for sendAndWaitJson() or ask().
timeoutMsinttimeout_msWait timeout in milliseconds.
attachmentsarraynoneSDK attachment JSON array.
requestHeadersarray<string,string>request_headersRequest header map.
traceparentstringnoneW3C traceparent value.
tracestatestringnoneW3C tracestate value.
$event = json_decode($session->sendAndWaitJson('Summarize this class.', json_encode([
'mode' => 'immediate',
'timeoutSeconds' => 90,
'requestHeaders' => ['x-request-id' => bin2hex(random_bytes(8))],
], JSON_THROW_ON_ERROR)), true, 512, JSON_THROW_ON_ERROR);

Set-model options configure a session model change.

OptionTypeAliasDescription
reasoningEffortstringreasoning_effortRequested reasoning effort for the new model.
$session->setModel('gpt-5', json_encode([
'reasoningEffort' => 'high',
], JSON_THROW_ON_ERROR));