Brev CLI Reference — NVIDIA Brev
Title: Brev CLI Reference — NVIDIA Brev
URL Source: https://docs.nvidia.com/brev/latest/brev-cli.html
Published Time: Mon, 11 Aug 2025 14:51:11 GMT
Markdown Content: Brev CLI Reference#
The Brev CLI wraps SSH to quickly get you in your instance, while also letting you do almost everything you can do from the console from the command line.
Every command has a --help flag if you need to see options.
Installation Instructions#
Install the Brev CLI to easily jump in and out of your instances, scale hardware and manage your org:
Mac
brew install brevdev/homebrew-brev/brev && brev login
Linux
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh)" brev login
Windows
Using Brev With Windows Subsystem for Linux (WSL)
Brev is supported on windows currently through the Windows Subsystem for Linux (WSL). This guide will walk you through the steps to get Brev up and running on your Windows machine.
Prerequisites
-
WSL installed and configured
-
Virtualization enabled in your BIOS
-
Ubuntu 20.04 installed from the Microsoft Store
Once you have WSL installed and configured, you can install Brev by running the following command in your terminal:
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/bin/install-latest.sh)"
Next Steps
Log in to your Brev account:
brev login
You can start using it to create and manage your instances. Check out our Getting Started guide to get started with Brev.
If you had trouble installing, reach out to us at [email protected] for help!
Instance Commands#
refresh#
Syntax#
brev refresh
Description#
This command syncs instances that you’ve created through the UI allowing you to access them through the CLI
Example#
$ brev refresh refreshing brev... brev has been refreshed
list#
Syntax#
print orgs
brev list orgs
print workspaces within active organization
brev list
print workspaces within any organization
brev list --org org_name
Description#
The list commands lets you see all the workspaces you have created or all workspaces within your organization. You can also use brev ls as an alias
Example#
$ brev list NAME STATUS ID MACHINE more-gpus STOPPED qn643e4lo a2-highgpu-1g:nvidia-tesla-a100:1 (gpu) brev-deployment-box STOPPED 3xq8vmxn6 n1-standard-16 (gpu) pytorch-container-finetune RUNNING m4tvipac7 n1-highmem-2:nvidia-tesla-t4:1 (gpu)
start#
Syntax#
brev start {-n | --name}
Description#
The brev start lets you start a stopped instance.
Example#
$ brev start stable-diffusion-ui Workspace stable-diffusion-ui is starting. Note: this can take about a minute. Run 'brev ls' to check status
stop#
Syntax#
brev stop workspace_name
Description#
If you don’t plan on using your Brev workspace, you can temporarily pause it by running
brev stop workspace_name
Everything in /home/verb-workspace will be saved when it boots up again.
You can stop multiple workspaces by listing each workspace name
$ brev stop brev-deploy naive-pubsub bar euler54 merge-json Workspace brev-deploy is stopping. Note: this can take a few seconds. Run 'brev ls' to check status Workspace naive-pubsub is stopping. Note: this can take a few seconds. Run 'brev ls' to check status Workspace bar is stopping. Note: this can take a few seconds. Run 'brev ls' to check status Workspace euler54 is stopping. Note: this can take a few seconds. Run 'brev ls' to check status Workspace merge-json is stopping. Note: this can take a few seconds. Run 'brev ls' to check status
port-forward#
Syntax#
brev port-forward WS_NAME [--port LOCAL_PORT:REMOTE_PORT]
Description#
port forward allows you to forward a port from a brev workspace to a port on your local machine. For example, if you’re running a jupyter notebook on port 8888 on your vm, you could use brev port-forward WS_NAME --port 8888:8888 to access it at localhost:8888
Under the hood, this command uses SSH port forwarding. If you need to manually set up port forwarding, you can use the following SSH command format:
ssh -i ~/.brev/brev.pem -p 22 -L LOCAL_PORT:localhost:REMOTE_PORT ubuntu@INSTANCE_IP
Where:
-
~/.brev/brev.pemis your Brev private key -
LOCAL_PORTis the port on your local machine -
REMOTE_PORTis the port on your Brev instance -
INSTANCE_IPis your instance’s IP address -
ubuntuis the default username for Brev instances
Example#
$ brev port-forward brev-docs --port 3000:3000 portforwarding... localhost:3000 -> brev-docs-xp43:3000
Interactively port forward a workspace:#
To interacticely select which port to forward from a brev workspace to your localhost, run brev-port-forward with no flag
$ brev port-forward brev-docs
Ports flag was omitted, running interactive mode!
What port on your Brev machine would you like to forward? 3333 What port should it be on your local machine? 3000
-p 3000:3333 2022/07/14 11:31:30 creating new ssh config portforwarding... localhost:3000 -> brev-docs-xp43:3333
Alternative: Using Tunnels#
If you need to expose a port publicly, you can use Brev’s tunnel feature through the web console. This creates a public URL for your service, but note that:
-
The tunnel will be routed through Cloudflare for authentication
-
You’ll need to access the endpoint through a web browser for the initial authentication redirect
-
For direct API access without browser authentication, use port forwarding instead
delete#
Syntax#
brev delete [ Workspace Name or ID...
Description#
The delete command lets you delete a workspace from your account.
Example#
$ brev delete payments-frontend Deleting workspace payments-frontend. This can take a few minutes. Run 'brev ls' to check status
Organization Commands#
set#
Syntax#
brev set <org name> [--token] [--skip-browser]
Description#
The set command lets you set the organization context for your commands.
Example#
$ brev set <org name>
login#
Syntax#
brev login [--token] [--skip-browser]
Description#
This function log’s you in to your brev account, and preforms some actions that brev needs to function with you user account such as set up config files and
-
creates
~/.brev/directory if it does not exist -
if you don’t have an account on brev, the browser step will create one for you
-
on first run asks you onboarding questions
-
on first run asks you to configure ssh keys
-
creates your first org if one does not exist
Example#
$ brev logout
logout#
Syntax#
brev logout
Description#
Remove your keys and logout
Example#
$ brev logout
ssh-key#
Get your ssh keys to add to your git provider.
brev ssh-key
Quick links to add it to Github or Gitlab
SSH Connectivity#
IP Address Management#
When you stop and start a Brev instance, its public IP address may change. To get the updated IP address:
- After starting your instance, run:
brev refresh
This will update the IP address in your ~/.brev/ssh_config file.
- You can verify the current public IP address by running:
curl ifconfig.me
Testing SSH Connection#
To test your SSH connection without needing a password:
-
Disconnect from your Brev instance if you’re currently connected
-
Run the following command:
ssh ubuntu@brev_public_ip
Replace brev_public_ip with the actual IP address of your instance.
This will verify that your SSH configuration is working correctly and that you can connect to your instance without requiring a password.
Links/Buttons: