Copilot CLI reference - Environment variables
Copilot CLI environment variables
Copilot CLI documents 67 environment variables, including COPILOT_ALLOW_ALL, COPILOT_AUTO_UPDATE and COPILOT_CACHE_HOME. Copilot CLI reads these from your shell environment. Each row gives the docs' description, accepted values and an example where one is documented.
Last verified 9 official pagesFull Copilot CLI reference
| Variable | Description | Example |
|---|---|---|
COPILOT_ALLOW_ALL | Allow all permissions automatically (equivalent to --allow-all). Exactly true also trusts the working directory, loading its skills, plugins, MCP servers, and hooks. On: true, 1, yes, on, y; off: false, 0, no, off, n, empty (case-insensitive) Docs: COPILOT_ALLOW_ALL | -no example |
COPILOT_AUTO_UPDATE | Set to false to disable automatic updates of the CLI and first-party plugins. false Docs: COPILOT_AUTO_UPDATE | -no example |
COPILOT_CACHE_HOME | Override the cache directory used for marketplace caches, auto-update packages, and other ephemeral data. Defaults: ~/Library/Caches/copilot (macOS), $XDG_CACHE_HOME/copilot or ~/.cache/copilot (Linux), %LOCALAPPDATA%/copilot (Windows) Docs: COPILOT_CACHE_HOME | -no example |
COPILOT_CHILD_OOM_SCORE_ADJ | Linux only. Overrides the oom_score_adj bias on shell command process trees so the OOM killer reclaims a runaway child before the CLI. Default 300; range -1000 to 1000; off disables Docs: COPILOT_CHILD_OOM_SCORE_ADJ | -no example |
COPILOT_CUSTOM_INSTRUCTIONS_DIRS | Comma-separated list of additional directories for custom instructions. Docs: COPILOT_CUSTOM_INSTRUCTIONS_DIRS | -no example |
COPILOT_EDITOR | Editor command for interactive editing, checked after $VISUAL and $EDITOR. Defaults to vi if none are set Docs: COPILOT_EDITOR | -no example |
COPILOT_ENABLE_HTTP2 | Opt into HTTP/2 transport; HTTP/1.1 is the default. 1 or true Docs: COPILOT_ENABLE_HTTP2 | -no example |
COPILOT_ENABLE_INTERRUPTED_SESSION_RESTORE | Enable restoring a session that was still open when the CLI process went away (temporarily opt-in). 1 Docs: COPILOT_ENABLE_INTERRUPTED_SESSION_RESTORE | -no example |
COPILOT_GH_HOST | GitHub hostname for Copilot CLI only, overriding GH_HOST. Docs: COPILOT_GH_HOST | -no example |
COPILOT_GITHUB_TOKEN | Authentication token; takes precedence over GH_TOKEN and GITHUB_TOKEN. Fine-grained PATs with Copilot Requests permission and Copilot CLI or gh OAuth tokens are supported; classic ghp_ PATs are not. Docs: COPILOT_GITHUB_TOKEN | COPILOT_GITHUB_TOKEN=github_pat_... copilot |
COPILOT_HOME | Override the configuration and state directory; replaces the entire ~/.copilot path. Default: $HOME/.copilot Docs: COPILOT_HOME | export COPILOT_HOME=/path/to/my/copilot-config |
COPILOT_LARGE_OUTPUT_THRESHOLD_BYTES | Maximum UTF-8 byte size for tool output returned directly to the model. Default 20480 (20 KiB) Docs: COPILOT_LARGE_OUTPUT_THRESHOLD_BYTES | -no example |
COPILOT_MCP_TOOL_CACHE | Set to false to disable loading and persisting local MCP server tool snapshots for the entire process. false Docs: COPILOT_MCP_TOOL_CACHE | -no example |
COPILOT_MODEL | Set the AI model; ranks below --model and above the model settings key in precedence. Required when using a BYOK provider. Docs: COPILOT_MODEL | -no example |
COPILOT_PLAN_THEN_AUTOPILOT | Request plan-then-autopilot (equivalent to --plan --mode autopilot); ignored with a warning when --mode, --autopilot, or --plan is passed. 1, true, yes, on Docs: COPILOT_PLAN_THEN_AUTOPILOT | -no example |
COPILOT_PROMPT_FRAME | Enable (1) or disable (0) the decorative frame around the input prompt, overriding the PROMPT_FRAME experimental flag. 1, 0 Docs: COPILOT_PROMPT_FRAME | -no example |
COPILOT_PROVIDER_API_KEY_COMMAND | Shell command that prints a fresh BYOK API key before each provider request; takes precedence over COPILOT_PROVIDER_API_KEY. Docs: COPILOT_PROVIDER_API_KEY_COMMAND | -no example |
COPILOT_PROVIDERS_CONFIG | Path to a JSON file defining a BYOK provider and model registry (providers and models keys); takes precedence over legacy COPILOT_PROVIDER_* variables when it declares anything. Default: <COPILOT_HOME>/providers.json Docs: COPILOT_PROVIDERS_CONFIG | -no example |
COPILOT_SKILLS_DIRS | Comma-separated list of additional directories for skills. Docs: COPILOT_SKILLS_DIRS | -no example |
PLUGINS_DASHBOARD | Set to false to disable the plugins dashboard opened by bare /plugin, /mcp, and /skills, and the non-interactive copilot plugin commands. false Docs: PLUGINS_DASHBOARD | -no example |
COPILOT_STRIP_REASONING_ON_RESUME | Set to 0 or false to keep BYOK reasoning tokens across a session resume instead of stripping them (the default). 0, false Docs: COPILOT_STRIP_REASONING_ON_RESUME | -no example |
COPILOT_SUBAGENT_MAX_CONCURRENT | Maximum concurrent subagents per session. Default 32; range 1 to 256 Docs: COPILOT_SUBAGENT_MAX_CONCURRENT | -no example |
COPILOT_SUBAGENT_MAX_DEPTH | Maximum subagent nesting depth. Default 4; range 1 to 128 Docs: COPILOT_SUBAGENT_MAX_DEPTH | -no example |
COPILOT_TASK_WAIT_TIMEOUT_SECONDS | Maximum seconds -p (and -p --autopilot) waits for pending background agents or shell commands before exiting. Default 600; 0 exits immediately Docs: COPILOT_TASK_WAIT_TIMEOUT_SECONDS | -no example |
GH_HOST | GitHub hostname for both GitHub CLI and Copilot CLI; override with COPILOT_GH_HOST for Copilot CLI only. Default: github.com Docs: GH_HOST | -no example |
GH_TOKEN | Authentication token; takes precedence over GITHUB_TOKEN (second precedence overall). Docs: GH_TOKEN | -no example |
GITHUB_TOKEN | Authentication token (third precedence). Its value is redacted from output by default. Docs: GITHUB_TOKEN | -no example |
GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS | Set to true to load project extensions and allow extension management tools in prompt mode (-p) or direct workflow runs. Does not grant tool permissions. true Docs: GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS | -no example |
GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS | Set to true to load repository hooks in prompt mode (-p). true Docs: GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS | -no example |
GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP | Set to true to load workspace MCP sources in prompt mode (-p). true Docs: GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP | -no example |
PLAIN_DIFF | Set to true to disable rich diff rendering. true Docs: PLAIN_DIFF | -no example |
USE_BUILTIN_RIPGREP | Set to false to use the system ripgrep instead of the bundled version. false Docs: USE_BUILTIN_RIPGREP | -no example |
USE_TGREP | true always uses tgrep (trigram-indexed search), bypassing the file-count threshold; false always uses ripgrep. When unset, tgrep is used automatically only in large Git repositories on non-virtualized filesystems. true, false Docs: USE_TGREP | -no example |
TGREP_FILE_COUNT_THRESHOLD | Minimum file count for automatic tgrep indexed search; 0 removes only the file-count requirement. Non-negative integer; default 10000 on Windows, 50000 elsewhere Docs: TGREP_FILE_COUNT_THRESHOLD | -no example |
COPILOT_WEB_FETCH_ALLOW_LOCALHOST | Allow the web_fetch tool to reach localhost during development, bypassing its loopback block. 1 Docs: COPILOT_WEB_FETCH_ALLOW_LOCALHOST | export COPILOT_WEB_FETCH_ALLOW_LOCALHOST=1 |
COPILOT_HOOK_ALLOW_LOCALHOST | When set to 1, HTTP hooks may use non-TLS http://localhost, http://127.*, and http://[::1] URLs. 1 Docs: COPILOT_HOOK_ALLOW_LOCALHOST | -no example |
COPILOT_PROVIDER_BASE_URL | BYOK: the base URL of your model provider's API endpoint (required). Docs: COPILOT_PROVIDER_BASE_URL | export COPILOT_PROVIDER_BASE_URL=http://localhost:11434 |
COPILOT_PROVIDER_TYPE | BYOK: the provider type. openai works with any OpenAI-compatible endpoint. openai (default), azure, anthropic Docs: COPILOT_PROVIDER_TYPE | export COPILOT_PROVIDER_TYPE=azure |
COPILOT_PROVIDER_API_KEY | BYOK: your API key for the provider; not required for providers without authentication such as a local Ollama instance. Docs: COPILOT_PROVIDER_API_KEY | -no example |
COPILOT_PROVIDER_BEARER_TOKEN | BYOK: bearer token used for provider authentication when API-key authentication is not used. Docs: COPILOT_PROVIDER_BEARER_TOKEN | -no example |
COPILOT_PROVIDER_WIRE_API | BYOK: specifies the API protocol used when communicating with the provider. Docs: COPILOT_PROVIDER_WIRE_API | -no example |
COPILOT_PROVIDER_AZURE_API_VERSION | BYOK (Azure only): the Azure OpenAI API version used for requests. Docs: COPILOT_PROVIDER_AZURE_API_VERSION | -no example |
COPILOT_PROVIDER_MODEL_ID | BYOK: the well-known model name used to identify model capabilities and token limits. Docs: COPILOT_PROVIDER_MODEL_ID | -no example |
COPILOT_PROVIDER_WIRE_MODEL | BYOK: the model name sent to the provider API; for Azure OpenAI, the deployment name. Docs: COPILOT_PROVIDER_WIRE_MODEL | -no example |
COPILOT_PROVIDER_MAX_PROMPT_TOKENS | BYOK: maximum number of prompt tokens allowed in a request. Docs: COPILOT_PROVIDER_MAX_PROMPT_TOKENS | -no example |
COPILOT_PROVIDER_MAX_OUTPUT_TOKENS | BYOK: maximum number of tokens generated in a response. Docs: COPILOT_PROVIDER_MAX_OUTPUT_TOKENS | -no example |
COPILOT_PROVIDER_GHES_HOST | The hostname of your GitHub Enterprise Server instance (required for the GHES provider). Docs: COPILOT_PROVIDER_GHES_HOST | export COPILOT_PROVIDER_GHES_HOST=YOUR-GHES-HOSTNAME |
COPILOT_PROVIDER_GHES_TOKEN | A personal access token for the GitHub Enterprise Server instance; always required for GHES inference. Docs: COPILOT_PROVIDER_GHES_TOKEN | export COPILOT_PROVIDER_GHES_TOKEN="$(gh auth token --hostname YOUR-GHES-HOSTNAME)" |
GH_ENTERPRISE_TOKEN | For GHES automation, set to the personal access token (or use GITHUB_ENTERPRISE_TOKEN) together with GH_HOST; takes precedence over gh auth login credentials for the same host. Docs: GH_ENTERPRISE_TOKEN | export GH_ENTERPRISE_TOKEN="$(gh auth token --hostname YOUR-GHES-HOSTNAME)" |
PREFIX | Install script: custom install directory. Default /usr/local as root, $HOME/.local otherwise Docs: PREFIX | curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash |
VERSION | Install script: install a specific version. Default: latest version Docs: VERSION | curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash |
GITHUB_COPILOT_OIDC_MCP_TOKEN | When an MCP server sets oidc: true, the CLI injects OIDC tokens into this variable (or suffixed GITHUB_COPILOT_OIDC_MCP_TOKEN_<SUFFIX> variants) referenced in a local server's env block. Docs: GITHUB_COPILOT_OIDC_MCP_TOKEN | -no example |
PLUGIN_DATA | Points to a persistent, writable directory for an installed plugin; expandable as ${PLUGIN_DATA} (aliases CLAUDE_PLUGIN_DATA, COPILOT_PLUGIN_DATA) in stdio server args, env, and cwd. Docs: PLUGIN_DATA | -no example |
COPILOT_PLUGIN_DIR_ONLY | Set to true in the runtime environment to suppress automatic plugin discovery so only --plugin-dir directories load. true Docs: COPILOT_PLUGIN_DIR_ONLY | -no example |
COPILOT_OTEL_ENABLED | Explicitly enable OpenTelemetry export; not required if OTEL_EXPORTER_OTLP_ENDPOINT is set. Default false Docs: COPILOT_OTEL_ENABLED | -no example |
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP endpoint URL; setting it automatically enables OTel. Docs: OTEL_EXPORTER_OTLP_ENDPOINT | -no example |
COPILOT_OTEL_EXPORTER_TYPE | OTel exporter type; auto-selects file when COPILOT_OTEL_FILE_EXPORTER_PATH is set. otlp-http (default), file Docs: COPILOT_OTEL_EXPORTER_TYPE | -no example |
OTEL_EXPORTER_OTLP_PROTOCOL | OTLP HTTP wire protocol for the otlp-http exporter. http/json (default), http/protobuf Docs: OTEL_EXPORTER_OTLP_PROTOCOL | -no example |
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | Override OTEL_EXPORTER_OTLP_PROTOCOL for traces only. Docs: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | -no example |
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | Override OTEL_EXPORTER_OTLP_PROTOCOL for metrics only. Docs: OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | -no example |
OTEL_SERVICE_NAME | Service name in resource attributes. Default github-copilot Docs: OTEL_SERVICE_NAME | -no example |
OTEL_RESOURCE_ATTRIBUTES | Extra resource attributes as comma-separated key=value pairs, percent-encoding special characters. Docs: OTEL_RESOURCE_ATTRIBUTES | -no example |
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | Capture full prompt, response, and tool argument content in OTel signals; may include sensitive data. Default false Docs: OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT | -no example |
OTEL_LOG_LEVEL | OTel diagnostic log level. NONE, ERROR, WARN, INFO, DEBUG, VERBOSE, ALL Docs: OTEL_LOG_LEVEL | -no example |
COPILOT_OTEL_FILE_EXPORTER_PATH | Write all OTel signals to this file as JSON-lines; setting it automatically enables OTel. Docs: COPILOT_OTEL_FILE_EXPORTER_PATH | -no example |
COPILOT_OTEL_SOURCE_NAME | Instrumentation scope name for tracer and meter. Default github.copilot Docs: COPILOT_OTEL_SOURCE_NAME | -no example |
OTEL_EXPORTER_OTLP_HEADERS | Auth headers for the OTLP exporter (for example, Authorization=Bearer token). Docs: OTEL_EXPORTER_OTLP_HEADERS | -no example |
The rest of the Copilot CLI reference
FAQ
How many environment variables does Copilot CLI have?
The official Copilot CLI docs list 67 environment variables, including COPILOT_ALLOW_ALL, COPILOT_AUTO_UPDATE and COPILOT_CACHE_HOME. All of them are in the table above, in the docs' order.
What does COPILOT_ALLOW_ALL do in Copilot CLI?
Allow all permissions automatically (equivalent to --allow-all). Exactly true also trusts the working directory, loading its skills, plugins, MCP servers, and hooks. Values: On: true, 1, yes, on, y; off: false, 0, no, off, n, empty (case-insensitive).
Where are Copilot CLI environment variables documented?
On 9 official docs pages at docs.github.com, last read on October 17, 2026. Every row in the table links the exact section it came from.
More on Copilot CLI
- Copilot CLI in the tools directoryWhat it is, who makes it and how it fits next to other coding agents.
- Copilot CLI errors and fixes12 error messages, quoted verbatim, with the documented fix for each.
- GitHub Copilot premium requests and usage limitsPlan and tier limits for this tool, copied from the official docs.
Use other models in Copilot CLI
Setup guides from the model-in-tool directory, each with the env vars and base URL from official docs.
Sources
Last verified . Names and examples are copied verbatim from the 9 official pages below, and every row above links the exact section it came from.
- docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference46 items
- docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference2 items
- docs.github.com/en/copilot/reference/copilot-cli-reference/cli-programmatic-reference1 item
- docs.github.com/en/copilot/reference/hooks-reference1 item
- docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models10 items
- docs.github.com/en/copilot/copilot-on-ghes/set-up-copilot-cli3 items
- docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli2 items
- docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference1 item
- docs.github.com/en/copilot/how-tos/copilot-sdk/features/plugin-directories1 item
Newsletter
Know when your tools change
One email per week. New coding agent releases, the flags and commands they add, and what they mean for how you work.