new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Cloudflare Workers · Wrangler · all subjects

wrangler/commands

263 notes in this subject, read out of this brain and free to use. This is page 2 of 5.

R2 SQL commands available

Wrangler includes R2 SQL commands for managing R2 configurations, as documented in the wrangler-commands/r2-sql reference.

wrangler r2 commands exist

Wrangler provides commands for managing Workers R2 buckets and objects through the R2 subcommand.

wrangler complete bash setup

To set up shell completions for Bash, run `wrangler complete bash >> ~/.bashrc`, then restart your terminal or run `source ~/.bashrc`.

wrangler complete usage examples

After setting up shell completions, press Tab to autocomplete commands, subcommands, and flags. For example, `wrangler d<TAB>` completes to 'deploy', 'dev', 'd1', etc. And `wrangler kv <TAB>` shows subcommands: namespace, key, bulk.

wrangler complete command for shell completions

The `wrangler complete <SHELL>` command generates shell completion scripts for Wrangler commands. The `SHELL` parameter (string, required) specifies which shell to generate completions for. Supported values are: `bash`, `zsh`, `fish`, `powershell`. Shell completions allow you to autocomplete commands, subcommands, and flags by pressing Tab as you type.

wrangler complete fish setup

To set up shell completions for Fish, run `wrangler complete fish >> ~/.config/fish/config.fish`, then restart your terminal or run `source ~/.config/fish/config.fish`.

wrangler complete zsh setup

To set up shell completions for Zsh, run `wrangler complete zsh >> ~/.zshrc`, then restart your terminal or run `source ~/.zshrc`.

keyring storage does not affect API token precedence

The `--use-keyring` opt-in does not change how API tokens are resolved. `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_API_KEY`/`CLOUDFLARE_EMAIL` continue to take priority over any stored OAuth credentials.

wrangler telemetry enable command

The `wrangler telemetry enable` command enables telemetry collection for Wrangler.

wrangler telemetry disable command

The `wrangler telemetry disable` command disables telemetry collection for Wrangler.

wrangler whoami command

The `wrangler whoami` command displays information about your current authentication status, including whether you are logged in with an OAuth token and the email associated with it. It also shows where credentials are currently stored (e.g., encrypted file with key in OS Keychain).

wrangler auth token command

The `wrangler auth token` command retrieves your current authentication token or credentials for use with other tools and scripts. It accepts the flag `--json` (boolean, optional) to return output as JSON with token type information. This also enables retrieving API key/email credentials. The command returns whichever authentication method is currently configured, in the following order of precedence: API token from `CLOUDFLARE_API_TOKEN` environment variable; API key/email from `CLOUDFLARE_API_KEY` and `CLOUDFLARE_EMAIL` environment variables (requires `--json` flag); OAuth token from `wrangler login` (automatically refreshed if expired).

wrangler auth command for authentication profiles

The `wrangler auth` command manages authentication, including named authentication profiles for working across multiple accounts.

wrangler logout command

The `wrangler logout` command removes Wrangler's authorization for accessing your account. This command invalidates your current OAuth token and deletes the stored credentials. When keychain storage is active, both the encrypted credentials file and the keychain entry are removed.

CLOUDFLARE_AUTH_USE_KEYRING environment variable

The environment variable `CLOUDFLARE_AUTH_USE_KEYRING` overrides the persistent keyring preference for a single invocation. Set it to `true` to force the keychain backend for a command (e.g., `CLOUDFLARE_AUTH_USE_KEYRING=true npx wrangler deploy`). Set it to `false` to force the plaintext file backend (e.g., `CLOUDFLARE_AUTH_USE_KEYRING=false npx wrangler deploy`). When the environment variable is set to `true` and the keychain backend is unavailable (e.g., `secret-tool` is missing on Linux), Wrangler exits with an error rather than silently falling back to the plaintext file.

wrangler login --no-use-keyring to opt out of keyring storage

Pass `--no-use-keyring` to opt back out of keychain storage. Opt-out deletes the encrypted file and the keychain entry. Wrangler intentionally does not decrypt the existing credentials onto disk — writing plaintext during opt-out would defeat the at-rest protection. The subsequent login flow writes fresh credentials into the plaintext TOML file.

wrangler login --use-keyring for secure credential storage

By default, Wrangler stores the OAuth access token and refresh token in a plaintext TOML file under the global Wrangler config directory (typically `~/.config/.wrangler/config/default.toml`). Pass `--use-keyring` to store credentials in your operating system keychain using AES-256-GCM encryption. When enabled, Wrangler writes credentials into an encrypted file (`default.enc`) and stores the 32-byte encryption key in your OS keychain. macOS uses the built-in Keychain via `/usr/bin/security`. Linux uses libsecret via the `secret-tool` CLI from the `libsecret-tools` package. Windows uses Credential Manager via `@napi-rs/keyring`, which Wrangler installs lazily on first opt-in (≈1.9 MB one-time download). If a plaintext credentials file exists when you first opt in, Wrangler reads it, encrypts the contents into the new `.enc` file, and deletes the plaintext file. The choice is persisted across Wrangler invocations.

