astro env airflow-variable update

This command is only available on Astro.

Set the value of an Airflow variable. By default this command upserts: if the key doesn’t exist, the CLI creates it. Pass --strict to fail when the key is missing. Use --from-file to bulk-upsert variables from a dotenv file.

Usage

$astro env airflow-variable update [<id-or-key>]

Options

OptionDescriptionPossible Values
<id-or-key>The ID or key of the Airflow variable to update. Omit this argument when you use --from-file.Any valid variable ID or key
-v,--valueThe new variable value. If omitted, the CLI reads the value from stdin when piped, or prompts for it with the input hidden.Any string
-s,--secretWhen the variable doesn’t exist and the CLI creates it, mark it as secret. This has no effect when updating an existing variable.None
--strictFail if the variable doesn’t exist instead of creating it.None
--from-fileBulk-upsert variables from a dotenv file. Pass - to read from stdin. Mutually exclusive with --value and the positional <id-or-key>.Any valid file path, or -
--auto-linkWorkspace scope only. Automatically link the variable to all Deployments in the Workspace, including future ones.None
--workspace-idSet the Workspace scope. Mutually exclusive with --deployment-id. Defaults to your current Workspace from CLI context.Any valid Workspace ID
--deployment-idSet the Deployment scope. Mutually exclusive with --workspace-id.Any valid Deployment ID

Examples

$# Update a Workspace Airflow variable's value
>astro env airflow-variable update MY_VAR --workspace-id <workspace-id> --value new-value
>
># Bulk-upsert Airflow variables from a dotenv file
>astro env airflow-variable update --workspace-id <workspace-id> --from-file vars.env