> For AI agents: the complete documentation index is available at https://enclo.nstlopez.com/llms.txt, the full documentation bundle is available at https://enclo.nstlopez.com/llms-full.txt.

# CLI

`enclo help` prints this summary:

```text
enclo new [--cpus N] [--memory MIB] [--from ID] [--idle-timeout DUR]
          [--name NAME] [--no-network]
enclo exec ID [--timeout SECS] [--cwd DIR] [--env K=V]... COMMAND
enclo run [--cpus N] [--memory MIB] [--no-network] [--timeout SECS]
          [--push DIR] COMMAND
enclo push ID DIR [DEST] [--exclude PATTERN]... [--no-ignore]
enclo pull ID PATH [DEST]
enclo kill ID [EXEC | --all]
enclo prune [--older-than DAYS] [--dry-run]
enclo config [get KEY | set KEY VALUE | unset KEY]
enclo stop ID... | --all [--grace SECS]
enclo ls
enclo rm ID... | --all [--force]
enclo doctor
enclo setup [claude-code|codex] [--print] [--remove]
enclo mcp
enclo version | help
```

- `ID` is a sandbox ID (such as `sb_k3m9x2pq`), a sandbox name, or `current`
  for the last one.
- `COMMAND` is either a single string run as `sh -c COMMAND` or separate
  arguments after `--`.
- `DUR` is a bare number of seconds or a duration ending in `s`, `m`, `h`, or
  `d`. `0` disables the timeout.

## Sandboxes

| Command       | What it does                                                                                                                                                                                        |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enclo new`   | Creates a sandbox and prints its ID. `--from ID` clones another sandbox's disk, `--name` assigns a name, `--idle-timeout` sets the idle shutdown delay, and `--no-network` disables internet access |
| `enclo ls`    | Lists all sandboxes                                                                                                                                                                                 |
| `enclo stop`  | Shuts down sandboxes cleanly while keeping their disks. `--grace SECS` sets how long processes get to exit before being killed (up to 600)                                                          |
| `enclo rm`    | Deletes sandboxes and their disks. Refuses sandboxes with running commands unless `--force` is passed                                                                                               |
| `enclo prune` | Deletes unnamed MCP-created sandboxes unused for 14 days (or `--older-than DAYS`). `--dry-run` lists matches without deleting anything                                                              |

## Commands in a sandbox

| Command      | What it does                                                                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enclo exec` | Runs a command in a sandbox, booting it if stopped. `--timeout`, `--cwd`, and `--env K=V` apply to that command                                   |
| `enclo run`  | Creates a temporary sandbox, runs one command, and deletes the sandbox. `--push DIR` copies the directory in first and runs the command inside it |
| `enclo kill` | Terminates a running command (or `--all` of them) while leaving the sandbox running                                                               |

## Files

| Command      | What it does                                                                                                                                                     |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enclo push` | Copies `DIR` into `DEST` (default `/root/<name of DIR>`), skipping files matched by `.gitignore`. `--exclude` adds patterns, and `--no-ignore` copies everything |
| `enclo pull` | Copies `PATH` from the sandbox to `DEST` (default: current directory), with `cp`-like behavior                                                                   |

## Setup and checks

| Command         | What it does                                                                                                                |
| --------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `enclo setup`   | Registers `enclo mcp` with Claude Code and Codex. See [Connect your harness](https://enclo.nstlopez.com/guide/harnesses.md) |
| `enclo doctor`  | Checks the installation and boots a test sandbox                                                                            |
| `enclo config`  | Lists, reads, and updates [configuration](https://enclo.nstlopez.com/reference/configuration.md)                            |
| `enclo mcp`     | Runs the stdio MCP server started by a harness                                                                              |
| `enclo version` | Prints the enclo version                                                                                                    |

## Exit statuses

| Command             | Status                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `exec` and `run`    | The command's exit status, 124 on timeout, or 125 if enclo failed (including invalid arguments) or the sandbox went down |
| Every other command | 0 on success, 1 on failure, 2 on usage error                                                                             |

Interrupting `enclo exec` terminates only that command; the sandbox stays
running along with any other processes inside it. Interrupting `enclo run`
terminates the command and then removes the temporary sandbox.

## JSON output

Every command except `mcp` and `help` accepts `--json` and writes a single JSON
document to stdout. On failure, the last line is:

```json
{"error": "no sandbox is called dev. `enclo ls` lists the ones there are", "error_code": "not_found"}
```

`enclo exec --json --stream` prints JSON lines as output arrives.

## Error codes

| Code                         | Meaning                                                                                      |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| `conflict`                   | Resource is busy (for example, a sandbox is currently stopping). Often safe to retry         |
| `not_found`                  | No sandbox, file, or config key exists with that name                                        |
| `invalid_argument`           | Invalid CLI argument or configuration value                                                  |
| `unavailable`                | The VM failed to boot, went down during the operation, or its guest agent stopped responding |
| `quota_exceeded`             | Too many concurrent commands or connections                                                  |
| `insufficient_storage`       | Not enough disk space on the host or inside the sandbox                                      |
| `image_not_found`            | Guest runtime files are missing                                                              |
| `not_supported`              | Operation is unsupported, or the other side is too old or too new for it                     |
| `unsafe_path`                | An archive entry path was rejected                                                           |
| `internal`                   | Any other error                                                                              |
| `host_full`, `policy_denied` | Reserved                                                                                     |