wrangler login in Docker container

The Cloudflare OAuth provider redirects to a callback server at `localhost:8976`. When running Wrangler inside a Docker container, you must configure your container to map port `8976` on your host machine to the Wrangler OAuth callback server's port. Run the container with `docker run -p 8976:8976 <your-image>` and set the callback host to listen on all network interfaces with `npx wrangler login --callback-host=0.0.0.0`. If using a different port inside the container, adjust the port mapping and use `--callback-port` accordingly, for example: `docker run -p 8976:9000 <your-image>` and `npx wrangler login --callback-host=0.0.0.0 --callback-port=9000`.

wrangler login on remote machine

When using Wrangler from a remote machine while running the login flow from your local browser, the browser login flow will redirect to a `localhost` URL on your machine. Leave the login flow active and open a second terminal session on the remote machine. Use `curl` or an equivalent request library to fetch the `localhost` URL that was generated during the `wrangler login` flow.

wrangler login flags

The `wrangler login` command accepts the following flags: `--scopes-list` (string, optional) lists all available OAuth scopes with descriptions; `--scopes` (string, optional) allows choosing a set of OAuth scopes in a whitespace-separated list (e.g., `npx wrangler login --scopes account:read user:read`); `--callback-host` (string, optional, defaults to `localhost`) sets the IP or hostname where Wrangler should listen for the OAuth callback; `--callback-port` (string, optional, defaults to `8976`) sets the port where Wrangler should listen for the OAuth callback; `--use-keyring` (boolean, optional) stores the OAuth credentials in your operating system keychain instead of the default plaintext TOML file. By default, `wrangler login` uses all available scopes if no flags are provided.

wrangler login command with OAuth

The `wrangler login` command authorizes Wrangler with your Cloudflare account using OAuth. Wrangler will attempt to automatically open your web browser to login with your Cloudflare account. If you prefer to use API tokens for authentication in headless or CI/CD environments, refer to Running Wrangler in CI/CD.

wrangler complete powershell setup

To set up shell completions for PowerShell, run `wrangler complete powershell >> $PROFILE`, then restart PowerShell or run `. $PROFILE`.

wrangler telemetry status command

The `wrangler telemetry status` command checks whether telemetry collection is currently enabled. The return result is specific to the directory where you run the command. It resolves the global status set by `wrangler telemetry disable / enable`, the environment variable `WRANGLER_SEND_METRICS`, and the `send_metrics` key in the Wrangler configuration file.

wrangler auth token --json output format

When using `wrangler auth token --json`, the output includes the token type. For API token: `{ "type": "api_token", "token": "..." }`. For OAuth token: `{ "type": "oauth", "token": "..." }`. For API key/email (only available with --json): `{ "type": "api_key", "key": "...", "email": "..." }`. An error is returned if no authentication method is available, or if API key/email is configured without `--json`.

wrangler docs command

The `wrangler docs` command opens the Cloudflare developer documentation in your default browser.

wrangler tunnel command overview

Wrangler provides tunnel commands to manage Cloudflare Tunnels directly. These commands allow you to create, run, and manage tunnels that securely connect local services to Cloudflare's network without requiring public IPs.

Wrangler vectorize command namespace

The 'vectorize' namespace in Wrangler provides commands for interacting with Vectorize vector databases. It is part of the Wrangler CLI tool and allows users to manage vector database operations.

secrets-store secret create command

Create an account-level secret using `npx wrangler secrets-store secret create <store-id> --name <secret-name> --scopes <scope> --remote`. The store-id is a required positional argument. The --name flag specifies the secret name. The --scopes flag specifies the scope (e.g., 'workers'). The --remote flag is required to interact with Secrets Store in production; without it, the command defaults to local development mode.

secrets-store secret list command

The `secrets-store secret list` command is available for listing account secrets in Wrangler.

secrets-store store list command

List all Secrets Stores using `npx wrangler secrets-store store list --remote`. The --remote flag is required for production access. The command returns a table with columns: Name, ID, AccountID, Created, and Modified.

secrets-store store delete command

Delete a Secrets Store using `npx wrangler secrets-store store delete <store-id> --remote`. The store-id is a required positional argument identifying the store to delete. The --remote flag is required for production access.

secrets-store store create command

Create a Secrets Store using `npx wrangler secrets-store store create <store-name> --remote`. The store-name is a required positional argument specifying the name of the store. The --remote flag is required for production access.

secrets-store secret delete command

The `secrets-store secret delete` command is available for deleting account secrets in Wrangler.

secrets-store secret get command

