CLI Getting Started
Install and configure the Brev CLI for terminal-based GPU instance management.
Installation
macOS
Linux
Windows (WSL)
Brev supports Windows through the Windows Subsystem for Linux (WSL).
Prerequisites:
- WSL installed and configured
- Virtualization enabled in your BIOS settings
- Ubuntu 20.04 or later from the Microsoft Store
BIOS Virtualization: If WSL fails to start, ensure virtualization (VT-x/AMD-V) is enabled in your BIOS settings. The exact steps vary by motherboard manufacturer.
Authentication
brev login
Authenticate with your Brev account. Opens a browser window for OAuth login and creates the ~/.brev/ directory with your credentials and SSH keys.
Flags
brev logout
Remove stored credentials from your machine.
brev ssh-key
Display your Brev SSH public key. Use this to add to Git providers like GitHub or GitLab.
How the CLI Manages SSH
The Brev CLI handles all SSH configuration automatically. You never need to:
- Track instance IP addresses
- Manage SSH keys
- Edit SSH config files
After logging in, the CLI:
- Downloads your SSH key to
~/.brev/brev.pem - Adds your instances to
~/.brev/ssh_config - Keeps the config in sync as instances start and stop
Connect by name, not IP: Run ssh my-instance or brev shell my-instance. The CLI tracks the IP address for you.
What’s in ~/.brev/
Run brev refresh after creating instances in the web console to sync them to your local CLI and SSH config.
Understanding Your Environment
When you connect to a Brev instance, you’re connecting to a containerized environment running on a GPU VM.
Store all your work in /home/ubuntu/workspace and push to Git regularly. This directory persists when you stop an instance, but is deleted when you delete the instance.