> ## Documentation Index
> Fetch the complete documentation index at: https://astronomer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# astro env airflow-variable create

<Info>
  This command is only available on Astro.
</Info>

Create a single Airflow variable with `--key` and `--value`, or bulk-create variables from a dotenv file with `--from-file`. When you use `--from-file`, the `--secret` and `--auto-link` flags apply to every entry in the file.

<Note>Bulk import with `--from-file` supports POSIX-style keys only. To create an Airflow variable whose key isn't POSIX-style, such as `team.config` or `dag-name`, use `--key` and `--value` instead.</Note>

## Usage

```bash wrap theme={null}
astro env airflow-variable create
```

## Options

| Option            | Description                                                                                                                                         | Possible Values             |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| `-k`,`--key`      | The variable key. Required unless you use `--from-file`.                                                                                            | Any string                  |
| `-v`,`--value`    | The variable value. If omitted, the CLI reads the value from stdin when piped, or prompts for it with the input hidden.                             | Any string                  |
| `-s`,`--secret`   | Mark the variable as secret.                                                                                                                        | None                        |
| `--from-file`     | Bulk-create variables from a dotenv file with one `KEY=VALUE` per line. Pass `-` to read from stdin. Mutually exclusive with `--key` and `--value`. | Any valid file path, or `-` |
| `--auto-link`     | Workspace scope only. Automatically link the variable to all Deployments in the Workspace, including future ones.                                   | None                        |
| `--workspace-id`  | Set the Workspace scope. Mutually exclusive with `--deployment-id`. Defaults to your current Workspace from CLI context.                            | Any valid Workspace ID      |
| `--deployment-id` | Set the Deployment scope. Mutually exclusive with `--workspace-id`.                                                                                 | Any valid Deployment ID     |

## Examples

```bash wrap theme={null}
# Create a Workspace Airflow variable
astro env airflow-variable create --workspace-id <workspace-id> --key MY_VAR --value some-value

# Bulk-create Airflow variables from a dotenv file
astro env airflow-variable create --workspace-id <workspace-id> --from-file vars.env
```

## Related commands

* [`astro env airflow-variable update`](/docs/cli/v1.43/astro-env-airflow-variable-update)
* [`astro env airflow-variable list`](/docs/cli/v1.43/astro-env-airflow-variable-list)
* [`astro env airflow-variable delete`](/docs/cli/v1.43/astro-env-airflow-variable-delete)
