beam CLI is a command-line utility that lets you work with Beam using beam commands, from uploading files to volumes to deploying your applications.
Use --help for command syntax and beam deploy --help-all for advanced deployment options.
For persistent Linux machines, see the Virtual machines CLI reference. beam vm open NAME PORT opens a published HTTP port with automatic browser authentication; beam vm ip NAME prints its persistent IPv6 address.
Most Common Commands
You’ll be using these a lot!beam deploy– deploy an app to the cloudbeam shell– SSH into a container to debug it interactivelybeam serve– create a temporary live preview of your appbeam logs– stream logs from a task, container, or deployment
Installation
This installs the CLI in an isolated environment. Installbeam-client separately in your project environment to import beam from Python.
Setup Credentials
Sign in with the browser flow and verify the selected workspace:beam login --browserless. Credentials are saved in ~/.beam/config.ini. See authentication for tokens and CI.
Config
Configures your Beam API keys and saves a profile to~/.beam/config.ini
Context Name(required) — the name of the profile, such asprodorstaging.Gateway Host(optional) — leave blank to use the default (gateway.beam.cloud).Gateway Port(optional) — leave blank to use the default (443).Token(required) — your API token, found on this page of the dashboard.
Create
Create a new context.If you are prompted to enter a value for
Gateway Host or Gateway Port, you
can leave both fields blank.Delete
Delete a saved context.List
Lists saved contexts.Select
Set the default context.Specifying Context
Most commands support the--context (or -c) flag, which allows you to specify which config profile to use for that command. This is useful when working with multiple environments (e.g., development, staging, production).
beam config select) will be used.
Doctor
Checks that the selected context can reach its gateway and that its token is valid, without creating any resources. Run it first when a command fails unexpectedly.beam doctor prints the error and exits with status 1, so it works as a preflight step in scripts.
--format json prints the same details as an object with the keys sdk_version, context, gateway, authenticated, and error. Pass --context to check a context other than the default.
Deployment
Create
Deploys a Python handler, Dockerfile, or registry image. HTTP workloads return a URL; background workers without ports do not. See container hosting.List
Lists all deployments.Stop
Stops a deployment.Start
Starts an inactive deployment.Delete
Deletes a deployment.Shell
SSH Into Containers
Allows you to interactively access a container on Beam. The container is built with the same image and resources as your handler.container_id:
--sync-dir DIR to watch a local directory and sync its changes into the container while the shell is open. If you don’t have a handler yet, beam dev opens a shell in a default environment.
Serve
Create a Preview Environment
Creates a temporary deployment preview.--timeout SECONDS to change that, or --timeout -1 to keep it running until you stop it.
Run
Runs a single container and streams its logs. Point it at aPod defined in Python, or skip the handler and describe the container with flags. See running a web service for a walkthrough.
Pod object; any other handler is rejected with an error. To preview an endpoint or task queue, use beam serve instead.
beam run --help-all lists the remaining options, including --sync, --secrets, --disk, --pool, --keep-warm-seconds, and the checkpoint settings.
Pressing Ctrl+C stops the log stream but leaves the container running. Both Ctrl+C and --detach print the commands for following up:
--keep-warm-seconds, where -1 disables the timeout. See Pod timeouts.
--sync syncs the current directory into the container and watches it for changes. It can’t be combined with --detach.
Dev
Spins up a remote development container, opens a shell in it, and keeps a local directory synced into it while you work. Give it a handler to reuse that handler’s image and resources, or leave it blank for a default environment.--sync DIR sets the directory to sync, which defaults to the current directory. The image and resource options are the same as for beam run.
Container
Manage the containers running in your account.List
Lists all containers.Stop
Terminate a running container.Task
Any code you run on Beam creates a task. Any time you run a function or invoke an API, a task is created.List Tasks
Lists all tasks.Stop a Task
Stops a task.Volume
Beam allows you to create highly-available storage volumes that can be used across tasks. You might use volumes for things like storing model weights or large datasets.Create a Volume
Creates a volume.Delete a Volume
List Volumes
List all volumes mounted to your apps.List Volume Contents
List all contents of a volume.Copy Files to Volumes
Copies a file to a volume.Move Files in Volumes
Move files around a volume.Remove Files from Volumes
Remove a file from a volume.Downloading Data
You can download directories and individual files.Disk
Durable disks are persistent, node-local storage for stateful workloads such as databases. Disks are created automatically when an app that declares them is run or deployed, and can also be managed directly from the CLI.Create a Disk
Creates a disk, or returns the existing disk if one with that name already exists.--size defaults to 10Gi and --filesystem to ext4.
List Disks
List all disks in your workspace.List Disk Snapshots
List the snapshots taken of a disk. Omit the disk name to list snapshots for every disk in the workspace.Delete a Disk
Deletes a disk from your workspace. Snapshots of the disk are kept.Secret
Serverless apps receive secret values as environment variables. VM/sandbox runtime secrets receive placeholders and require approved credential hosts; see brokered secrets. Serverless code can access a bound value like this:List Secrets
Lists names, allowed hosts, placeholders and timestamps, without values. Use--format json for structured output.
Create a Secret
Creates a secret--host for credential hostnames or quoted *.wildcards. Host rules contain no ports or paths.
Show a Secret
Shows the value of a secret.Update a Secret
Modifies the value of a secret.modify remains an alias. Omitting --host preserves rules; supplying it replaces them. --clear-hosts removes all rules, making the secret unusable as a brokered runtime binding. Placeholders stay stable; brokered requests pick up rotated values after a 15-second cache, while serverless containers use them on their next start.
Delete a Secret
Permanently deletes a secret.Logs
Logs return the last 100 lines. Usebeam logs web --follow to stream, or select an ID below. See logs and metrics for filters.
Deployment
Streams logs for a deployment.beam deployment list.
Task
Streams logs for a task.beam task list.
Container
Streams logs for a container.beam container list.
Stub ID
Streams logs for a stub ID.Machine
Manage the machines available on Beam.List
List the available GPUs at any given moment.Reserve
Reserves on-demand hardware into a compute pool. In a terminal, it lists the cheapest offers and asks you to pick one. With--yes, or when the output is piped, it reserves the cheapest offer without prompting.
ondemand-<gpu> unless you pass --name. --ttl takes a duration such as 45m, 6h, or 2d, or indefinite, which starts with a 30-day lease. If you omit --max-spend, it’s calculated from the offer price and TTL.
Release
Releases reserved hardware and stops billing for it.beam pool machines.
Pool
Manage compute pools, groups of dedicated machines that your apps can run on. Route an app to a pool with thepool argument in your code, or with beam deploy --pool <name>.
List Pools
--format json, each pool includes its reservations, with lease and billing details. See Checking a Reservation.
Create a Pool
Creates a private pool for machines you attach yourself. You don’t have to run this first:beam pool join, beam pool scale, and beam machine reserve create the pool if it doesn’t exist.
Browse Offers
Lists the on-demand offers that match a pool shape, without reserving anything. For an interactive picker, usebeam machine reserve.
Reserve Nodes
Reserves nodes into a named pool without prompting, which makes it the scriptable counterpart tobeam machine reserve. --ttl and --max-spend are required. When you add nodes to an existing pool, the GPU type must match the pool’s.
--offer-id reserves a specific offer returned by beam pool offers.
List Machines
Lists the machines in your private pools, or in a single pool if you pass its name. The table shows each machine’s ID, state, capacity, load, public IP, and when it last checked in.Extend a Pool
Moves the lease end of every reserved node in a pool, or raises the pool’s spend cap.--ttl is measured from now, and only ever extends leases.
Delete a Pool
Deletes a pool, releasing all of its machines and reservations.Join a Machine
Joins the machine you run it on to a private pool, creating the pool if it doesn’t exist.--max-cpu, --max-memory, --max-gpus, and --gpu-ids limit what the machine offers to the pool. Use either --max-gpus or --gpu-ids, not both.
Print a Join Command
Prints an install command that joins a machine to the pool. Use it to add a machine that doesn’t have the Beam CLI installed.--ttl.
Image
Build and inspect container images without running anything.Build an Image
Builds an image from anImage object defined in Python, or from a Dockerfile. Pass one or the other, not both.
Image object rather than a function. --context-dir defaults to the Dockerfile’s directory.
When the build finishes, the command prints the image ID. If the build fails, it exits with status 1. With --format json, the result is printed as JSON and the live build logs go to stderr, so you can pipe the output.
Get an Image
Checks whether an image ID is available to run.image_id, exists, and context. The command exits with status 1 if the image doesn’t exist.
Token
Manage the API tokens for your workspace. You can also manage them on the API keys page of the dashboard. See authentication for how tokens are used.List Tokens
Lists each token’s ID and type, whether it is active, and when it was created.Create a Token
Creates a token and prints it, including its key. The key is a credential, so avoid running this where output is logged.workspace token has full access. A workspace_restricted token can invoke your deployed apps but can’t manage workspace resources such as deployments, volumes, secrets, or other tokens. Use it for clients that only call your endpoints.
Toggle a Token
Disables an active token, or re-enables a disabled one, without deleting it.Delete a Token
Deletes a token.Additional Workflows
Use
--help on the command you need. Global options precede the subcommand, for example beam --context production --json deployment list.
Helpers and utils
Ignore Local Files
You can create a.beamignore file in your project’s root directory to tell Beam which local files and directories to ignore when syncing to Beam.
This follows the conventions of .gitignore
Ignoring Files