> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Use common Archal commands for setup, sandbox lifecycle, samples, state, usage, and MCP.

```bash theme={null}
npm install --global archal@0.11.0
archal login
archal doctor
```

## Discover environments and samples

```bash theme={null}
archal environment list
archal environment describe github

archal sample list
archal sample list github
archal sample show github.small-project.v1
archal sample show github.small-project.v1 --raw
```

`sample show --raw` prints only the verified JSON or SQL artifact. `--state`
prints a metadata wrapper plus parsed state and should not be redirected into
state commands.

## Control a sandbox

```bash theme={null}
archal session list
archal session create github slack
archal session status <session-id>
archal session wait <session-id> --until ready
archal session renew <session-id> --ttl 1800
archal session reset <session-id>
archal session destroy <session-id>
```

Creation accepts one or more `--state environment=path` options. Add `--detach`
to create or destroy when the caller should return after durable acceptance.
The CLI generates an idempotency key for each create unless you provide one
for a deliberate retry of the exact same request.

## Inspect state

```bash theme={null}
archal state validate github github-state.json
archal state get <session-id> github
archal state load <session-id> github github-state.json
archal state diff <session-id> github --before github-before.json
```

`state load` and `session reset` overwrite state. Use them only with explicit
approval or in a deliberately disposable CI sandbox.

## Account and connection

```bash theme={null}
archal connect
archal logout
```

## Diagnose and monitor usage

```bash theme={null}
archal config
archal doctor --session <session-id>
archal usage
```

## Skills and MCP

```bash theme={null}
archal init --target codex
archal skills export --format markdown
archal skills export --format agents --output .
archal mcp
```
