Skip to content

Comments

feat(search): add cpu subcommand and wide mode to brev search#289

Open
theFong wants to merge 3 commits intomainfrom
feat/search-cpu-subcommand
Open

feat(search): add cpu subcommand and wide mode to brev search#289
theFong wants to merge 3 commits intomainfrom
feat/search-cpu-subcommand

Conversation

@theFong
Copy link
Member

@theFong theFong commented Feb 24, 2026

Summary

  • Restructure brev search into gpu and cpu subcommands (brev search defaults to GPU for backwards compatibility)
  • Add brev search cpu to find CPU-only instances via ?include_cpu=true API endpoint
  • Add --wide flag to GPU search that shows RAM and ARCH columns
  • Add shared --min-vcpu filter across both modes
  • CPU search has dedicated filters (--min-ram, --arch) and columns (TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK, $/GB/MO, BOOT, FEATURES, $/HR)
  • Piping into brev create works for both GPU and CPU table output (verified end-to-end)

Test plan

  • brev search — defaults to GPU search (backwards compatible)
  • brev search gpu — identical to brev search
  • brev search gpu --wide — adds RAM + ARCH columns
  • brev search cpu — shows CPU-only instances
  • brev search cpu --provider gcp --sort price — filters work
  • brev search cpu --min-ram 64 --min-vcpu 32 — numeric filters work
  • brev search cpu --arch x86 — arch filter works
  • brev search cpu --provider gcp | brev create test — pipe into create works (tested live)
  • go test ./pkg/cmd/gpusearch/ ./pkg/cmd/gpucreate/ — all tests pass

Restructure `brev search` into gpu/cpu subcommands:
- `brev search` / `brev search gpu` - GPU instances (default, backwards compatible)
- `brev search gpu --wide` - GPU instances with RAM and ARCH columns
- `brev search cpu` - CPU-only instances via ?include_cpu=true API param

CPU search has dedicated columns (TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK,
$/GB/MO, BOOT, FEATURES, $/HR) and filters (--min-ram, --arch).

Shared filters (--provider, --min-vcpu, --min-disk, --max-boot-time,
--stoppable, --rebootable, --flex-ports, --sort) work across both modes.

Piping into `brev create` works for both GPU and CPU table output.
@theFong theFong requested a review from a team as a code owner February 24, 2026 07:18
Move --min-ram and --arch from CPU-dedicated flags to shared flags
so they are available on all search subcommands (gpu, cpu, and parent).
- Fix gofumpt formatting
- Remove unused terminal parameter from displayCPUTable
- Reduce cyclomatic complexity of SortInstances using map-based dispatch
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.

1 participant