Sign in
On this page
Documentationmodcloud CLIEnvironment variables

Environment variables

Manage application environment variables with modcloud CLI.

List variables

Environment values are masked by default. Use --show or--reveal only when you intend to display the actual values.

Code
modvc env list 1
modvc env list 1 --show

Set or remove a variable

Code
modvc env set 1 API_TOKEN=value
modvc env unset 1 API_TOKEN

The set command accepts a KEY=VALUE argument. The unset command removes the named key from the selected slot.

Push or pull an environment file

Code
modvc env push 1 .env.production
modvc env pull 1 .env.backup

Push reads the local file and shows a change summary before updating remote values. Pull writes the retrieved values to a local file.

A slot can contain up to 50 variables, and each value is limited to 10,000 characters. When using a new custom file path that does not include .env, include the slot number so the path is not mistaken for a slot argument.

Include environment values in a deployment

The ZIP collector excludes local .env files. To send one while deploying, use the deploy option:

Code
modvc deploy 1 --env .env.production