tofupilot env

Last updated on November 23, 2026

PreviewThis feature is in preview, so its scope and behavior may change. Request access.

The env command manages the environment variables your procedures read. Without a level flag, it works on the procedure the current directory is linked to.

env
tofupilot env add MES_TOKEN production
tofupilot env ls

It requires a user login (tofupilot login). Every subcommand accepts --json.

Types

TypeFlagUse for
Secret--type secret (default)Passwords, API keys, tokens. Never shown again after saving
Config--type config or --no-sensitiveAddresses, URLs, settings. Readable after saving

Levels

FlagApplies to
noneThe linked procedure
--procedure <ID_OR_NAME>That procedure
--station <ID_OR_NAME>Every procedure on that station
--sharedEvery procedure of the organization

Environments

Pass environments as a comma-separated list of production, preview and development. Without one, a procedure or Shared value targets all three. Station values always count as production.

environments
tofupilot env add MES_URL production --no-sensitive --value https://mes.example.com
tofupilot env add MES_URL preview,development --no-sensitive --value https://mes-sandbox.example.com

add

The add subcommand creates an environment variable. Without --value, it reads stdin, or asks at a prompt (hidden for a Secret).

add
# Secret, asked at a hidden prompt
tofupilot env add MES_TOKEN production

# Config on one station
tofupilot env add DMM_RESOURCE --station bench-2 --no-sensitive --value "TCPIP0::10.0.0.7::INSTR"

# From a script
printf %s "$TOKEN" | tofupilot env add MES_TOKEN --station bench-2
FlagEffect
--value <VALUE>The value. A Secret passed here lands in your shell history: prefer the prompt or stdin
--note <TEXT>Where to rotate the value, or who to contact
--value-type <TYPE>string, number, integer or boolean, checked on save
--forceOverwrite an existing variable with the same key
-y, --yesSkip confirmations

A Config can be turned into a Secret with --type secret --force. A Secret cannot become a Config: remove it and add it again.

list

The list subcommand (alias ls) lists the environment variables of one level. Secrets show as a digest, which changes when the value changes.

list
tofupilot env ls
tofupilot env ls production --station bench-2
tofupilot env ls --shared --type secret

update

The update subcommand sets a new value on an existing environment variable. Each update increases its version, so every run records which value it used.

update
tofupilot env update MES_TOKEN production

remove

The remove subcommand (alias rm) deletes an environment variable, after a confirmation.

remove
tofupilot env rm MES_URL preview

pull

The pull subcommand writes the linked procedure's development values into .env.local, where local runs read them.

pull
tofupilot env pull
tofupilot env pull .env.bench --station bench-2

The file is written with mode 0600. Secrets are included only when they target development. The command warns when .gitignore does not list the file.

run

The run subcommand runs a command with the linked procedure's development values, without writing a file.

run
tofupilot env run -- python scripts/check_mes.py

The command behaves as if it ran alone and exits with its exit code. A Ctrl-C typed at the terminal reaches it directly; a SIGINT sent with no terminal or from the background (timeout -s INT, a supervisor, CI), SIGTERM and SIGHUP sent to tofupilot are passed on to it, and tofupilot waits for it to exit. A command that cannot be found exits 127, one that cannot be run 126, as in a shell.

resolve

The resolve subcommand shows, for each key, the value a station would receive and the level it comes from.

resolve
tofupilot env resolve production --station bench-2
Output
Key            Value                       Wins       Shadows
DMM_RESOURCE   TCPIP0::10.0.1.22::INSTR    station    -
MES_URL        https://mes.example.com     procedure  shared

Permissions

RoleCan
Viewer and abovelist and resolve
DeveloperChange Config values that do not target production
Admin, OwnerChange everything, including Secrets and station values

Since Secret and all environments are the defaults, a Developer adds Config values with --no-sensitive and an explicit preview or development.

How is this guide?

On this page