id = "wrangler" name = "Wrangler" homepage = "https://developers.cloudflare.com/workers/wrangler/" description = "Command-line interface for all things Cloudflare Workers" icon = "SimpleIcons:cloudflareworkers" executables = ["wrangler"] [dotfiles] # A Worker is configured by the wrangler.jsonc / wrangler.toml in its own # repository, not from the home directory. The only thing wrangler keeps in the # global config directory is the login below. paths = [] # packages/workers-utils/src/global-wrangler-config-path.ts, # getGlobalWranglerCachePath(): the cache is the XDG *cache* directory for the # same ".wrangler" app name — ~/Library/Caches/.wrangler on macOS, # ~/.cache/.wrangler on Linux, %LOCALAPPDATA%/xdg.cache/.wrangler on Windows # (packages/workers-utils/src/xdg-app-paths.ts). Never configuration. exclude = [ "~/Library/Caches/.wrangler/", "~/.cache/.wrangler/", "%LOCALAPPDATA%/xdg.cache/.wrangler/", ] # Where: getGlobalConfigPath() in packages/workers-utils/src/ # global-wrangler-config-path.ts returns `~/.wrangler` when that directory # already exists (wrangler's historical location, still honoured), otherwise the # XDG config directory for the app name ".wrangler". xdg-app-paths.ts spells # that directory out per platform: ~/Library/Preferences on macOS, ~/.config on # Linux, %APPDATA%/xdg.config on Windows. # # What: packages/workers-auth/src/credential-store/file-store.ts puts the auth # files in the "config" subdirectory as `.toml` — `default.toml` for a # normal login, the API environment's name under WRANGLER_API_ENVIRONMENT, and # the profile name for a named profile, hence the glob. The file is a # UserAuthConfig and nothing else (packages/workers-auth/src/config-file/auth.ts): # oauth_token, refresh_token, expiration_time, scopes, and the deprecated # api_token. # # `wrangler login --use-keyring` migrates the same credentials into a sibling # `.enc` encrypted with a key held in the OS keyring; that file is not # listed because it is useless without the keyring entry, which does not travel. secret = [ "~/.wrangler/config/*.toml", "~/Library/Preferences/.wrangler/config/*.toml", "~/.config/.wrangler/config/*.toml", "%APPDATA%/xdg.config/.wrangler/config/*.toml", ] [commands] format = 1 label = "Wrangler (legacy v1 commands)" description = "Develop, publish and tail a Cloudflare Worker using the commands in the Fig spec. KV, secrets and routes are left out." quality = "ai-draft" base = "fig:wrangler" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wrangler.ts" license = "MIT" [[commands.subcommand]] path = ["dev"] label = "Local dev server" description = "Start a local server for the worker." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wrangler.ts" license = "MIT" [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "env" label = "Environment" type = "string" option = ["--env", "-e"] sources = ["fig"] [[commands.subcommand.field]] id = "host" label = "Host to forward to" type = "string" option = ["--host", "-h"] sources = ["fig"] [[commands.subcommand.field]] id = "ip" label = "IP to listen on" type = "string" option = ["--ip", "-i"] sources = ["fig"] [[commands.subcommand.field]] id = "port" label = "Port" type = "integer" option = ["--port", "-p"] sources = ["fig"] [[commands.subcommand.task]] id = "dev" label = "Run dev server" fields = ["config", "env", "port"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["config", "env", "port"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["host", "ip"] [[commands.subcommand]] path = ["publish"] label = "Publish worker" description = "Publish the worker to Cloudflare." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wrangler.ts" license = "MIT" [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "env" label = "Environment" type = "string" option = ["--env", "-e"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["--verbose"] sources = ["fig"] [[commands.subcommand.task]] id = "publish" label = "Publish" fields = ["config", "env"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["config", "env"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["verbose"] [[commands.subcommand]] path = ["tail"] label = "Tail logs" description = "Aggregate logs from the production worker." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wrangler.ts" license = "MIT" [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "env" label = "Environment" type = "string" option = ["--env", "-e"] sources = ["fig"] [[commands.subcommand.field]] id = "format" label = "Output format" type = "string" option = ["--format", "-f"] suggestions = [{ value = "json", label = "json" }, { value = "pretty", label = "pretty" }] sources = ["fig"] [[commands.subcommand.field]] id = "port" label = "Port" type = "integer" option = ["--port", "-p"] sources = ["fig"] [[commands.subcommand.field]] id = "verbose" label = "Verbose" type = "boolean" option = ["--verbose"] sources = ["fig"] [[commands.subcommand.task]] id = "tail" label = "Tail logs" fields = ["config", "env", "format"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["config", "env", "format"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["port", "verbose"] [[commands.subcommand]] path = ["init"] label = "Create wrangler.toml" description = "Create a wrangler.toml for an existing project." [[commands.subcommand.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/wrangler.ts" license = "MIT" [[commands.subcommand.field]] id = "name" label = "Worker name" type = "string" position = 0 sources = ["fig"] [[commands.subcommand.field]] id = "config" label = "Config file" type = "path" option = ["--config", "-c"] path = { kind = "file", role = "input" } sources = ["fig"] [[commands.subcommand.field]] id = "env" label = "Environment" type = "string" option = ["--env", "-e"] sources = ["fig"] [[commands.subcommand.field]] id = "site" label = "Workers Sites project" type = "boolean" option = ["--site", "-s"] sources = ["fig"] [[commands.subcommand.field]] id = "type" label = "Project type" type = "string" option = ["--type", "-t"] sources = ["fig"] [[commands.subcommand.task]] id = "init" label = "Initialize" fields = ["name", "type"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["name", "type"] [[commands.subcommand.group]] id = "advanced" label = "Advanced" fields = ["config", "env", "site"]