# kindgi environments

> The order of your environments

## `kindgi environments`

**Synopsis**

```sh signature
kindgi environments <command>
```

The order of your environments.

**Commands**

| Command                                                                                                        | Description                                                                                                     |
| -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [`kindgi environments list`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments-list)   | Show the order projects go live through: each environment's name (from your pack config), project and position. |
| [`kindgi environments set`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments-set)     | Set the order projects go live through — staging before prod, say.                                              |
| [`kindgi environments clear`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments-clear) | Clear the environment order; projects then take builds directly again.                                          |

**See also**

- [Organize work by org and project](https://docs.kindgi.com/guides/projects/organize-by-org-and-project.md)

### `kindgi environments list`

**Synopsis**

```sh signature
kindgi environments list [--org=<org-id>] [--path=<dir>]
```

Show the order projects go live through: each environment's name (from your pack config), project and position.

**Options**

| Option           | Default                   | Description                                                              |
| ---------------- | ------------------------- | ------------------------------------------------------------------------ |
| `--org <value>`  | none (the tenant's order) | An org's order instead of the tenant's, by org id.                       |
| `--path <value>` | the current directory     | The pack root, to name the environments. Default: the current directory. |

Every command also takes the [global flags](https://docs.kindgi.com/reference/cli.md#global-flags).

**Examples**

Show the order projects go live through, as a table.

```sh
kindgi environments list --table
```

List an org's own order instead of the tenant's.

```sh
kindgi environments list --org=<org-id>
```

**See also**

- [Organize work by org and project](https://docs.kindgi.com/guides/projects/organize-by-org-and-project.md)
- [`kindgi environments`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments)

### `kindgi environments set`

**Synopsis**

```sh signature
kindgi environments set <env> [<env> …] [--org=<org-id>] [--projects=<id-or-slug,…>] [--path=<dir>]
```

Set the order projects go live through — staging before prod, say. Names the environments from your pack config, in order; `--projects` takes project ids or slugs instead. Replaces the whole order. Tenant admins only.

**Options**

| Option               | Default                                                                 | Description                                                                                             |
| -------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `--org <value>`      | none (the tenant's order)                                               | An org's order instead of the tenant's, by org id.                                                      |
| `--path <value>`     | the current directory                                                   | The pack root. Default: the current directory.                                                          |
| `--projects <value>` | none (the environment names are used, resolved through the pack config) | Project ids or slugs, comma-separated, in order — for use outside a pack, instead of environment names. |

Every command also takes the [global flags](https://docs.kindgi.com/reference/cli.md#global-flags).

**Examples**

Put staging before prod, naming the environments from the pack config.

```sh
kindgi environments set staging prod
```

Set the order by project id or slug, outside a pack.

```sh
kindgi environments set --projects=staging,default
```

**See also**

- [Organize work by org and project](https://docs.kindgi.com/guides/projects/organize-by-org-and-project.md)
- [`kindgi environments`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments)

### `kindgi environments clear`

**Synopsis**

```sh signature
kindgi environments clear [--org=<org-id>]
```

Clear the environment order; projects then take builds directly again. Tenant admins only.

**Options**

| Option          | Default                   | Description                                        |
| --------------- | ------------------------- | -------------------------------------------------- |
| `--org <value>` | none (the tenant's order) | An org's order instead of the tenant's, by org id. |

Every command also takes the [global flags](https://docs.kindgi.com/reference/cli.md#global-flags).

**Examples**

Clear the order; projects then take builds directly again.

```sh
kindgi environments clear
```

**See also**

- [Organize work by org and project](https://docs.kindgi.com/guides/projects/organize-by-org-and-project.md)
- [`kindgi environments`](https://docs.kindgi.com/reference/cli/environments.md#kindgi-environments)
