| name | brev-cli |
| description | Manage GPU and CPU cloud instances with the Brev CLI for ML workloads and general compute. Use when users want to create instances, search for GPUs or CPUs, SSH into instances, open editors, copy files, port forward, manage organizations, or work with cloud compute. Supports fine-tuning, reinforcement learning, training, inference, batch processing, and other ML/AI workloads. Trigger keywords - brev, gpu, cpu, instance, create instance, ssh, vram, vcpu, A100, H100, cloud gpu, cloud cpu, remote machine, finetune, fine-tune, RL, RLHF, training, inference, deploy model, serve model, batch job. |
| allowed-tools | Bash, Read, AskUserQuestion |
| argument-hint | [create|search|shell|exec|open|ls|delete] [instance-name] |
Brev CLI
Manage GPU and CPU cloud instances from the command line. Create, search, connect, and manage remote machines.
When to Use
Use this skill when users want to:
- Create GPU or CPU instances (with smart defaults or specific types)
- Search for available GPU types (A100, H100, L40S, etc.)
- Search for CPU-only instance types (no GPU)
- SSH into instances or run commands remotely
- Open editors (VS Code, Cursor, Windsurf) on remote instances
- Copy files to/from instances
- Port forward from remote to local
- Manage organizations and instances
Trigger Keywords: brev, gpu, cpu, instance, create instance, ssh, vram, vcpu, A100, H100, cloud gpu, cloud cpu, remote machine, shell
Quick Start
brev search
brev search cpu
brev create my-instance
brev create my-instance --type g5.xlarge
brev ls
brev shell my-instance
brev exec my-instance "nvidia-smi"
brev open my-instance code
brev open my-instance cursor
Core Commands
Search GPUs
brev search
brev search gpu
brev search gpu --wide
brev search --gpu-name A100
brev search --gpu-name H100
brev search --min-vram 40 --sort price
brev search --max-boot-time 5 --sort price
brev search --stoppable --min-total-vram 40 --sort price
Search CPUs
brev search cpu
brev search cpu --provider aws
brev search cpu --min-ram 64
brev search cpu --arch arm64
brev search cpu --min-vcpu 16
brev search cpu --sort price
brev search cpu --json
CPU search shows: TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK, $/GB/MO, BOOT, FEATURES, $/HR
Create Instances
brev create my-instance
brev create my-instance --type g5.xlarge
brev create my-instance --type g5.xlarge,g5.2xlarge
brev search --gpu-name A100 | brev create my-instance
brev create my-instance --gpu-name A100 --min-vram 40
brev create my-cluster --count 3
brev create my-instance --startup-script @setup.sh
brev create my-instance --startup-script 'pip install torch'
brev create my-instance --dry-run
Instance Access
brev shell my-instance
brev exec my-instance "nvidia-smi"
brev exec my-instance "python train.py"
brev exec my-instance @setup.sh
brev exec my-instance @/path/to/script.sh
brev exec instance1 instance2 instance3 "nvidia-smi"
brev open my-instance
brev open my-instance code
brev open my-instance cursor
brev open my-instance windsurf
brev open my-instance terminal
brev open my-instance tmux
brev copy ./local-file my-instance:/remote/path/
brev copy my-instance:/remote/file ./local-path/
brev port-forward my-instance -p 8080:8080
Instance Management
brev ls
brev ls --json
brev delete my-instance
brev stop my-instance
brev start my-instance
brev reset my-instance
Pipeable Workflows
brev ls | awk '/RUNNING/ {print $1}' | brev stop
brev ls | awk '/STOPPED/ {print $1}' | brev delete
brev ls | awk '/STOPPED/ {print $1}' | brev start
brev ls | grep "test-" | awk '{print $1}' | brev stop
brev ls | awk '/RUNNING/ {print $1}' | brev exec "nvidia-smi"
brev search --gpu-name A100 | brev create my-box | brev exec @setup.sh
brev search --gpu-name A100 | brev create my-box | brev open cursor
Organizations
brev org ls
brev org set my-org
brev set my-org
brev invite
Common Workflows
-
Quick GPU Session (prompts/quick-session.md)
- Search → Create → Open editor
-
ML Training Setup (prompts/ml-training.md)
- Find high-VRAM GPU → Create with startup script → Copy data → Run training
-
Instance Cleanup (prompts/cleanup.md)
- List instances → Identify unused → Delete
Safety Rules - CRITICAL
NEVER do these without explicit user confirmation:
- Delete instances (
brev delete)
- Stop running instances (
brev stop)
- Create multiple instances (
--count > 1)
- Create expensive instances (H100, multi-GPU)
ALWAYS do these:
- Show instance cost/type before creating
- Confirm instance name before deletion
- Check
brev ls before assuming instance exists
Feedback
If you get stuck, encounter bugs, can't achieve what you're trying to do, or have ideas for improvements, send feedback to the Brev team:
brev feedback "description of issue or suggestion"
IMPORTANT: Never include secrets, passwords, API keys, or sensitive information in feedback.
Do this proactively when:
- A brev command fails unexpectedly or returns confusing errors
- You can't figure out how to accomplish a task with the available commands
- You notice missing features or rough edges
- A workflow feels harder than it should be
Troubleshooting
"Instance not found":
- Run
brev ls to see available instances
- Check if you're in the correct org:
brev org ls
"Failed to create instance":
- Try a different instance type:
brev search --sort price
- Check quota/credits with org admin
SSH connection fails:
- Run
brev refresh to update SSH config
- Ensure instance is running:
brev ls
Editor won't open:
- Verify editor is in PATH:
which code / which cursor
- Set default:
brev open --set-default code
References