# Connect the CLI

> Let your agent do it: Connect the Hermitbox CLI and prove it works. Install the CLI with the one-command installer as my ordinary user, never with sudo, if it isn't installed. Export `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in the shell's private environment, and `HERMITBOX_IMAGE=alpine:3.22` only if the install defaults to `container`. Never copy the key into a file or this chat. Run the page's block, which prints hello and removes its sandbox, and show me the output. Follow the exact steps in https://docs.hermitbox.dev/v0.2.4/get-started/cli.md.

Run a one-shot command in a sandbox from your shell with the Hermitbox CLI.

1. Install the CLI with the [one-command installer](https://docs.hermitbox.dev/v0.2.4/get-started/install.md).
2. Export `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` privately. If your install defaults to
   `container`, also export `HERMITBOX_IMAGE=alpine:3.22`; leave `HERMITBOX_IMAGE` unset for
   `process` or `wasm`.
3. Run this block. It prints hello and removes its sandbox.

```sh
# A container host needs an image; process and Wasm hosts must not get one.
if [ -n "${HERMITBOX_IMAGE:-}" ]; then
  hermitbox run --image "$HERMITBOX_IMAGE" -- echo hello
else
  hermitbox run -- echo hello
fi
```

Images need the container tier and its engine. Process and Wasm refuse them, and the block keeps
that refusal.

A server install's welcome page also prints an exact block for its configured tier. See
[host boundaries](https://docs.hermitbox.dev/v0.2.4/hosting.md#tiers-and-guarantees).
