CLI env commands
List, get, set, and pull environment variables for a Trigger.dev project.
These commands manage environment variables on a project environment. They default to prod. Use --env staging or --env preview (with --branch) for the other environments. There is no dev target: local trigger dev reads your local .env.
Unlike trigger dev and trigger deploy, these commands don't read TRIGGER_PROJECT_REF from .env files. If your config sets project: process.env.TRIGGER_PROJECT_REF, pass --project-ref, or export the variable in your shell.
npx trigger.dev@latest env listpnpm dlx trigger.dev@latest env listyarn dlx trigger.dev@latest env listenv list
Lists user-set environment variables. TRIGGER_ system variables are omitted. Values are hidden unless you pass --show-values.
npx trigger.dev@latest env list
npx trigger.dev@latest env list --show-valuespnpm dlx trigger.dev@latest env list
pnpm dlx trigger.dev@latest env list --show-valuesyarn dlx trigger.dev@latest env list
yarn dlx trigger.dev@latest env list --show-valuesbunx trigger.dev@latest env list
bunx trigger.dev@latest env list --show-valuesPrint the actual values, including secrets.
env get
Prints one variable. --raw prints only the value, with no banner or extra text, so you can capture it in a script.
npx trigger.dev@latest env get MY_VAR
npx trigger.dev@latest env get MY_VAR --rawpnpm dlx trigger.dev@latest env get MY_VAR
pnpm dlx trigger.dev@latest env get MY_VAR --rawyarn dlx trigger.dev@latest env get MY_VAR
yarn dlx trigger.dev@latest env get MY_VAR --rawbunx trigger.dev@latest env get MY_VAR
bunx trigger.dev@latest env get MY_VAR --rawThe name of the environment variable.
Print only the value.
env set
Creates the variable if it does not exist, and overwrites the value if it does. Empty or whitespace-only values are rejected.
Updating an existing secret without --secret changes the value and leaves it secret. Pass --secret when you first create a secret, or when you want a non-secret variable to become one.
npx trigger.dev@latest env set MY_VAR my-value
npx trigger.dev@latest env set STRIPE_KEY sk_live_abc --secretpnpm dlx trigger.dev@latest env set MY_VAR my-value
pnpm dlx trigger.dev@latest env set STRIPE_KEY sk_live_abc --secretyarn dlx trigger.dev@latest env set MY_VAR my-value
yarn dlx trigger.dev@latest env set STRIPE_KEY sk_live_abc --secretbunx trigger.dev@latest env set MY_VAR my-value
bunx trigger.dev@latest env set STRIPE_KEY sk_live_abc --secretThe name of the environment variable.
The value to set. Cannot be empty.
Store the value as a secret, so it cannot be read back.
env pull
Writes the project's environment variables to a local file. Defaults to .env.local. Asks you to confirm before overwriting an existing file unless you pass --force. TRIGGER_ system variables are omitted.
npx trigger.dev@latest env pull
npx trigger.dev@latest env pull --output .env.trigger --forcepnpm dlx trigger.dev@latest env pull
pnpm dlx trigger.dev@latest env pull --output .env.trigger --forceyarn dlx trigger.dev@latest env pull
yarn dlx trigger.dev@latest env pull --output .env.trigger --forcebunx trigger.dev@latest env pull
bunx trigger.dev@latest env pull --output .env.trigger --forceThe file to write. Defaults to .env.local.
Overwrite the output file if it exists, without asking.
Options
The environment to use: prod, staging or preview. Defaults to prod.
The name of the config file found at the project path. Defaults to trigger.config.ts
The project ref. Required if there is no config file.
Required when using --env preview. Specify the branch, e.g. --branch my-branch or -b my-branch.
Common options
These options are available on most commands.
The login profile to use. Defaults to the current profile, which is set by your last login or switch (initially "default").
Override the default API URL. If not specified, it uses https://api.trigger.dev. This can also be set via the TRIGGER_API_URL environment variable.
The CLI log level to use. Options are debug, info, log, warn, error, and none. This does not affect the log level of your trigger.dev tasks. Defaults to log.
Opt-out of sending telemetry data. This can also be done via the TRIGGER_TELEMETRY_DISABLED environment variable. Just set it to anything other than an empty string.
Shows the help information for the command.
Displays the version number of the CLI.
Was this page helpful?
Last updated
Edit on GitHub