Retrieve a secret using `npx wrangler secrets-store secret get <store-id> --secret-id <secret-id> --remote`. The store-id is a required positional argument. The --secret-id flag specifies which secret to retrieve. The --remote flag is required for production access.

secrets-store secret duplicate command

The `secrets-store secret duplicate` command is available for duplicating account secrets in Wrangler.

secrets-store secret update command

The `secrets-store secret update` command is available for updating account secrets in Wrangler.

Wrangler vpc command namespace

Wrangler provides a vpc command namespace for managing Workers VPC services. VPC services allow Workers to connect to private services on a network through Cloudflare Tunnels.

dispatch-namespace rename command

The dispatch-namespace rename command is used to rename an existing dispatch namespace in Workers for Platforms.

dispatch-namespace delete command

The dispatch-namespace delete command is used to delete a dispatch namespace in Workers for Platforms.

dispatch-namespace create command

The dispatch-namespace create command is used to create a new dispatch namespace in Workers for Platforms.

dispatch-namespace get command

The dispatch-namespace get command is used to retrieve details about a specific dispatch namespace in Workers for Platforms.

dispatch-namespace list command

The dispatch-namespace list command is used to list all dispatch namespaces in Workers for Platforms.

dispatch-namespace delete requires empty namespace

You must delete all user Workers in the dispatch namespace before the dispatch namespace itself can be deleted.

wrangler workflows command minimum version

The wrangler workflows command requires Wrangler version 3.83.0 or greater. Use npx wrangler@latest to always use the latest Wrangler version when invoking commands.

wrangler workflows --local flag

All wrangler workflows commands support the --local flag to target a Workflow running in a local wrangler dev session instead of production. Use --port to specify the port of the dev session, which defaults to 8787. The --local flag requires Wrangler version 4.79.0 or greater.

Generated configuration used for specific commands

When .wrangler/deploy/config.json exists, the generated configuration is used for: wrangler deploy, wrangler dev, wrangler versions upload, wrangler versions deploy, wrangler pages deploy, and wrangler pages functions build.

wrangler build command removed in Wrangler v2

The wrangler build command is removed in Wrangler v2. The equivalent functionality can be achieved by wrangler publish --dry-run --outdir=path/to/build.

wrangler report command removed in Wrangler v2

The wrangler report command is removed in Wrangler v2. If you find a bug, report it at Wrangler issues on GitHub.

wrangler route command removed in Wrangler v2

The wrangler route command is removed in Wrangler v2. Routes are defined in the Wrangler configuration file instead.

wrangler preview command removed in Wrangler v2

The wrangler preview command is removed in Wrangler v2. Use the wrangler dev command instead for running your worker in your local environment.

--proxy, --, and --script-path options deprecated in wrangler pages dev

The --, --proxy, and --script-path options in wrangler pages dev are deprecated because they prevent wrangler pages dev from accurately emulating production's behavior for serving static assets. Instead, build your static assets to a directory and point Wrangler to that directory with wrangler pages dev <directory>.

--persist option deprecated in Wrangler v3

The --persist option for wrangler dev is deprecated in Wrangler v3 because wrangler dev automatically persists data by default and the option is no longer necessary.

--local option deprecated in Wrangler v3

The --local option for wrangler dev is deprecated in Wrangler v3 because wrangler dev is local by default and the option is no longer necessary.

wrangler version command deprecated in Wrangler v3

The wrangler version command is deprecated in Wrangler v3. Use wrangler --version to check the current version of Wrangler instead.

wrangler pages publish command deprecated in Wrangler v3, removed in v4

The wrangler pages publish command is deprecated as of Wrangler v3 and will be fully removed in Wrangler v4. Use wrangler pages deploy to deploy Pages instead.

wrangler generate command deprecated in Wrangler v3, removed in v4

The wrangler generate command is deprecated as of Wrangler v3 and will be fully removed in Wrangler v4. Use npm create cloudflare@latest for new Workers and Pages projects instead.

Workers Sites deprecated in Wrangler v4

Usage of Workers Sites is deprecated as of Wrangler v4. Support for using Workers Sites with Wrangler will be removed in a future version of Wrangler. Instead, you should migrate to Workers Static Assets.

wrangler build command removed in Wrangler v2

The wrangler build command is removed in Wrangler v2. If you wish to access the output from bundling your Worker, use wrangler deploy --outdir=path/to/output instead.

wrangler config command removed in Wrangler v2

The wrangler config command is removed in Wrangler v2 for authenticating via an API token. Use wrangler login / wrangler logout to manage OAuth authentication, or provide an API token via the CLOUDFLARE_API_TOKEN environment variable.

wrangler subdomain command removed in Wrangler v2

The wrangler subdomain command is removed in Wrangler v2 for creating a workers.dev subdomain. Create the workers.dev subdomain in Workers & Pages, select your Worker, Your subdomain, and then Change.

Give your agent this brain