Out Plane
env

env unset

Remove environment variables.

writes--dry-run

Removes variables by name.

All of them or none of them: a name that is not set stops the whole command, so a typo cannot half remove something. The value itself cannot be recovered afterwards.

--hangar <name> removes them from a Hangar instead, and --restart restarts it so the removal applies now.

Usage

outplane env unset <KEY...> [flags]

Arguments

ArgumentTypeDescription
KEYstringThe variable's name, repeatable. Required. Takes the rest of the line.

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.
--hangarstringA Hangar's name or id, instead of an application. Not with --app.
--deployboolDeploy afterwards, so the removal reaches the running app. Not with --hangar.
--restartboolWith --hangar: restart the Hangar afterwards, so the change reaches it now. Stops everything running in its terminal. Restarts nothing on a paused Hangar.

The global flags apply as well.

Output

FieldTypeDescription
actionstringOne of set, unset.
keysarrayThe names that were removed.
appstring
changedboolFalse for a dry run.
deploymentIdint | null
restartedbool | nullWhether --restart restarted the Hangar. false without it, on a paused Hangar, for a dry run and when the restart was refused. null when the target is an application.

Examples

Remove one variable

outplane env unset LOG_LEVEL

Remove several and apply the change

outplane env unset LOG_LEVEL TIMEOUT --app checkout --deploy

Check the names resolve before removing anything

outplane env unset LOG_LEVEL --dry-run --json
{
  "changed": false,
  "keys": [
    "LOG_LEVEL"
  ]
}

Remove several at once and read the result

outplane env unset LOG_LEVEL TIMEOUT --json --fields keys,changed

Remove one from a Hangar and restart it to apply the change

outplane env unset LOG_LEVEL --hangar myhangar --restart

What to Know

  • A name that is not set is exit 5 and nothing is removed, including the names that were valid. Removal is all or nothing.
  • The value cannot be recovered afterwards. This command is not gated behind a confirmation, because removing a variable is an ordinary edit; the irreversible part is the value, not the application.
  • Without --deploy the running application still has the variable. Removing it from the record and from the process are two different things.
  • --hangar names a Hangar instead of an application, and is refused together with --app. A Hangar is an application record with the same id, so the requests are the same, and a result's app field holds the Hangar's name.
  • Saving changes nothing running in a Hangar either. It is started from its saved variables, groups and ports, so without --restart a change applies at its next outplane hangar restart, or at outplane hangar resume when it is paused. --restart is refused without --hangar, and --deploy with it.
  • --restart stops everything running in the Hangar's terminal, agents included, and disconnects anyone connected; files under /home/hangar stay. An agent working inside the Hangar ends its own session by passing it. On a paused Hangar it restarts nothing and does not fail, and a restart the server refuses still exits 0 once the change is saved, with restarted false and the reason on stderr.

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, hangar.not_found, hangar.ambiguous, usage.conflicting_flags, usage.empty_argument. Branch on that, or on the exit status. The message is prose and changes.

On this page