Skip to content

Environment variables

Manage project environment variables. For the workflow and examples, see Environment variables.

Variables are scoped to one or more targets (for example preview and production). A new variable defaults to both.

yofix env list

List variable keys. Values are masked; use env pull for values.

Terminal window
yofix env list
yofix env list --target production
yofix env list --plain
FlagDescription
--target <env>Only show variables scoped to this environment
--plainPrint just the keys, one per line

yofix env get

Show a variable. --reveal fetches the plaintext value (audited).

Terminal window
yofix env get API_URL
yofix env get STRIPE_KEY --reveal
Argument / flagDescription
<key>Variable name
--revealReveal the plaintext value (logged server-side)

yofix env set

Create or update a variable. Omit the value to read it from stdin.

Terminal window
yofix env set API_URL https://api.example.com
yofix env set STRIPE_KEY --target production --secret
echo -n "$VALUE" | yofix env set STRIPE_KEY --secret
Argument / flagDescription
<key>Variable name
[value]Value (omit to read from stdin)
--target <env...>Target environment(s); repeatable
--secretMark as a secret (write-only after creation)
--forceAccepted for parity; set always upserts

yofix env unset

Delete a variable across all its targets.

Terminal window
yofix env unset OLD_FLAG
yofix env unset OLD_FLAG --yes
Argument / flagDescription
<key>Variable name
-y, --yesSkip confirmation

yofix env pull

Write variables to a dotenv file. Reveals each value (audited).

Terminal window
yofix env pull # writes .env.local
yofix env pull .env.production --target production
Argument / flagDescription
[file]Output file (default .env.local)
--target <env>Only pull variables scoped to this environment

yofix env import

Bulk-load variables from a dotenv file.

Terminal window
yofix env import .env.production --target production
yofix env import .env --replace-existing
Argument / flagDescription
<file>Dotenv file to import
--target <env...>Target environment(s); repeatable
--replace-existingOverwrite keys that already exist

yofix env clone

Copy variables from one target to another. Extends targets; the value stays shared.

Terminal window
yofix env clone --from preview --to production
FlagDescription
--from <target>Source target (required)
--to <target>Destination target (required)