Commit a53c504
feat(search): add gpu-search command to find GPU instance types (#280)
* feat(search): add gpu-search command to find GPU instance types
Add `brev search` command (aliases: gpu-search, gpu, gpus) to search and
filter available GPU instance types across cloud providers.
Features:
- Filter by GPU name, provider, VRAM, compute capability, disk, boot time
- Sort by price, vram, boot-time, etc.
- Show instance features (stoppable, rebootable, flex-ports)
- JSON output support for scripting
- Pipeable output for chaining with other commands
Examples:
brev search --gpu-name A100 --sort price
brev search --min-vram 40 --max-boot-time 5
brev search --json | jq '.[] | select(.price < 2)'
* refactor(search): address PR review feedback
- Add validation for --sort flag with clear error message for invalid options
- Extract common formatInstanceFields helper to reduce code duplication
- Move regex compilation to package level (compiled once, not per call)
- Replace magic number 730 with hoursInMonth constant
- Move public API URL to config.go as GetBrevPublicAPIURL()
- Use NewRestyClient instead of resty.New() for consistency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(search): fix lint issues in gpu-search refactor
- Fix gofumpt formatting (var block alignment, struct field alignment)
- Reduce cyclomatic complexity in RunGPUSearch by extracting
validateSortOption, displayEmptyResults, setTargetDisks, and
displayResults helpers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 564df67 commit a53c504
5 files changed
Lines changed: 1593 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| |||
0 commit comments