feat(search): add cpu subcommand and wide mode to brev search#289
Open
feat(search): add cpu subcommand and wide mode to brev search#289
Conversation
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
brev searchintogpuandcpusubcommands (brev searchdefaults to GPU for backwards compatibility)brev search cputo find CPU-only instances via?include_cpu=trueAPI endpoint--wideflag to GPU search that shows RAM and ARCH columns--min-vcpufilter across both modes--min-ram,--arch) and columns (TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK,brev createworks 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 tobrev searchbrev search gpu --wide— adds RAM + ARCH columnsbrev search cpu— shows CPU-only instancesbrev search cpu --provider gcp --sort price— filters workbrev search cpu --min-ram 64 --min-vcpu 32— numeric filters workbrev search cpu --arch x86— arch filter worksbrev search cpu --provider gcp | brev create test— pipe into create works (tested live)go test ./pkg/cmd/gpusearch/ ./pkg/cmd/gpucreate/— all tests pass