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.
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 --no-browser. 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 i.e. prod or staging.Gateway Host(optional) — used only for self-hosting. If you are using the beam.cloud, you can leave this blank.Gateway Port(optional) — used only for self-hosting. If you are using the beam.cloud, you can leave this blank.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.
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.container_id:
Serve
Create a Preview Environment
Creates a temporary deployment preview.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
Secrets and environment variables can be injected into the containers that run your apps. After a secret is saved, it can be used in your application code like this:List Secrets
Lists all secrets that exist.Create a Secret
Creates a secretShow a Secret
Shows the value of a secret.Modify a Secret
Modifies the value of a secret.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.
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