# env-vars download


Downloads the environment variables from an application and writes them to a file. This file can either use the same format as web download (`dotenv`) or `json`.

You can specify which kinds of variables to download using `environment-type` with the following variables: 

- `all` returns all environment variables
- `user` returns user-created environment variables
- `generated` returns environment variables generated by Cloud 66
- `locked` returns non-editable environment variables that were generated by Cloud 66

```shell
$ cx env-vars download --stack <application name> --environment-type <type> --file <filename> --file-type <file-type>
```

#### Options

| Argument | Required? | Default | Description |
|  ---  |  ---  |  ---  |  ---  |
| `--stack, -s <application name>` | yes | — | Full or partial name of the application |
| `--file-type <file-type>` | yes | — | Sets the format of the file containing the list of environment variables (dotenv or json) |
| `--file <filename>` | yes | — | The filename of the file being created (or overwritten) by the download |
| `--environment-type <type>` | no | — | Specify the type of variables. Accepts multiple options. (all, user, generated, locked) |

#### Examples

```shell
$ cx env-vars download -s mystack --file environment_variables_json --file-type json
$ cx env-vars download -s another_app --file environment_variables_dotenv --file-type dotenv
```