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

# ephemera

> Every command of the CLI, exactly as its help prints it.

`ephemera help` prints:

```text theme={"theme":"css-variables"}
ephemera runs commands in short-lived, locked-down sandboxes.

Usage:
  ephemera run [flags] -- <command> [args...]
  ephemera dev [flags] [-p PORT]... -- <dev server command>
  ephemera routes                   dev sessions sharing ports, and their addresses
  ephemera focus <session>          make plain localhost show that session
  ephemera ls [--json]
  ephemera usage                    sandbox-minutes used today and this token's limits
  ephemera rm <sandbox>...          destroy sandboxes, by name or id
  ephemera verify [<sandbox>]        check a sandbox's signed record: by name, id or file; the newest if none
  ephemera mcp [--dir DIR]          serve ephemera to a coding agent over MCP
  ephemera login [--server URL]
  ephemera logout
  ephemera hosts                    the account's hosts, and the keys this CLI has pinned
  ephemera trust <host>             pin a host's current key, after it was rebuilt or re-joined
  ephemera doctor [--json]          why the CLI can't reach the server or a host
  ephemera version

Environment (overrides the saved login):
  EPHEMERA_SERVER   central server URL (default https://api.ephemera.run)
  EPHEMERA_TOKEN    API token
  EPHEMERA_CONFIG   where the login is saved; pinned host keys go next to it
  EPHEMERA_STRICT_HOSTS=1  refuse hosts not pinned yet, instead of pinning them

Run "ephemera run -h" or "ephemera dev -h" for their flags.
```

Flags take one dash or two: `-net` and `--net` are the same. Everything after `--` is the command to run.

## ephemera run

Run one command in a fresh sandbox, then destroy it. See [Run commands](/docs/guides/run.md).

```text theme={"theme":"css-variables"}
Usage: ephemera run [flags] -- <command> [args...]

Flags:
  -allow value
    	allow outbound access to a host: example.com, *.example.com, host:port (repeatable)
  -cpus float
    	CPU limit, e.g. 2 or 0.5 (default: no limit)
  -dir string
    	worktree to sync (default ".")
  -env value
    	set an environment variable, KEY=VALUE (repeatable)
  -image string
    	sandbox image (default: the host's default)
  -include value
    	send an ignored file anyway, e.g. .env.local (repeatable)
  -json
    	print newline-delimited JSON events instead of raw output
  -memory int
    	memory limit in MB (default: no limit)
  -name string
    	name the sandbox for what it's for, e.g. api-tests: lowercase letters, digits and hyphens (default: one like amber-dune-42); dev: also the session name for shared ports (default: the git branch)
  -net
    	allow outbound access to any public host (blocked by default; still logged)
  -record string
    	save the sandbox's signed record here (default: the records directory)
  -setup string
    	prepare the sandbox first, e.g. "npm ci"; the result is snapshotted and later runs skip it
  -setup-input value
    	a file setup depends on, beyond the usual lockfiles (repeatable)
  -timeout duration
    	run: stop the command after this long (exit code 124); dev: destroy the sandbox after this long. e.g. 10m
```

## ephemera dev

Run a dev server in a sandbox that stays up, with ports forwarded and edits synced. See [Dev servers](/docs/guides/dev.md).

```text theme={"theme":"css-variables"}
Usage: ephemera dev [flags] -- <command> [args...]

Flags:
  -allow value
    	allow outbound access to a host: example.com, *.example.com, host:port (repeatable)
  -cpus float
    	CPU limit, e.g. 2 or 0.5 (default: no limit)
  -dir string
    	worktree to sync (default ".")
  -env value
    	set an environment variable, KEY=VALUE (repeatable)
  -image string
    	sandbox image (default: the host's default)
  -include value
    	send an ignored file anyway, e.g. .env.local (repeatable)
  -json
    	print newline-delimited JSON events instead of raw output
  -memory int
    	memory limit in MB (default: no limit)
  -name string
    	name the sandbox for what it's for, e.g. api-tests: lowercase letters, digits and hyphens (default: one like amber-dune-42); dev: also the session name for shared ports (default: the git branch)
  -net
    	allow outbound access to any public host (blocked by default; still logged)
  -p value
    	forward a port: PORT is shared by session at http://<name>.localhost:PORT; LOCAL:SANDBOX binds LOCAL for this session only (repeatable)
  -record string
    	save the sandbox's signed record here (default: the records directory)
  -setup string
    	prepare the sandbox first, e.g. "npm ci"; the result is snapshotted and later runs skip it
  -setup-input value
    	a file setup depends on, beyond the usual lockfiles (repeatable)
  -timeout duration
    	run: stop the command after this long (exit code 124); dev: destroy the sandbox after this long. e.g. 10m
```

