# hub app <name> env

Source: https://docs.myhub.host/cli/app/env

Values are stored encrypted and never printed. Setting or removing a variable restarts the app with it, or rebuilds it for a variable set with `--build`.

## Usage

```sh
hub app <name> env [options] [command]
```

## Arguments

| Argument | Description                                                                           |
| -------- | ------------------------------------------------------------------------------------- |
| `<name>` | The app, or `app/instance` for an instance other than prod, such as `my-app/staging`. |

## Options

| Option   | Description                                          |
| -------- | ---------------------------------------------------- |
| `--json` | Return environment names and metadata; never values. |

## Examples

```sh
# List the names
hub app my-app env

# Set a variable
hub app my-app env set GREETING=hi

# Be asked for the value, so it stays out of shell history
hub app my-app env set API_KEY

# Set every variable in a dotenv file
hub app my-app env set --file .env

# Remove a variable
hub app my-app env unset GREETING
```

## `hub app <name> env set`

Set environment variables (a bare NAME prompts for the value).

### Usage

```sh
hub app <name> env set [options] [pairs...]
```

### Arguments

| Argument     | Description                                                   |
| ------------ | ------------------------------------------------------------- |
| `[pairs...]` | `NAME=value`, or a bare NAME to be prompted for it. Optional. |

### Options

| Option          | Description                                                               |
| --------------- | ------------------------------------------------------------------------- |
| `--build`       | Make these available at build time too.                                   |
| `--file <path>` | Read more `NAME=value` pairs from a dotenv file; pairs above win over it. |
| `--json`        | Return changed names and any new release immediately; never values.       |

## `hub app <name> env unset`

Remove environment variables.

### Usage

```sh
hub app <name> env unset [options] <names...>
```

### Arguments

| Argument     | Description                 |
| ------------ | --------------------------- |
| `<names...>` | Environment variable names. |

### Options

| Option   | Description                                           |
| -------- | ----------------------------------------------------- |
| `--json` | Return changed names and any new release immediately. |