Skip to main content

set-environment-variables

Set environment variables with the Unkey API CLI
1 min read

Upsert environment variables atomically, with optional pruning.

Usage#

Flags#

--projectstringrequired#

Project identifier or slug.

--appstringrequired#

Application identifier or slug.

--environmentstringrequired#

Environment identifier or slug.

--variablesJSON stringrequired#
Variables with key, value, kind, and description.
Show JSON schema
The JSON object uses the properties and constraints listed above.
--prunebool#

Remove existing variables that aren't included in --variables.

Default: "false"

Global Flags#

FlagTypeDescription
--root-keystringOverride root key ($UNKEY_ROOT_KEY)
--api-urlstringOverride API base URL (default: https://api.unkey.com)
--configstringPath to config file (default: ~/.unkey/config.toml)
--outputstringOutput format - use json for raw JSON
--bodystringSend this JSON string as the request body. You cannot combine it with request-building flags.

Examples#

See the Set environment variables API reference.