## ephemera login

Sign this machine in. See [Quickstart](/docs/quickstart.md) and [Tokens and CI](/docs/guides/tokens.md).

```text theme={"theme":"css-variables"}
Usage: ephemera login [--server URL] [--with-token]

In a terminal, signs this machine in through the browser: it shows a code,
opens the approval page, and saves the token once you approve. With
--with-token, piped input, or a server without browser sign-in, it reads
an API token instead (made with ephemera-server token create <name>, or
in the dashboard).

Flags:
  -server string
    	central server URL (default "https://api.ephemera.run")
  -with-token
    	read an API token from stdin instead of signing in through the browser
```

## ephemera doctor

Say why the CLI can't reach the server or a host. See [Troubleshooting](/docs/guides/troubleshooting.md).

```text theme={"theme":"css-variables"}
Usage: ephemera doctor [--json]

Checks the login, the central server, the token and the hosts, and
says how to fix the first thing that fails.

Flags:
  -json
    	print the checks as JSON
```

## ephemera mcp

Serve ephemera to a coding agent over MCP, on stdin and stdout. See [Coding agents](/docs/guides/agents.md).

```text theme={"theme":"css-variables"}
Usage of mcp:
  -dir string
    	worktree that run_command syncs by default (default ".")
```

## ephemera ls

List the account's running sandboxes, by name.

```text theme={"theme":"css-variables"}
Usage of ls:
  -json
    	print JSON
```

```text theme={"theme":"css-variables"}
NAME           ID                    HOST   NETWORK  AGE
api-tests      sbx_09459d27f28c808c  lab-1  none     12s
amber-dune-42  sbx_b5268cedc2cec984  lab-1  allow    3m4s
```

## ephemera routes

List dev sessions sharing local ports, and their addresses.

```text theme={"theme":"css-variables"}
ephemera routes
```

## ephemera focus

Make plain `localhost:PORT` show one session.

```text theme={"theme":"css-variables"}
ephemera focus <session>
```

## ephemera usage

Show sandbox-minutes used today, and this token's limits.

```text theme={"theme":"css-variables"}
ephemera usage
```

## ephemera rm

Destroy sandboxes by name or id.

```text theme={"theme":"css-variables"}
ephemera rm <sandbox>...
```

## ephemera verify

Check a signed record and print what the sandbox did. See [Signed records](/docs/guides/records.md).

```text theme={"theme":"css-variables"}
ephemera verify [<name> | <id> | <record.json>]
```

A name checks that name's newest record, an id that sandbox's record, and a path that file. With nothing, it checks the newest record of all. Records are looked up in the records folder on this machine. Exit 1 if the record isn't fully verified.

## ephemera hosts

List the account's hosts: whether each is online, when an offline one was last seen, its key, and whether this CLI has pinned it.

```text theme={"theme":"css-variables"}
ephemera hosts
```

## ephemera trust

Pin a host's current key, after you rebuilt it or joined it again. See [Hosts](/docs/guides/hosts.md#keys-and-pinning).

```text theme={"theme":"css-variables"}
ephemera trust <host>
```

## ephemera logout

Remove the saved login from this machine. The token still works until it's revoked.

```text theme={"theme":"css-variables"}
ephemera logout
```

## ephemera version

Print the version.

```text theme={"theme":"css-variables"}
ephemera version
```

## Exit codes

| Code | Meaning |
| - | - |
| 0 | Success; for `run`, the command exited 0 |
| The command's own | `run`: the command's exit code, passed through |
| 124 | `run`: `--timeout` stopped the command |
| 125 | ephemera itself failed |
| 1 | `doctor`: a check failed |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.