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

# `disk` CLI

> Reference for the Node CLI that creates disks, runs `disk exec`, and manages API keys.

The [`disk`](https://www.npmjs.com/package/disk) npm package ships a CLI under the same name. Run it with `npx disk` from any machine that has Node — no install required, no platform restrictions. Use it to create disks, list and inspect them, manage who can mount them, and run [serverless commands](/compute/serverless-execution) against the data — all from a script, CI job, or your terminal. For a step-by-step walkthrough, see the [Quickstart](/getting-started/quickstart).

```bash theme={null}
npx disk <command> [options]
```

`disk` talks to the Archil control plane over HTTPS. It has no native dependencies and works on any platform Node.js does. This page is a reference for every command it accepts; for a walkthrough, see the [Quickstart](/getting-started/quickstart).

## Authentication

`disk` reads credentials from environment variables or flags:

|         | Env var          | Flag              |
| ------- | ---------------- | ----------------- |
| API key | `ARCHIL_API_KEY` | `-k`, `--api-key` |
| Region  | `ARCHIL_REGION`  | `-r`, `--region`  |

API keys are account-level credentials. They are **not** the same as disk tokens — see the [disk users concept page](/concepts/disk-users#disk-token-authorization).

## Disks

### `disk list`

List the disks in the current region.

```bash theme={null}
npx disk list [--limit <n>] [-o table|json]
```

Outputs a box-drawing table by default; `-o json` emits an array suitable for piping into `jq`.

### `disk get <id>`

Show details for a disk: status, region, mounts, authorized users, connected clients.

```bash theme={null}
npx disk get dsk-abc123 [-o table|json]
```

### `disk create <name>`

Create a new disk. The response includes a one-time **disk token** for mounting — save it; it cannot be retrieved again.

```bash theme={null}
npx disk create my-disk
```

### `disk delete <id>`

Delete a disk. This does not delete the underlying bucket data.

```bash theme={null}
npx disk delete dsk-abc123
```

### `disk exec <id> <command...>`

Run a bash command inside a container with the disk mounted. Stdout, stderr, and the exit code from the remote command are forwarded back. See [Serverless Execution](/compute/serverless-execution) for the full model.

```bash theme={null}
npx disk exec dsk-abc123 "ls -la /mnt && cat /mnt/config.json"
```

`disk` also accepts the sugar form `disk <id> exec <cmd...>` for ergonomics:

```bash theme={null}
npx disk dsk-abc123 exec "du -sh logs"
```

The CLI process exits with the remote command's exit code, so it composes naturally with shell pipelines and CI step outcomes.

## API keys

API keys live at the account level. Manage them with the `api-keys` subcommand.

### `disk api-keys list`

```bash theme={null}
npx disk api-keys list [--limit <n>]
```

### `disk api-keys create <name>`

```bash theme={null}
npx disk api-keys create ci-bot --description "GitHub Actions"
```

The key value is shown once at create time. Save it.

### `disk api-keys delete <id>`

```bash theme={null}
npx disk api-keys delete key-abc123
```

## Global options

```bash theme={null}
npx disk --help
npx disk --version

# Override credentials per-invocation rather than using env vars
npx disk --api-key key-... --region aws-us-east-1 list

# Point at a non-production control plane
npx disk --base-url https://staging.archil.com list
```
