← Changelog
NewApps

Set environment variables from the CLI and the API

An app's environment variables, secrets included, could only be set in Settings · Environment variables, so CI, Git deploys and a script setting up a new environment had no way to add a key. Now ib-apps env lists an environment's variables, env set sets one (piped in or typed hidden, so it stays out of the shell's history), env rm removes one and env pull prints them as a .env file. The same is on the API under /v1/apps/:app/environments/:env/variables.

Setting and removing take a team owner or admin, or a key with Apps Permissions, as in the dashboard. A secret's value never comes back from a set; pull and reveal=true include secrets only for those who may reveal them, and each reveal is in the audit log.

A value set in production or an added environment is its own, over development's. Development's dev servers restart with a change; production reads it from its next deploy (ib-apps deploy --rebuild).

ib-apps 0.15.0.

More in Environment variables API.