> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/environments.md).

# environments

Manage the environments on your account — named, isolated spaces (Production plus any non-production environments) that segregate connections, flows, and other resources by lifecycle stage.

**REST API**: [Environments](https://developer.celigo.com/api/api-reference/environments)

```
celigo environments <subcommand> [flags]
```

Supports all [global flags](/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand | Purpose                                                                              |
| ---------- | ------------------------------------------------------------------------------------ |
| `list`     | List every environment configured on the account.                                    |
| `get`      | Fetch a single environment by ID.                                                    |
| `create`   | Create a new environment from a JSON body (`--file <path>` or stdin).                |
| `update`   | Replace an environment's mutable fields from a JSON body (`--file <path>` or stdin). |
| `set`      | Patch one or more fields on an environment without re-sending the full document.     |
| `enable`   | Enable an environment (no-op if already enabled).                                    |
| `disable`  | Disable an environment (no-op if already disabled).                                  |

`delete` is intentionally absent — see [Gotchas](#gotchas).

***

## `celigo environments list`

List all environments in the account.

**Signature**

```bash
celigo environments list
```

**Arguments**

None.

**Flags**

None beyond the [global flags](/cli/getting-started/global-flags.md) (`--format`, `--jq`, `--profile`, `--verbose`).

**Example**

```bash
celigo environments list --format table
```

Default table columns: `_id`, `name`, `lastModified`.

In celigo-cli 2026.8.1 through 2026.8.8 the default `list` failed with `422 Unprocessable Entity` because the endpoint rejects the `include` projection, and only `--fields all` worked; since 2026.9.1 the default form works again (rows are trimmed client-side to the same columns).

**Corresponds to**: [`GET /v1/environments`](https://developer.celigo.com/api/api-reference/environments#get-v1-environments)

***

## `celigo environments get`

Fetch a single environment by its ID.

**Signature**

```bash
celigo environments get <id>
```

**Arguments**

| Argument | Required | Description                           |
| -------- | -------- | ------------------------------------- |
| `<id>`   | Yes      | Environment `_id` (24-character hex). |

**Flags**

None beyond the [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo environments get 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/environments/{_id}`](https://developer.celigo.com/api/api-reference/environments#get-v1-environments-_id)

***

## `celigo environments create`

Create a new environment from a JSON document. Read the body from a file with `-f, --file` or pipe it on stdin. `name` is required; `description` and `apim` metadata are optional.

**Signature**

```bash
celigo environments create --file <path>
celigo environments create < body.json     # or pipe on stdin
```

**Arguments**

None. The request body comes from `--file` or stdin.

**Flags**

| Flag                | Type   | Default | Description                                                                                                  |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |

Plus the [global flags](/cli/getting-started/global-flags.md). Blocked in `read` mode.

**Example**

```bash
celigo environments create < qa-env.json
```

**Corresponds to**: [`POST /v1/environments`](https://developer.celigo.com/api/api-reference/environments#post-v1-environments)

***

## `celigo environments update`

Replace an environment with a JSON document. Read the body from a file with `-f, --file` or pipe it on stdin. PUT is a full replace — omitted fields are cleared.

> ⚠️ **`PUT` fully replaces the environment.** Any field omitted from the body is cleared. `GET` the environment first, edit, then send the complete object back — or use `set` for targeted field edits.

**Signature**

```bash
celigo environments update <id> --file <path>
celigo environments update <id> < body.json     # or pipe on stdin
```

**Arguments**

| Argument | Required | Description                   |
| -------- | -------- | ----------------------------- |
| `<id>`   | Yes      | Environment `_id` to replace. |

**Flags**

| Flag                | Type    | Default | Description                                                                                                  |
| ------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`***`) copied from a GET.                         |

Plus the [global flags](/cli/getting-started/global-flags.md). Blocked in `read` mode.

**Example**

```bash
celigo environments get 5f8d43a1b9e5a80011a35f2c --format json \
  | jq '.description = "Updated QA environment"' \
  | celigo environments update 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PUT /v1/environments/{_id}`](https://developer.celigo.com/api/api-reference/environments#put-v1-environments-_id)

***

## `celigo environments set`

Patch one or more fields on an environment. Whitelisted fields (e.g. `name`) are applied via an atomic `PATCH`; other fields go through `GET` → apply assignments → `PUT` to avoid clobbering fields you don't intend to change.

**Signature**

```bash
celigo environments set <id> <key=value> [<key=value>...]
```

**Arguments**

| Argument      | Required | Description                                                                                                                                                                                                         |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<id>`        | Yes      | Environment `_id` to modify.                                                                                                                                                                                        |
| `<key=value>` | Yes (≥1) | One or more assignments. Values are auto-parsed as JSON — `null` removes the field. Dot notation (`apim.environmentHRID=prod`) is supported. Array indexing does not apply here — no Environment field is an array. |

**Flags**

None beyond the [global flags](/cli/getting-started/global-flags.md). Blocked in `read` mode.

**Examples**

```bash
celigo environments set 5f8d43a1b9e5a80011a35f2c description="Shared UAT environment"
celigo environments set 5f8d43a1b9e5a80011a35f2c apim.environmentHRID=prod-us apim.groupId=admins
celigo environments set 5f8d43a1b9e5a80011a35f2c description=null
```

**Corresponds to**: [`GET /v1/environments/{_id}`](https://developer.celigo.com/api/api-reference/environments#get-v1-environments-_id) followed by [`PUT /v1/environments/{_id}`](https://developer.celigo.com/api/api-reference/environments#put-v1-environments-_id).

***

## `celigo environments enable`

Enable an environment. No-op if it is already enabled.

**Signature**

```bash
celigo environments enable <id>
```

**Arguments**

| Argument | Required | Description                  |
| -------- | -------- | ---------------------------- |
| `<id>`   | Yes      | Environment `_id` to enable. |

**Flags**

None beyond the [global flags](/cli/getting-started/global-flags.md). Blocked in `read` mode.

**Example**

```bash
celigo environments enable 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PUT /v1/environments/{_id}/enable`](https://developer.celigo.com/api/api-reference/environments) (operationId: `toggleEnvironment`)

***

## `celigo environments disable`

Disable an environment. No-op if it is already disabled. The Production environment cannot be disabled.

> ⚠️ **Disabling an environment takes it out of service.** The environment is unavailable until you re-enable it with `enable`. The Production environment cannot be disabled.

**Signature**

```bash
celigo environments disable <id>
```

**Arguments**

| Argument | Required | Description                   |
| -------- | -------- | ----------------------------- |
| `<id>`   | Yes      | Environment `_id` to disable. |

**Flags**

None beyond the [global flags](/cli/getting-started/global-flags.md). Blocked in `read` mode.

**Example**

```bash
celigo environments disable 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PUT /v1/environments/{_id}/enable`](https://developer.celigo.com/api/api-reference/environments) (operationId: `toggleEnvironment`)

***

## Gotchas

* **No `delete` subcommand.** There is no public delete endpoint for environments. Delete environments through the UI, which warns about the downstream cascade (connections, flows, integrations) before the operation proceeds.
* **Toggle `enabled` with `enable`/`disable`, not `set`/`update`.** The `enabled` flag is managed through the dedicated [`enable`](#celigo-environments-enable) / [`disable`](#celigo-environments-disable) subcommands; including it in a `create`/`update`/`set` body is ignored. `_envUserId` is likewise system-managed and read-only.
* **APIM metadata is usually provisioned for you.** The `apim.environmentId`, `apim.environmentHRID`, and `apim.groupId` fields are normally populated by API-management workflows. Only set them if you are explicitly configuring APIM for this environment.
* **Resources don't cross environments.** A flow can reference only the connections, exports, imports, and scripts that live in the same environment — keep every resource aligned with its environment.

## Related

* [integrations](/cli/commands/integrations.md) — integrations live inside a single environment.
* [connections](/cli/commands/connections.md) — connections belong to one environment and can only be used by resources in that same environment.
* [stacks](/cli/commands/stacks.md) — reusable execution environments for NetSuite/custom JavaScript; a separate concept despite the overlapping terminology.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/cli/commands/environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
