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.
yofix env listyofix env list --target productionyofix env list --plain| Flag | Description |
|---|---|
--target <env> | Only show variables scoped to this environment |
--plain | Print just the keys, one per line |
yofix env get
Show a variable. --reveal fetches the plaintext value (audited).
yofix env get API_URLyofix env get STRIPE_KEY --reveal| Argument / flag | Description |
|---|---|
<key> | Variable name |
--reveal | Reveal the plaintext value (logged server-side) |
yofix env set
Create or update a variable. Omit the value to read it from stdin.
yofix env set API_URL https://api.example.comyofix env set STRIPE_KEY --target production --secretecho -n "$VALUE" | yofix env set STRIPE_KEY --secret| Argument / flag | Description |
|---|---|
<key> | Variable name |
[value] | Value (omit to read from stdin) |
--target <env...> | Target environment(s); repeatable |
--secret | Mark as a secret (write-only after creation) |
--force | Accepted for parity; set always upserts |
yofix env unset
Delete a variable across all its targets.
yofix env unset OLD_FLAGyofix env unset OLD_FLAG --yes| Argument / flag | Description |
|---|---|
<key> | Variable name |
-y, --yes | Skip confirmation |
yofix env pull
Write variables to a dotenv file. Reveals each value (audited).
yofix env pull # writes .env.localyofix env pull .env.production --target production| Argument / flag | Description |
|---|---|
[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.
yofix env import .env.production --target productionyofix env import .env --replace-existing| Argument / flag | Description |
|---|---|
<file> | Dotenv file to import |
--target <env...> | Target environment(s); repeatable |
--replace-existing | Overwrite keys that already exist |
yofix env clone
Copy variables from one target to another. Extends targets; the value stays shared.
yofix env clone --from preview --to production| Flag | Description |
|---|---|
--from <target> | Source target (required) |
--to <target> | Destination target (required) |