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

# Runloop CLI

> Explore, experiment with, and test the Runloop API using the Runloop CLI.

The Runloop CLI (`rli`) provides both an interactive terminal UI and traditional CLI commands for managing your Runloop resources.

> [card] [npm Package](https://www.npmjs.com/package/@runloop/rl-cli)
>
> @runloop/rl-cli

> [card] [GitHub Repository](https://github.com/runloopai/rl-cli)
>
> runloopai/rl-cli

## Installation

```bash npm theme={null}
npm install -g @runloop/rl-cli
```

```bash yarn theme={null}
yarn global add @runloop/rl-cli
```

```bash pnpm theme={null}
pnpm add -g @runloop/rl-cli
```

## Setup

Configure your API key:

```bash theme={null}
export RUNLOOP_API_KEY=your_api_key_here
```

> [!TIP]
>
> Get your API key from the [Settings page](https://platform.runloop.ai/settings#api-keys) in the Runloop Dashboard.

## Quick Start

> [tab] Interactive Mode
>
> Launch the interactive UI with a beautiful terminal interface:
>
> ```bash theme={null}
> rli
> ```
>
> Navigate with arrow keys, select with Enter, and manage all your resources visually.
>
> ![Runloop CLI Interactive Mode](https://raw.githubusercontent.com/runloopai/rl-cli/main/misc/demo.gif)
>
> ### Search Devboxes
>
> Press `/` to search and filter through your devboxes by name or ID.
>
> ![Search devboxes in interactive mode](https://raw.githubusercontent.com/runloopai/rl-cli/main/misc/rli-demo-search.gif)
>
> ### SSH to Devbox
>
> From the interactive menu, select a devbox and choose **SSH** to open a secure shell session directly into your devbox. The CLI handles all the SSH key setup and connection details automatically.
>
> ![SSH into a Devbox](https://raw.githubusercontent.com/runloopai/rl-cli/main/misc/rli-ssh-demo.gif)

> [tab] CLI Mode
>
> Use traditional commands for scripting and automation:
>
> ```bash theme={null}
> # List all devboxes
> rli devbox list --output json
> ```
>
> ```json Example Output theme={null}
> [
>   {
>     "id": "dbx_1234567890",
>     "name": "my-devbox",
>     "status": "running",
>     "blueprint_id": "bpt_abcdef"
>   }
> ]
> ```
>
> ```bash theme={null}
> # Create a new devbox
> rli devbox create --name my-devbox --blueprint my-blueprint
> ```
>
> ```text Example Output theme={null}
> dbx_1234567890
> ```
>
> ```bash theme={null}
> # Execute a command in a devbox
> rli devbox exec dbx_1234567890 echo "Hello World"
> ```
>
> ```text Example Output theme={null}
> Hello World
> ```
>
> ```bash theme={null}
> # SSH into a devbox
> rli devbox ssh dbx_1234567890
> ```

## Command Groups

> [card] [Devbox](#devbox-commands)
>
> Create, manage, and interact with devboxes

> [card] [Snapshot](#snapshot-commands)
>
> Create and manage devbox snapshots

> [card] [Blueprint](#blueprint-commands)
>
> Manage reusable devbox templates

> [card] [Object](#object-commands)
>
> Upload and manage file objects

## Command Reference

### Devbox Commands

> [accordion] create
>
> Create a new devbox
>
> ```bash theme={null}
> rli devbox create
> ```
>
> **name** `string`
>
> Devbox name
>
> **template** `string`
>
> Snapshot ID to use (alias: --snapshot)
>
> **snapshot** `string`
>
> Snapshot ID to use
>
> **blueprint** `string`
>
> Blueprint name or ID to use
>
> **resources** `string`
>
> Resource size (X\_SMALL, SMALL, MEDIUM, LARGE, X\_LARGE, XX\_LARGE)
>
> **architecture** `string`
>
> Architecture (arm64, x86\_64)
>
> **entrypoint** `string`
>
> Entrypoint command to run
>
> **launch-commands** `string[]`
>
> Initialization commands to run on startup
>
> **env-vars** `string[]`
>
> Environment variables (format: KEY=value)
>
> **secrets** `string[]`
>
> Secrets to inject as environment variables (format: ENV\_VAR=SECRET\_NAME)
>
> **code-mounts** `string[]`
>
> Code mount configurations (JSON format)
>
> **idle-time** `string`
>
> Idle time in seconds before idle action
>
> **idle-action** `string`
>
> Action on idle (shutdown, suspend)
>
> **available-ports** `string[]`
>
> Available ports
>
> **root** `boolean`
>
> Run as root
>
> **user** `string`
>
> Run as this user (format: username:uid)
>
> **network-policy** `string`
>
> Network policy ID to apply
>
> **tunnel** `string`
>
> Tunnel authentication mode (open, authenticated)
>
> **gateways** `string[]`
>
> Gateway configurations (format: ENV\_PREFIX=gateway\_id\_or\_name,secret\_id\_or\_name)
>
> **mcp** `string[]`
>
> MCP configurations (format: ENV\_VAR\_NAME=mcp\_config\_id\_or\_name,secret\_id\_or\_name)

> [accordion] list
>
> List all devboxes
>
> ```bash theme={null}
> rli devbox list
> ```
>
> **status** `string`
>
> Filter by status (initializing, running, suspending, suspended, resuming, failure, shutdown)
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] delete
>
> Shutdown a devbox
>
> ```bash theme={null}
> rli devbox delete <id>
> ```

> [accordion] exec
>
> Execute a command in a devbox
>
> ```bash theme={null}
> rli devbox exec <id> <command...>
> ```
>
> **shell-name** `string`
>
> Shell name to use (optional)

> [accordion] upload
>
> Upload a file to a devbox
>
> ```bash theme={null}
> rli devbox upload <id> <file>
> ```
>
> **path** `string`
>
> Target path in devbox

> [accordion] get
>
> Get devbox details
>
> ```bash theme={null}
> rli devbox get <id>
> ```

> [accordion] suspend
>
> Suspend a devbox
>
> ```bash theme={null}
> rli devbox suspend <id>
> ```

> [accordion] resume
>
> Resume a suspended devbox
>
> ```bash theme={null}
> rli devbox resume <id>
> ```

> [accordion] shutdown
>
> Shutdown a devbox
>
> ```bash theme={null}
> rli devbox shutdown <id>
> ```

> [accordion] ssh
>
> SSH into a devbox
>
> ```bash theme={null}
> rli devbox ssh <id>
> ```
>
> **config-only** `boolean`
>
> Print SSH config only
>
> **no-wait** `boolean`
>
> Do not wait for devbox to be ready
>
> **timeout** `string` (default: 180)
>
> Timeout in seconds to wait for readiness
>
> **poll-interval** `string` (default: 3)
>
> Polling interval in seconds while waiting

> [accordion] scp
>
> Copy files to/from a devbox using scp (e.g. rli devbox scp dbx\_id:/remote ./local)
>
> ```bash theme={null}
> rli devbox scp <src> <dst>
> ```
>
> **scp-options** `string`
>
> Additional scp options (quoted)

> [accordion] rsync
>
> Sync files to/from a devbox using rsync (e.g. rli devbox rsync dbx\_id:/remote ./local)
>
> ```bash theme={null}
> rli devbox rsync <src> <dst>
> ```
>
> **rsync-options** `string`
>
> Additional rsync options (quoted)

> [accordion] tunnel
>
> Create a port-forwarding tunnel to a devbox
>
> ```bash theme={null}
> rli devbox tunnel <id> <ports>
> ```
>
> **open** `boolean`
>
> Open the tunnel URL in browser automatically

> [accordion] read
>
> Read a file from a devbox using the API
>
> ```bash theme={null}
> rli devbox read <id>
> ```
>
> **remote** `string`
>
> Remote file path to read from the devbox

> [accordion] write
>
> Write a file to a devbox using the API
>
> ```bash theme={null}
> rli devbox write <id>
> ```
>
> **input** `string`
>
> Local file path to read contents from
>
> **remote** `string`
>
> Remote file path to write to on the devbox

> [accordion] download
>
> Download a file from a devbox
>
> ```bash theme={null}
> rli devbox download <id>
> ```
>
> **file-path** `string`
>
> Path to the file in the devbox

> [accordion] exec-async
>
> Execute a command asynchronously on a devbox
>
> ```bash theme={null}
> rli devbox exec-async <id> <command...>
> ```
>
> **shell-name** `string`
>
> Shell name to use (optional)

> [accordion] get-async
>
> Get status of an async execution
>
> ```bash theme={null}
> rli devbox get-async <id> <execution-id>
> ```

> [accordion] send-stdin
>
> Send stdin to a running async execution
>
> ```bash theme={null}
> rli devbox send-stdin <id> <execution-id>
> ```
>
> **text** `string`
>
> Text content to send to stdin
>
> **signal** `string`
>
> Signal to send (EOF, INTERRUPT)

> [accordion] logs
>
> View devbox logs
>
> ```bash theme={null}
> rli devbox logs <id>
> ```

### Snapshot Commands

> [accordion] list
>
> List all snapshots
>
> ```bash theme={null}
> rli snapshot list
> ```
>
> **devbox** `string`
>
> Filter by devbox ID
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] create
>
> Create a snapshot of a devbox
>
> ```bash theme={null}
> rli snapshot create <devbox-id>
> ```
>
> **name** `string`
>
> Snapshot name

> [accordion] delete
>
> Delete a snapshot
>
> ```bash theme={null}
> rli snapshot delete <id>
> ```

> [accordion] get
>
> Get snapshot details
>
> ```bash theme={null}
> rli snapshot get <id>
> ```

> [accordion] prune
>
> Delete old snapshots for a devbox, keeping only recent ready ones
>
> ```bash theme={null}
> rli snapshot prune <devbox-id>
> ```
>
> **dry-run** `boolean`
>
> Show what would be deleted without actually deleting
>
> **yes** `boolean`
>
> Skip confirmation prompt
>
> **keep** `string` (default: 1)
>
> Number of ready snapshots to keep

> [accordion] status
>
> Get snapshot operation status
>
> ```bash theme={null}
> rli snapshot status <snapshot-id>
> ```

### Blueprint Commands

> [accordion] list
>
> List all blueprints
>
> ```bash theme={null}
> rli blueprint list
> ```
>
> **name** `string`
>
> Filter by blueprint name
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] create
>
> Create a new blueprint
>
> ```bash theme={null}
> rli blueprint create
> ```
>
> **name** `string` *required*
>
> Blueprint name (required)
>
> **dockerfile** `string`
>
> Dockerfile contents
>
> **dockerfile-path** `string`
>
> Dockerfile path
>
> **system-setup-commands** `string[]`
>
> System setup commands
>
> **resources** `string`
>
> Resource size (X\_SMALL, SMALL, MEDIUM, LARGE, X\_LARGE, XX\_LARGE)
>
> **architecture** `string`
>
> Architecture (arm64, x86\_64)
>
> **available-ports** `string[]`
>
> Available ports
>
> **root** `boolean`
>
> Run as root
>
> **user** `string`
>
> Run as this user (format: username:uid)
>
> **metadata** `string[]`
>
> Metadata tags (format: key=value)

> [accordion] get
>
> Get blueprint details by name or ID (IDs start with bpt\_)
>
> ```bash theme={null}
> rli blueprint get <name-or-id>
> ```

> [accordion] logs
>
> Get blueprint build logs by name or ID (IDs start with bpt\_)
>
> ```bash theme={null}
> rli blueprint logs <name-or-id>
> ```

> [accordion] delete
>
> Delete a blueprint by ID
>
> ```bash theme={null}
> rli blueprint delete <id>
> ```

> [accordion] prune
>
> Delete old blueprint builds, keeping only recent successful ones
>
> ```bash theme={null}
> rli blueprint prune <name>
> ```
>
> **dry-run** `boolean`
>
> Show what would be deleted without actually deleting
>
> **yes** `boolean`
>
> Skip confirmation prompt
>
> **keep** `string` (default: 1)
>
> Number of successful builds to keep

> [accordion] from-dockerfile
>
> Create a blueprint from a Dockerfile with build context support
>
> ```bash theme={null}
> rli blueprint from-dockerfile
> ```
>
> **name** `string` *required*
>
> Blueprint name (required)
>
> **build-context** `string`
>
> Build context directory (default: current directory)
>
> **dockerfile** `string`
>
> Dockerfile path (default: Dockerfile in build context)
>
> **system-setup-commands** `string[]`
>
> System setup commands
>
> **resources** `string`
>
> Resource size (X\_SMALL, SMALL, MEDIUM, LARGE, X\_LARGE, XX\_LARGE)
>
> **architecture** `string`
>
> Architecture (arm64, x86\_64)
>
> **available-ports** `string[]`
>
> Available ports
>
> **root** `boolean`
>
> Run as root
>
> **user** `string`
>
> Run as this user (format: username:uid)
>
> **metadata** `string[]`
>
> Metadata tags (format: key=value)
>
> **ttl** `string`
>
> TTL in seconds for the build context object (default: 3600)

### Object Commands

> [accordion] list
>
> List objects
>
> ```bash theme={null}
> rli object list
> ```
>
> **limit** `string` (default: 20)
>
> Max results
>
> **starting-after** `string`
>
> Starting point for pagination
>
> **name** `string`
>
> Filter by name (partial match supported)
>
> **content-type** `string`
>
> Filter by content type
>
> **state** `string`
>
> Filter by state (UPLOADING, READ\_ONLY, DELETED)
>
> **search** `string`
>
> Search by object ID or name
>
> **public** `boolean`
>
> List public objects only

> [accordion] get
>
> Get object details
>
> ```bash theme={null}
> rli object get <id>
> ```

> [accordion] download
>
> Download object to local file
>
> ```bash theme={null}
> rli object download <id> <path>
> ```
>
> **extract** `boolean`
>
> Extract downloaded archive after download
>
> **duration-seconds** `string` (default: 3600)
>
> Duration in seconds for the presigned URL validity

> [accordion] upload
>
> Upload a file as an object
>
> ```bash theme={null}
> rli object upload <path>
> ```
>
> **name** `string`
>
> Object name (required)
>
> **content-type** `string`
>
> Content type: unspecified|text|binary|gzip|tar|tgz
>
> **public** `boolean`
>
> Make object publicly accessible

> [accordion] delete
>
> Delete an object (irreversible)
>
> ```bash theme={null}
> rli object delete <id>
> ```

### Network-policy Commands

> [accordion] list
>
> List network policies
>
> ```bash theme={null}
> rli network-policy list
> ```
>
> **limit** `string` (default: 20)
>
> Max results
>
> **starting-after** `string`
>
> Starting point for pagination
>
> **name** `string`
>
> Filter by name

> [accordion] get
>
> Get network policy details
>
> ```bash theme={null}
> rli network-policy get <id>
> ```

> [accordion] create
>
> Create a new network policy
>
> ```bash theme={null}
> rli network-policy create
> ```
>
> **name** `string` *required*
>
> Policy name (required)
>
> **description** `string`
>
> Policy description
>
> **allow-all** `boolean`
>
> Allow all egress traffic
>
> **allow-devbox-to-devbox** `boolean`
>
> Allow devbox-to-devbox communication
>
> **allow-agent-gateway** `boolean`
>
> Allow Agent gateway access
>
> **allow-mcp-gateway** `boolean`
>
> Allow MCP gateway access
>
> **allowed-hostnames** `string[]`
>
> List of allowed hostnames for egress

> [accordion] delete
>
> Delete a network policy
>
> ```bash theme={null}
> rli network-policy delete <id>
> ```

### Secret Commands

> [accordion] create
>
> Create a new secret. Value can be piped via stdin (e.g., echo 'val' | rli secret create name) or entered interactively with masked input for security.
>
> ```bash theme={null}
> rli secret create <name>
> ```

> [accordion] list
>
> List all secrets
>
> ```bash theme={null}
> rli secret list
> ```
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] get
>
> Get secret metadata by name
>
> ```bash theme={null}
> rli secret get <name>
> ```

> [accordion] update
>
> Update a secret value (value from stdin or secure prompt)
>
> ```bash theme={null}
> rli secret update <name>
> ```

> [accordion] delete
>
> Delete a secret
>
> ```bash theme={null}
> rli secret delete <name>
> ```
>
> **yes** `boolean`
>
> Skip confirmation prompt

### Gateway-config Commands

> [accordion] list
>
> List gateway configurations
>
> ```bash theme={null}
> rli gateway-config list
> ```
>
> **name** `string`
>
> Filter by name
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] create
>
> Create a new gateway configuration
>
> ```bash theme={null}
> rli gateway-config create
> ```
>
> **name** `string` *required*
>
> Gateway config name (required)
>
> **endpoint** `string` *required*
>
> Target endpoint URL (required)
>
> **bearer-auth** `boolean`
>
> Use Bearer token authentication (default)
>
> **header-auth** `string`
>
> Use custom header authentication (specify header key name)
>
> **description** `string`
>
> Description

> [accordion] get
>
> Get gateway configuration details
>
> ```bash theme={null}
> rli gateway-config get <id>
> ```

> [accordion] update
>
> Update a gateway configuration
>
> ```bash theme={null}
> rli gateway-config update <id>
> ```
>
> **name** `string`
>
> New name
>
> **endpoint** `string`
>
> New endpoint URL
>
> **bearer-auth** `boolean`
>
> Use Bearer token authentication
>
> **header-auth** `string`
>
> Use custom header authentication (specify header key name)
>
> **description** `string`
>
> New description

> [accordion] delete
>
> Delete a gateway configuration
>
> ```bash theme={null}
> rli gateway-config delete <id>
> ```

### Mcp-config Commands

> [accordion] list
>
> List MCP configurations
>
> ```bash theme={null}
> rli mcp-config list
> ```
>
> **name** `string`
>
> Filter by name
>
> **limit** `string` (default: 20)
>
> Max results

> [accordion] create
>
> Create a new MCP configuration
>
> ```bash theme={null}
> rli mcp-config create
> ```
>
> **name** `string` *required*
>
> MCP config name (required)
>
> **endpoint** `string` *required*
>
> Target endpoint URL (required)
>
> **allowed-tools** `string` *required*
>
> Allowed tool patterns, comma-separated (required, e.g. '*' or 'github.search\_*,github.get\_\*')
>
> **description** `string`
>
> Description

> [accordion] get
>
> Get MCP configuration details
>
> ```bash theme={null}
> rli mcp-config get <id>
> ```

> [accordion] update
>
> Update an MCP configuration
>
> ```bash theme={null}
> rli mcp-config update <id>
> ```
>
> **name** `string`
>
> New name
>
> **endpoint** `string`
>
> New endpoint URL
>
> **allowed-tools** `string`
>
> New allowed tool patterns, comma-separated
>
> **description** `string`
>
> New description

> [accordion] delete
>
> Delete an MCP configuration
>
> ```bash theme={null}
> rli mcp-config delete <id>
> ```

### Mcp Commands

> [accordion] start
>
> Start the MCP server
>
> ```bash theme={null}
> rli mcp start
> ```
>
> **http** `boolean`
>
> Use HTTP/SSE transport instead of stdio
>
> **port** `string`
>
> Port to listen on for HTTP mode (default: 3000)

> [accordion] install
>
> Install Runloop MCP server configuration in Claude Desktop
>
> ```bash theme={null}
> rli mcp install
> ```

## MCP Server (AI Integration)

> [!NOTE]
>
> The CLI includes a Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with your devboxes.

### Quick Setup for Claude Desktop

```bash theme={null}
# Install MCP configuration
rli mcp install
```

After installation, restart Claude Desktop and ask Claude to "List my devboxes" or "Create a new devbox".

### Server Modes

> [tab] Stdio (Claude Desktop)
>
> ```bash theme={null}
> rli mcp start
> ```
>
> Standard input/output mode for Claude Desktop integration.

> [tab] HTTP (Web/Remote)
>
> ```bash theme={null}
> rli mcp start --http
> rli mcp start --http --port 8080
> ```
>
> HTTP/SSE mode for web applications and remote access.

## Output Formats

All commands support multiple output formats via the `--output` flag:

**--output json** `flag`

JSON output for programmatic parsing

**--output yaml** `flag`

YAML output for configuration files

**--output text** `flag`

Plain text output for human readability

```bash theme={null}
rli devbox list --output json
rli devbox list --output yaml
rli devbox list --output text
```

## Contributing

The Runloop CLI is open-source. We welcome contributions!

> [card] [GitHub Repository](https://github.com/runloopai/rl-cli)
>
> View source code and submit PRs

> [card] [Report Issues](https://github.com/runloopai/rl-cli/issues)
>
> Report bugs or request features


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