Skip to content

Feat/cli improvements and new features cooked#5

Merged
hi-lei merged 22 commits intomainfrom
feat/cli-improvements
Apr 3, 2026
Merged

Feat/cli improvements and new features cooked#5
hi-lei merged 22 commits intomainfrom
feat/cli-improvements

Conversation

@hi-lei
Copy link
Copy Markdown
Collaborator

@hi-lei hi-lei commented Apr 3, 2026

Description

Type of Change

  • feat: New feature
  • fix: Bug fix
  • refactor: Code refactoring
  • docs: Documentation
  • test: Tests
  • chore: Maintenance
  • ci: CI/CD changes

Checklist

  • Code follows the project conventions (see .ai/skills/new-command.md)
  • go build ./... passes
  • go test ./... passes
  • --debug output included for API-calling commands
  • Destructive actions have confirmation prompts

Note: The CHANGELOG is auto-generated from conventional commit messages at release time. Do not edit CHANGELOG.md manually.

Milosz Szewczak and others added 22 commits April 2, 2026 21:23
Add five CLI improvements to close the gap with modern cloud CLIs:

1. `--output json|yaml|table` global flag (-o) for structured output
   across all list and describe commands, enabling scripting and
   automation pipelines (e.g. `verda vm list -o json | jq`).

2. `verda completion` command for bash, zsh, fish, and powershell
   shell completions using Cobra's built-in generation.

3. `verda ssh <instance>` command to SSH into a running VM by
   hostname or ID. Resolves IP from the API and exec's into ssh.
   Supports --user, --key, and pass-through args via --.

4. `verda vm describe` and `verda volume describe` commands to
   show detailed info about a single resource (aliased as get/show),
   with full --output flag support.

5. `--wait` and `--wait-timeout` flags on vm create, vm action,
   volume create, and volume action. Generic polling utility with
   animated spinner for interactive use and silent mode for
   structured output.

Includes 33 new unit tests covering all features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add documentation for ssh, describe, completion commands,
--output flag, structured output examples, and --wait flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three new command groups:

- `verda images` — browse OS images with --type and --category
  filters. Shows name, category, and details (e.g., CUDA version).

- `verda availability` — check instance type availability per
  location. Supports --location, --type, and --spot flags.
  Single-type check returns a boolean; full matrix shows all
  available types per datacenter.

- `verda cost` — cost estimation, pricing, and billing:
  - `estimate` — calculate hourly/daily/monthly costs for an
    instance type + optional volumes, with spot pricing support
  - `price-history` — show historical fixed and dynamic pricing
  - `balance` — display current account balance

All commands support --output json/yaml for scripting.
Includes tests for cost math, formatting, and filtering logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The /instance-types/{type} endpoint returns 404. Fetch all instance
types and filter client-side instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Verda API requires lowercase 'usd', not 'USD'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The /instance-types/price-history endpoint has been removed by the
API (410 Gone). Dynamic pricing is no longer supported.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
List available datacenter locations with code, name, and country.
Supports --output json/yaml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- `verda cost running` shows burn rate of all running instances
  with per-instance breakdown including attached volume costs
- Add scripts/live-test.sh for automated integration testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When --output is json or yaml, return nil from Factory.Status()
so spinners don't write escape codes to stdout and break piping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- `verda instance-types` lists all types with specs and pricing,
  with --gpu, --cpu, and --spot filters. Groups output by GPU vs CPU.

- `verda vm list` now prints a static table when stdout is piped
  or redirected, instead of launching the interactive picker.
  Interactive mode still works in a terminal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Strip duplicate count prefix from API GPU descriptions
  (e.g., "1x 1x H100 SXM5 80GB" → "1x H100 SXM5")
- Strip trailing VRAM from description (shown in separate column)
- Format large RAM values as TB (e.g., 1440GB → 1.4TB)
- Widen GPU column for longer names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Compute max hostname length so columns stay aligned with long names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Separate "Flags" from "Global Flags" in help output
- Register --output flag completion values (json/yaml/table)
- Remove dead JSON bool field from vm list options
- Fix Poll() timeout to return error instead of nil
- Consolidate duplicate polling code from status_view.go into shared wait.go
- Centralize status messages and terminal statuses in status_messages.go
- Add interactive picker for verda ssh (no-arg shows running instances)
- Add interactive picker for vm describe and volume describe (no-arg shows list)
- Add reusable TestFactory in cmd/util/testing.go for command-level tests
- Add arg-validation and status message tests
- Fix pre-existing lint issues (stuttering type names, hugeParam, goimports)
- Ignore .ai/notes/ and docs/plans/ in .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Version: show human-readable text by default, JSON only with -o json
- Image: show image slug instead of volume name, append OS name if different
- Compute: strip duplicate "1x" prefix from GPU description
- Pricing: remove redundant field (only fixed pricing exists)
- Storage Status: show actual status (attached/detached) with "(OS)" label

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full build details still available via verda version -o json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Joins instance type specs, pricing, and live availability data into a
single view — sorted by price, filterable by location, type, kind, and
spot. Addresses user request for a native alternative to the Python
availability script.

Usage:
  verda vm availability
  verda vm availability --location FIN-01 --kind gpu --spot
  verda vm availability -o json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ssh.go: suppress G204 for intentional syscall.Exec into ssh
- images_test.go, instancetypes_test.go: use empty slice instead of nil
  to avoid G602 false positive on nil range

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei merged commit 4c2d084 into main Apr 3, 2026
13 checks passed
@hi-lei hi-lei changed the title Feat/cli improvements Feat/cli improvements and new features cooked Apr 3, 2026
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