Skip to main content
meridian env lists, sets and unsets the linked app’s environment variables and secrets from a terminal, in one hosted environment or for all environments at once. It makes the same changes as the Environment page in the dashboard, with the same permissions, and each change lands in the activity log marked as made from the CLI.
--env names the environment by type: development, staging or production. set and unset take --all-environments instead to write the value set for All environments, and refuse the two together (Pass --env or --all-environments, not both.). One of them is required. In an interactive terminal the CLI asks for the environment, offering the three types but never all environments, and otherwise the command fails and names --env.

What the CLI can change

Production, and all environments (which reach production), need CLI 1.9.0 or later. An older CLI refuses production itself with Production variables can't be changed from the CLI. and does not know --all-environments: upgrade it with npm install -g @the-meridian/cli@latest.

Production and all environments

A CLI token stays valid for 90 days on your machine, and a production variable such as DATABASE_URL or the Shopify secret amounts to production access. So a set or an unset on production, or with --all-environments, counts as a production change, like a production deploy. First, the CLI asks you to confirm, naming the key, the environment and the app, before it reads the value:
The default is No. Answering No reads no value and sends nothing, and the CLI prints Aborted. Nothing was changed. (Aborted. Nothing was deleted. for unset). Without a terminal, pass --yes or set MERIDIAN_YES=1 instead. For unset, this question replaces the usual one. Then the API wants production access on your token, approved in your browser with meridian login --production. --yes only answers the question above and never stands in for it. Without production access, in a terminal, the CLI asks Production changes need production access, approved in your browser. Request it now?, and once you approve it sends the same change again, without reading the value a second time. Outside a terminal it never asks: it prints the refusal and Run: meridian login --production, then exits non-zero. A piped value counts as running without a terminal. To pipe a value into a production or all-environments write, get production access first with meridian login --production, then pass --yes:
Production access adds no permission: the permissions below still apply. On development and staging, set asks no question, and neither command needs production access.

Listing

Lists what the environment gets at deploy: its own variables and secrets, and the ones set for all environments. The list never shows a value, not even a plain variable’s, which the dashboard can show you. --json prints every entry with its metadata. The variables Meridian injects itself at deploy are not listed. See Managed variables.

Setting

Creates the key in the environment, or replaces its value when it already exists there. With --all-environments instead of --env, it does the same for the value every environment gets unless it sets its own. The output says which, for example Created STRIPE_KEY in production (secret). or Updated LOG_LEVEL for all environments (plain variable). Keys follow the dashboard’s rules: letters, digits and underscores, uppercased for you, and the HOSTING_ prefix and the names Meridian always sets (MERIDIAN_APP_ID, MERIDIAN_API_URL, MERIDIAN_OAUTH_CLIENT_ID, MERIDIAN_OAUTH_CLIENT_SECRET) are refused. The value never goes on the command line, where it would stay in your shell history, show in ps and land in an AI agent’s transcript. The CLI reads it from the first of:
  1. --from-file <path>: the file’s contents.
  2. Standard input, when it is piped: printf '%s' "$VALUE" | meridian env set KEY --env development.
  3. A masked prompt, when you run the command in an interactive terminal. You type the value once and every character shows as *.
When none applies (no file, nothing piped, no interactive terminal), the command fails and names the three ways. An empty value, or one longer than 8192 characters, is refused before anything is sent. The value is trimmed like a dashboard save, and it is never printed, not with --json, not with --verbose and not in an error. A KEY=VALUE argument, or a value passed as a second argument, is refused without being repeated. An existing key keeps its type when you pass neither flag. Asking for the other type is refused: unset the key, then set it again with the flag you want. When the key is also set for all environments, set creates the environment’s own entry, which overrides the shared one in that environment, and says so: STRIPE_KEY is also set for all environments: this value overrides it in staging. A value set with --all-environments does not reach an environment that sets its own, and the CLI prints one line for each, such as production keeps its own value. When the key overrides a variable Meridian manages, such as SHOPIFY_API_KEY, the output says that too. A generated secret can go straight in without ever being printed:

Unsetting

Deletes the environment’s own entry of the key, after you confirm (Delete API_URL from development?). --yes skips the question, and is required when the CLI cannot ask. On production, the production question replaces it. With --all-environments, unset deletes the value set for all environments, after the same production question, and prints a line for each environment that keeps its own value. A key that is not set there changes nothing (API_URL is not set in development. Nothing was deleted.). A key set for all environments, with no entry of the environment’s own, is refused with HTTP 409, and nothing is deleted:
The hint under it is the command that deletes it everywhere, meridian env unset STRIPE_KEY --all-environments. When the key overrides a variable Meridian manages and its value is different from Meridian’s, or cannot be compared, deleting it changes the value the app runs with. The CLI shows why and asks again before it deletes (Delete SHOPIFY_API_KEY from production anyway?), and --yes answers that question too. See Managed variables.

Permissions and the activity log

The app’s Meridian plan must include the Deploy feature, and an organization in demo mode refuses every change. set and unset share a budget of 20 calls a minute per user. Each change records Secret created, Secret updated or Secret deleted with the key in the activity log, marked as made from the CLI. The value is never recorded.

When changes take effect

Like any change on the Environment page, a change reaches the app at the next deploy of that environment, for example meridian deploy --env development. A change for all environments reaches each environment at its next deploy. The running revision keeps the values it was deployed with. See When changes take effect.
Last modified on November 17, 2026