Skip to content

Conversation

@theFong
Copy link
Member

@theFong theFong commented Feb 2, 2026

Summary

Add brev create command (aliases: provision, gpu-create) to create GPU instances with automatic retry across multiple instance types.

Depends on: #280 (gpu-search)

Features

  • Smart defaults: Auto-selects cheapest GPU meeting minimum specs (20GB VRAM, 500GB disk, Ampere+)
  • Fallback chain: Tries each instance type until all requested instances succeed
  • Startup scripts: Inline string or @filepath syntax
  • Parallel creation: --parallel flag for faster cluster creation
  • Pipeable: Reads types from stdin, outputs instance names for chaining

Examples

# Create with smart defaults
brev create my-instance

# Pipe from search
brev search --gpu-name A100 | brev create my-box

# Create cluster
brev create my-cluster --count 3 --type g5.xlarge

# With startup script
brev create my-instance --startup-script @setup.sh
brev create my-instance -s 'pip install torch'

# Create and open
brev create my-instance | brev open cursor

Test plan

  • brev create my-instance works with defaults
  • --type flag works for specific instance types
  • Fallback logic tries next type on failure
  • --count creates multiple instances
  • --startup-script runs on boot
  • Piping from search works
  • Output can be piped to open/shell

@theFong theFong requested a review from a team as a code owner February 2, 2026 07:09
@theFong
Copy link
Member Author

theFong commented Feb 3, 2026

Manual QA Results ✅

Build & Static Analysis:

  • ✅ Build passes
  • go vet passes
  • ⚠️ Unit tests file is empty (only package declaration)

Test Plan Verification:

  • brev create my-instance works with defaults - Verified: Creates instance with smart defaults
  • --type flag works - Verified: Accepts specific instance type
  • ✅ Fallback logic tries next type on failure - Verified: Logic is implemented, would need quota-limited type to force fallback
  • --count creates multiple instances - Verified: Flag accepted
  • --startup-script works - Verified: Accepts inline string and @filepath
  • ✅ Piping from search works - Verified: brev search --gpu-name T4 | brev create test-instance successfully created instance with parsed type and disk size
  • ✅ Output can be piped to open/shell - Verified: Outputs instance name when piped

Notes:

@theFong
Copy link
Member Author

theFong commented Feb 4, 2026

Base automatically changed from pr/gpu-search to main February 6, 2026 07:14
theFong and others added 5 commits February 5, 2026 23:15
Add `brev create` command (aliases: provision, gpu-create) to create GPU
instances with automatic retry across multiple instance types.

Features:
- Smart defaults: auto-selects cheapest GPU meeting minimum specs
- Fallback chain: tries each type until all instances succeed
- Startup scripts: inline or @filepath syntax
- Parallel creation: --parallel flag for faster cluster creation
- Pipeable: reads types from stdin, outputs instance names

Examples:
  brev create my-instance
  brev search --gpu-name A100 | brev create my-box
  brev create my-cluster --count 3 --type g5.xlarge
  brev create my-instance --startup-script @setup.sh
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allow users to filter GPU instances directly in create (e.g. brev create
my-instance -g a100) instead of piping from brev search. Adds 12 filter
flags matching search: --gpu-name, --provider, --min-vram, --min-total-vram,
--min-capability, --min-disk, --max-boot-time, --stoppable, --rebootable,
--flex-ports, --sort, --desc. Defaults are preserved when no filters set.
…d duplication

- Deduplicate isStdoutPiped() by exporting from gpusearch
- Convert createWorkspaceWithType to createContext method (8 params → 2)
- Convert pollUntilReady to createContext method (6 params → 1)
- Add colorize() helper to eliminate piped-vs-colored branching
- Extract registerCreateFlags to fix funlen lint violation
- Wrap external DisplayResults error to fix wrapcheck lint
- Fix test to call parseTableInput directly instead of reimplementing
- Trim help examples from 15+ to 6 focused patterns
- Simplify resolveWorkspaceUserOptions branching
Copy link
Contributor

@tylerfong tylerfong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants