Set these variables in the environment that runs cf. They configure the CLI,
not the environment variables or secrets available to a deployed Worker. If a
variable is unset, cf uses the behavior in the Default column.
The following variables control cf behavior:
| Variable | Default | Effect |
|---|---|---|
CF_FORCE_OSC_PROGRESS |
Unset; only recognized terminals show progress outside the terminal buffer. | Set to 1 to enable terminal progress in an unrecognized compatible terminal. Requires a terminal on standard error. |
CF_NO_OSC_PROGRESS |
Unset; supported terminals show progress. | Set to 1 to turn off progress in the terminal tab title or taskbar. |
CF_QUIET |
Unset; interactive progress is shown. | Set to 1 to suppress animated API progress and terminal progress. It does not suppress command results. |
CF_SEND_TELEMETRY |
Unset; a saved preference or the default applies. | Set to true or 1 to enable anonymous CLI usage telemetry, or false or 0 to disable it. Takes precedence over WRANGLER_SEND_METRICS, but not DO_NOT_TRACK. |
CI |
Unset; cf also detects CI providers and the absence of a terminal. |
Set to true in CI to avoid interactive prompts. Prompts use defaults or fail when an answer is required. |
CLOUDFLARE_ACCESS_CLIENT_ID |
Unset; no Access service-token client ID is supplied. | Identifies the service token used to connect to Access-protected Workers. Set it with CLOUDFLARE_ACCESS_CLIENT_SECRET. |
CLOUDFLARE_ACCESS_CLIENT_SECRET |
Unset; no Access service-token secret is supplied. | Supplies the secret for the Access service token. Set it with CLOUDFLARE_ACCESS_CLIENT_ID. |
CLOUDFLARE_ACCOUNT_ID |
Unset; cf uses project configuration, a saved selection, or an accessible account. |
Selects the account for account-scoped commands. Overrides accountId in cloudflare.config.ts. |
CLOUDFLARE_API_BASE_URL |
The Cloudflare API endpoint for the selected compliance region. | Overrides the API endpoint. Only point it at an endpoint you trust because API requests carry credentials. |
CLOUDFLARE_API_HEADERS |
Unset; no custom headers are added. | A JSON object of custom HTTP headers for Cloudflare API requests. Configured values override existing request headers. |
CLOUDFLARE_API_TOKEN |
Unset; cf uses the selected OAuth profile. |
Authenticates API commands with this token instead of a saved profile. Use it for CI and other automation. |
CLOUDFLARE_COMPLIANCE_REGION |
public, unless set in cloudflare.config.ts. |
Selects the API compliance region and overrides the project configuration. Accepts public, fedramp_high, or fedramp-high. |
CLOUDFLARE_REGISTRY_PATH |
The registry directory in the cf configuration directory. |
Sets the local development registry path shared with Wrangler and Miniflare processes started by cf. |
CLOUDFLARE_ZONE_ID |
Unset; zone-scoped commands need a zone. | Supplies a default zone ID or domain name. The --zone or -z option takes precedence. |
DEBUG |
Unset; normal diagnostics are shown. | Set to a nonempty value to show additional diagnostics, including error stack traces and delegated command details. |
DO_NOT_TRACK |
Unset; telemetry follows the other settings. | Set to 1 to disable CLI telemetry, even if CF_SEND_TELEMETRY enables it. |
FORCE_COLOR |
Unset; color is used when standard output is a terminal. | Set to a value other than 0 to enable styled output without a terminal. NO_COLOR takes precedence. |
NO_COLOR |
Unset; color is used when standard output is a terminal. | Set to any value to disable styled output and animated API progress. |
TUNNEL_MANAGEMENT_TOKEN |
Unset; cf tunnels tail requests a token for the specified tunnel ID. |
Supplies an existing management token to cf tunnels tail. Do not pass a tunnel ID when this is set. |
WRANGLER_LOG_SANITIZE |
true. |
Omits sensitive deployment debug sections by default. Set to false with DEBUG enabled to include headers, request options, query strings, and request/response bodies. Header values outside the diagnostic allowlist remain redacted, regardless of this setting. |
WRANGLER_SEND_METRICS |
Unset; cf uses its saved telemetry preference or enables telemetry. |
Sets CLI telemetry when CF_SEND_TELEMETRY is not set. Accepts true, false, 1, or 0. |
cf loads only selected authentication and context variables from a project
.env file. Other variables in this table must be set in the process
environment. For the supported file variables, precedence, and security
guidance, refer to Load credentials from a .env file.
For more on API tokens and account selection, refer to Install and sign in. For telemetry settings in CI, refer to Use cf in CI.
Set CLOUDFLARE_API_HEADERS to a JSON object of HTTP header names and string values. For example, to send X-Custom-Header: value with Cloudflare API requests, set this variable in your shell or CI environment:
export CLOUDFLARE_API_HEADERS='{"X-Custom-Header":"value"}'In PowerShell, use:
$env:CLOUDFLARE_API_HEADERS = '{"X-Custom-Header":"value"}'Then run your Wrangler or cf command. These headers apply to Cloudflare API requests. They do not apply to local emulation or OAuth requests.
Configured values override existing request headers, including authentication headers. Header names are case-insensitive. The following headers are protected and cannot be set through this variable: Host, Content-Type, Content-Encoding, Content-Length, Connection, Transfer-Encoding, Upgrade, TE, and Trailer.