Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
The Copilot SDK supports multiple authentication methods. Choose one based on your use case.Authentication methods
| Method | Primary use case | Copilot subscription | Notes |
|---|---|---|---|
| GitHub login (CLI) | Development and manual runs | Required | Uses the login session from the copilot CLI |
| OAuth GitHub App / PAT | Per-user tokens | Required | Set via github_token |
| Environment variables | CI/CD and server runtime | Required | COPILOT_GITHUB_TOKEN, etc. |
| BYOK (Bring Your Own Key) | Your own model provider | Not required | Configure a custom provider |
custom-providers.md.
GitHub login (CLI)
If you are already logged in withcopilot or gh CLI, the SDK uses stored credentials by default.
OAuth GitHub App / PAT
Pass a user access token from OAuth, or a fine-grained PAT, togithub_token.
- Expected token prefixes:
gho_,ghu_,github_pat_ ghp_(classic PAT) is discouraged
github_token, use_logged_in_user is automatically set to false. To override explicitly:
github-token.md.
Both github_token and use_logged_in_user are only available in stdio mode. In TCP mode, the Copilot CLI must already be authenticated.
Environment variables
If you pass a token via environment variables, the CLI auto-detects it using this priority order:COPILOT_GITHUB_TOKENGH_TOKENGITHUB_TOKEN
Authentication priority
The SDK resolves credentials in this order:github_token(explicitly provided)- Environment variable tokens (
COPILOT_GITHUB_TOKEN→GH_TOKEN→GITHUB_TOKEN) - OAuth credentials stored by CLI
- Credentials from
ghCLI
Disable automatic login
If you do not want to use stored credentials, setuse_logged_in_user to false.
github_token, this is supported in stdio mode only. In TCP mode, the Copilot CLI must already be authenticated.
Check authentication status
You can read the result ofauth.getStatus.
For the latest updates, see the GitHub repository.