Manage secrets for a specific config file

secrets & env vars

// what it does

`-c` points the secret command at a specific Wrangler config, which is essential in a monorepo or when you keep separate config files per Worker/environment. It resolves the Worker name and environments from that file rather than the cwd.

// shell

$ wrangler secret put DATABASE_URL -c ./workers/api/wrangler.jsonc --env production
$ wrangler secret list -c ./workers/api/wrangler.jsonc

// gotcha

`-c` only picks the config file — it doesn't select an environment on its own. Pair it with `--env` when that config defines multiple environments, or the secret lands on the wrong (top-level) Worker.