Skip to content
Français

Configure Copilot CLI

Run GitHub Copilot CLI using your Copilot account or a GitHub token.

The agent image includes copilot from the @github/copilot package, at the version pinned by agentVersions.copilot. Configure account access in your TypeScript harness, as shown below.

Your GitHub account needs Copilot access; see GitHub’s CLI quickstart.

Copilot always runs on your Copilot plan. Pass a fine-grained GitHub token with the Copilot Requests permission:

import { createAgent, createCopilotHarness } from "@elie-laloum/outpost";

export const coder = createAgent({
  harness: createCopilotHarness({
    authentication: { account: { variable: "COPILOT_GITHUB_TOKEN" } },
    variables: { COPILOT_GITHUB_TOKEN: process.env.COPILOT_GITHUB_TOKEN ?? "" },
  }),
});

To reuse a host login instead, run copilot login and set authentication: "account". Outpost reads the token of the last logged-in user from ~/.copilot/config.json (or $COPILOT_HOME/config.json) and passes it to the sandbox as COPILOT_GITHUB_TOKEN.

Other credential forms and where credentials go: Authentication.

Copilot has no API-key mode: authentication: "usage" is rejected when the agent is composed. Requests count against your Copilot plan.

  • No automated fork: Forking a Copilot conversation is rejected; resume it instead.
  • For supported model settings, see CopilotSettings.
  • Classic tokens: ghp_ personal access tokens are rejected.
  • Incomplete usage: A missing or unreadable session file sets usage.complete to false, with a warning.
  • Late counts: Token totals can arrive after the model has spent them. Pair a budget with a timeout.
  • Premium requests: Copilot bills premium requests; usage reports tokens, not premium requests.
  • MCP options: startupTimeoutMs and oauth are rejected; authenticate HTTP servers with bearerTokenVariable.

API: createCopilotHarness · CopilotSettings · createCopilotConversations.