This page provides a complete reference for all available Vercel Sandbox CLI commands. The Sandbox CLI, based on the Docker CLI, allows you to manage sandboxes, execute commands, copy files, and more from the command line.
Get help information for all available sandbox commands:
Description: Interfacing with Vercel Sandbox
Available subcommands:
list: List all sandboxes for the specified account and project. [alias: ls]
create: Create a sandbox in the specified account and project.
copy: Copy files between your local filesystem and a remote sandbox [alias: cp]
exec: Execute a command in an existing sandbox
stop: Stop one or more running sandboxes [aliases: rm, remove]
run: Create and run a command in a sandbox
login: Log in to the Sandbox CLI
logout: Log out of the Sandbox CLI
For more help, try running sandbox <subcommand> --help
List all sandboxes for the specified account and project.
# List all running sandboxes
sandbox list
# List all sandboxes (including stopped ones)
sandbox list --all
# List sandboxes for a specific project
sandbox list --project my-nextjs-app
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
| Flag | Short | Description |
|---|
--all | -a | Show all sandboxes, including stopped ones (we only show running ones by default). |
--help | -h | Display help information. |
Create and run a command in a sandbox.
sandbox run [OPTIONS] <command> [...args]
# Run a simple Node.js script
sandbox run -- node --version
# Run with custom environment and timeout
sandbox run --env NODE_ENV=production --timeout 10m -- npm start
# Run interactively with port forwarding
sandbox run --interactive --publish-port 3000 --tty npm run dev
# Run with auto-cleanup
sandbox run --rm -- python3 script.py
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
--runtime <runtime> | - | Choose between Node.js ('node22') or Python ('python3.13'). We'll use Node.js by default. |
--timeout <duration> | - | How long the sandbox can run before we automatically stop it. Examples: '5m', '1h'. We'll stop it after 5 minutes by default. |
--publish-port <port> | -p | Make a port from your sandbox accessible via a public URL. |
--workdir <directory> | -w | Set the directory where you want the command to run. |
--env <key=value> | -e | Set environment variables for your command. |
| Flag | Short | Description |
|---|
--sudo | - | Run the command with admin privileges. |
--interactive | -i | Run the command in an interactive shell. |
--tty | -t | Enable terminal features for interactive commands. |
--rm | - | Automatically delete the sandbox when the command finishes. |
--help | -h | Display help information. |
| Argument | Description |
|---|
<command> | The command you want to run. |
[...args] | Additional arguments for your command. |
Create a sandbox in the specified account and project.
# Create a basic Node.js sandbox
sandbox create
# Create a Python sandbox with custom timeout
sandbox create --runtime python3.13 --timeout 1h
# Create sandbox with port forwarding
sandbox create --publish-port 8080 --project my-app
# Create sandbox silently (no output)
sandbox create --silent
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
--runtime <runtime> | - | Choose between Node.js ('node22') or Python ('python3.13'). We'll use Node.js by default. |
--timeout <duration> | - | How long the sandbox can run before we automatically stop it. Examples: '5m', '1h'. We'll stop it after 5 minutes by default. |
--publish-port <port> | -p | Make a port from your sandbox accessible via a public URL. |
| Flag | Short | Description |
|---|
--silent | - | Create the sandbox without showing you the sandbox ID. |
--help | -h | Display help information. |
Execute a command in an existing sandbox.
sandbox exec [OPTIONS] <sandbox_id> <command> [...args]
# Execute a simple command in a sandbox
sandbox exec sb_1234567890 ls -la
# Run with environment variables
sandbox exec --env DEBUG=true sb_1234567890 npm test
# Execute interactively with sudo
sandbox exec --interactive --sudo sb_1234567890 bash
# Run command in specific working directory
sandbox exec --workdir /app sb_1234567890 python script.py
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
--workdir <directory> | -w | Set the directory where you want the command to run. |
--env <key=value> | -e | Set environment variables for your command. |
| Flag | Short | Description |
|---|
--sudo | - | Run the command with admin privileges. |
--interactive | -i | Run the command in an interactive shell. |
--tty | -t | Enable terminal features for interactive commands. |
--help | -h | Display help information. |
| Argument | Description |
|---|
<sandbox_id> | The ID of the sandbox where you want to run the command. |
<command> | The command you want to run. |
[...args] | Additional arguments for your command. |
Stop one or more running sandboxes.
sandbox stop [OPTIONS] <sandbox_id> [...sandbox_id]
# Stop a single sandbox
sandbox stop sb_1234567890
# Stop multiple sandboxes
sandbox stop sb_1234567890 sb_0987654321
# Stop sandbox for a specific project
sandbox stop --project my-app sb_1234567890
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
| Flag | Short | Description |
|---|
--help | -h | Display help information. |
| Argument | Description |
|---|
<sandbox_id> | The ID of the sandbox you want to stop. |
[...sandbox_id] | Additional sandbox IDs to stop. |
Copy files between your local filesystem and a remote sandbox.
sandbox copy [OPTIONS] <SANDBOX_ID:PATH> <SANDBOX_ID:PATH>
# Copy file from local to sandbox
sandbox copy ./local-file.txt sb_1234567890:/app/remote-file.txt
# Copy file from sandbox to local
sandbox copy sb_1234567890:/app/output.log ./output.log
# Copy directory from sandbox to local
sandbox copy sb_1234567890:/app/dist/ ./build/
| Option | Alias | Description |
|---|
--token <token> | - | Your Vercel authentication token. If you don't provide it, we'll use a stored token or prompt you to log in. |
--project <project> | - | The project name or ID you want to use with this command. |
--scope <team> | --team | The team you want to use with this command. |
| Flag | Short | Description |
|---|
--help | -h | Display help information. |
| Argument | Description |
|---|
<SANDBOX_ID:PATH> | The source file path (either a local file or sandbox_id:path for remote files). |
<SANDBOX_ID:PATH> | The destination file path (either a local file or sandbox_id:path for remote files). |
Log in to the Sandbox CLI.
# Log in to the Sandbox CLI
sandbox login
| Flag | Short | Description |
|---|
--help | -h | Display help information. |
Log out of the Sandbox CLI.
# Log out of the Sandbox CLI
sandbox logout
| Flag | Short | Description |
|---|
--help | -h | Display help information. |