Skip to main content
squarecloud app env manages the environment variables of an application. How your application reads them is covered in Environment variables. list takes the app ID as its argument. set, remove and replace use their arguments for variables, so they take the ID with --app. Both are optional: see how the CLI finds your app.

squarecloud app env list

Usage
Prints each variable as KEY=value, sorted by name.

squarecloud app env set

Usage
Sets one or more variables and leaves the others as they are.
Output

squarecloud app env remove

Usage
Aliases: delete, unset

squarecloud app env replace

Usage
Replaces the entire set of variables with the ones you pass: variables you don’t list are removed. It asks for y/N confirmation first, and needs at least one variable. To remove every variable, use remove --all.

Values with spaces and special characters

Your application loads its variables through a shell. So that it receives each value exactly as you typed it, the CLI quotes values that contain spaces or characters such as $, &, ; or #. env list then shows the stored value with those quotes.
A value you wrap in one pair of quotes is sent as written, so the shell of your application can expand it. Use it to build a value from another variable:

The --from-file format

  • One KEY=VALUE per line. Blank lines, lines starting with # and lines without = are skipped.
  • An export prefix is allowed, and a UTF-8 BOM at the start of the file is ignored.
  • A value in matching quotes is taken as it is between them.
  • In an unquoted value, anything from # on is a comment: A=foo #bar sets foo. Quote values that contain #.
  • Escape sequences and values that span several lines are not supported.