Out Plane
env

env get

Print one environment variable.

read onlyrepeatable

One variable's value, printed on its own. It stays plain text even through a pipe, so TOKEN=$(outplane env get TOKEN) does exactly what it looks like, and a failure leaves standard output empty rather than putting an error message into the variable.

Usage

outplane env get <KEY> [flags]

Arguments

ArgumentTypeDescription
KEYstringThe variable's name. Required.

Flags

FlagTypeDescription
--appstringApplication name or id. Defaults to the linked app. A flag rather than an argument, so that variable names cannot be mistaken for it.

The global flags apply as well.

Output

FieldTypeDescription
keystring
valuestringNever masked: asking for one value is the request to see it.

This command prints a bare value in every format, so it can be read straight into a variable. It has no JSON form.

Examples

Read one value

outplane env get DATABASE_URL --app checkout

Capture it in a shell variable

DATABASE_URL=$(outplane env get DATABASE_URL)

Read the key and value as an object

outplane env get DATABASE_URL --json
{
  "key": "DATABASE_URL",
  "value": "postgresql://…"
}

What to Know

  • Text is the default even in a pipe, unlike every other command. stdout carries the raw value and a newline and nothing else, so KEY=$(outplane env get KEY) works in a script. Pass --json to get an object instead.
  • Because the piped default is text, a failure is a sentence on stderr rather than a JSON envelope on stdout, and stdout stays empty. That is what keeps command substitution from capturing an error message. Pass --json when the envelope is wanted.
  • A missing variable is exit 5 with env.not_found and the available keys in the error's details, so a caller never has to list separately to find out what it should have asked for.

Errors

Beyond 0 for success, this command exits with:

ExitKindMeaning
2usageInvalid arguments, unknown flag, or client-side validation failure.
3authNot authenticated, token revoked or expired, or forbidden for this team.
5not_foundThe named resource does not exist, or is not visible to this credential.
8upstreamThe Out Plane API returned a server error.

The code on the error object is one of env.not_found, context.no_app, app.not_found, usage.missing_argument. Branch on that, or on the exit status. The message is prose and changes.

On this page