# Quickstart

> Let your agent do it: Install Hermitbox on this machine and run a first sandbox. Run `curl -fsSL https://hbx.sh | sh` as my ordinary user, never with sudo, then run `~/.local/bin/hermitbox run -- echo hello`. If I want TypeScript, Python or Rust, install that SDK as shown on the page and run its example; the SDK finds this machine's installation on its own. Never copy a key into a file or this chat. Show me each output. Follow the exact steps in https://docs.hermitbox.dev/v0.3.2/get-started/quickstart.md.

Install Hermitbox, run a first sandbox that prints `hello`, then put a sandbox to sleep and find
its files still there when it wakes.

## Install

Run this on Linux (`x86_64` or `aarch64`) as your own user. It needs no root and no Docker.

```sh
curl -fsSL https://hbx.sh | sh
```

The installer starts Hermitbox and saves its credentials privately, where the CLI, `hermitbox mcp`
and the SDKs find them. New shells find `hermitbox` on `PATH`; in this shell, call
`~/.local/bin/hermitbox`.

## Your first sandbox

### Shell

```sh
~/.local/bin/hermitbox run -- echo hello
```

`hermitbox run` creates a sandbox, runs the command in it, prints `hello` and deletes the
sandbox.

### TypeScript

Install the TypeScript SDK from npm:

```sh
npm install hermitbox
```

```ts
import { Hermitbox } from 'hermitbox'

const hb = new Hermitbox()
const box = await hb.sandbox()
console.log((await box.run('echo hello')).stdout.trim())
await box.delete()
```

### Python

Install the Python SDK from PyPI, on Python 3.12 or later:

```sh
pip install hermitbox
```

```python
from hermitbox import Hermitbox

with Hermitbox() as hb:
    box = hb.sandbox()
    print(box.run('echo hello').stdout.strip())
    box.delete()
```

### Rust

Add the `hermitbox` crate from crates.io and Tokio, on Rust 1.99 or later:

```sh
cargo add hermitbox tokio --features tokio/macros,tokio/rt-multi-thread
```

```rust
use hermitbox::Hermitbox;

#[tokio::main]
async fn main() -> hermitbox::Result<()> {
    let hb = Hermitbox::new()?;
    let sandbox = hb.sandbox().await?;
    println!("{}", sandbox.run("echo hello").await?.stdout.trim());
    sandbox.delete().await?;
    Ok(())
}
```

## Sleep and wake, keeping your files

Sleep stops a sandbox's compute and keeps its data directory. Wake it, and your files are where
you left them:

```ts
import { Hermitbox } from 'hermitbox'

const hb = new Hermitbox()
const box = await hb.sandbox()

try {
  await box.write('notes.txt', 'still here after sleep')
  await box.sleep()
  await box.wake()
  console.log(await box.read('notes.txt'))
} finally {
  await box.delete()
}
```

Output:

```txt
still here after sleep
```

On the machine you installed on, the CLI and SDKs connect by themselves, with no environment
variables. From another machine, set `HERMITBOX_API_URL` and `HERMITBOX_API_KEY`; `hermitbox config
key` prints the saved key.

## Next steps

- [Connect your agent](https://docs.hermitbox.dev/v0.3.2/get-started/agents.md): paste one prompt into your agent, or add `hermitbox mcp` to it
  yourself.
- [TypeScript](https://docs.hermitbox.dev/v0.3.2/get-started/typescript.md), [Python](https://docs.hermitbox.dev/v0.3.2/get-started/python.md), [Rust](https://docs.hermitbox.dev/v0.3.2/get-started/rust.md) and [CLI](https://docs.hermitbox.dev/v0.3.2/get-started/cli.md): snapshots,
  forks, running generated code and shell workflows.
- [Concepts](https://docs.hermitbox.dev/v0.3.2/concepts/sandboxes.md): sandboxes, their lifecycle, isolation tiers and templates.
- [Hosting](https://docs.hermitbox.dev/v0.3.2/hosting.md): run Hermitbox on a server, a platform that runs images, or a
  fleet of machines.
