> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Copilot

# GitHub Copilot

## What is GitHub Copilot?

GitHub Copilot is GitHub's AI coding assistant. It provides access to Copilot
models for your GitHub account and plan. OpenClaw can use Copilot as a model
provider in two different ways.

## Two ways to use Copilot in OpenClaw

### 1) Built-in GitHub Copilot provider (`github-copilot`)

Use the native device-login flow to obtain a GitHub token, then exchange it for
Copilot API tokens when OpenClaw runs. This is the **default** and simplest path
because it does not require VS Code.

### 2) Copilot Proxy plugin (`copilot-proxy`)

Use the **Copilot Proxy** VS Code extension as a local bridge. OpenClaw talks to
the proxy’s `/v1` endpoint and uses the model list you configure there. Choose
this when you already run Copilot Proxy in VS Code or need to route through it.
You must enable the plugin and keep the VS Code extension running.

Use GitHub Copilot as a model provider (`github-copilot`). The login command runs
the GitHub device flow, saves an auth profile, and updates your config to use that
profile.

## CLI setup

```bash theme={"dark"}
openclaw models auth login-github-copilot
```

You'll be prompted to visit a URL and enter a one-time code. Keep the terminal
open until it completes.

### Optional flags

```bash theme={"dark"}
openclaw models auth login-github-copilot --profile-id github-copilot:work
openclaw models auth login-github-copilot --yes
```

## Set a default model

```bash theme={"dark"}
openclaw models set github-copilot/gpt-4o
```

### Config snippet

```json5 theme={"dark"}
{
  agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } },
}
```

## Token env var fallback chain

When no auth profile is stored, OpenClaw reads a GitHub token from environment variables in this order:

1. `COPILOT_GITHUB_TOKEN` — preferred; set this to keep Copilot auth separate from other GitHub tools.
2. `GH_TOKEN` — used by the GitHub CLI (`gh`); OpenClaw picks it up automatically.
3. `GITHUB_TOKEN` — standard CI/GitHub Actions token; used as a last resort.

The first non-empty variable wins. Example:

```bash theme={"dark"}
export COPILOT_GITHUB_TOKEN="ghp_..."
openclaw models set github-copilot/gpt-4o
```

If none of these are set and no auth profile exists, the Copilot provider is disabled. Run the device-login flow to store a profile permanently.

## Notes

* Requires an interactive TTY for the device-login flow; run it directly in a terminal.
* Copilot model availability depends on your plan; if a model is rejected, try
  another ID (for example `github-copilot/gpt-4.1`).
* The login stores a GitHub token in the auth profile store and exchanges it for a
  Copilot API token when OpenClaw runs.
