zitadel variable set
Set one variable on the project.
Usage
npx @zitadel/cli@latest variable set <name> [<value>] [flags]Arguments
| Argument | Description |
|---|---|
<name> | Variable name (letters, digits and underscores). Required. |
<value> | The value, for a plain (non-secret) variable. |
Flags
| Flag | Description |
|---|---|
--secret | Store the value encrypted. It can be replaced later but never read back. |
--as <value> | Store the value as this JSON type. One of string, number, boolean. Default: string. |
--preview | Write the preview value alone, leaving the primary one as it is. |
-e, --env <value> | Environment to run against, e.g. production. Defaults to ZITADEL_ENV, then the hosting platform's build (VERCEL_ENV, or Netlify's CONTEXT), then development. |
--env-file <value> | Read ZITADEL_* values from this file ahead of the process environment. A relative path is read from the current directory, not from --cwd. Cannot be combined with --env. |
It also takes the global flags.
Examples
npx @zitadel/cli@latest variable set GOOGLE_CLIENT_ID 1234.apps.googleusercontent.com
npx @zitadel/cli@latest variable set GOOGLE_CLIENT_SECRET --secret < secret.txt
npx @zitadel/cli@latest variable set SESSION_TTL 3600 --as number
npx @zitadel/cli@latest variable set API_URL https://preview.acme.com --previewAPI
It calls Update variables, PATCH /variables, in the Variables API.
Was this helpful?