Skip to content

Hide unreleased network-volume commands from --help - #466

Merged
sammy-vastai merged 1 commit into
masterfrom
hide-unreleased-network-volumes
Jul 24, 2026
Merged

Hide unreleased network-volume commands from --help#466
sammy-vastai merged 1 commit into
masterfrom
hide-unreleased-network-volumes

Conversation

@sammy-vastai

Copy link
Copy Markdown
Contributor

Summary

Network volumes aren't released yet, but their CLI commands were fully visible in vastai --help and tab completion — search network-volumes, create network-volume, list network-volume, unlist network-volume.

Adds a general-purpose "hidden command" gate, independent of and unrelated to the client/host work in #462/#463:

  • HIDDEN_COMMANDS (name-based registry) + an explicit hidden= kwarg on @parser.command, mirroring the existing COMMAND_OVERRIDES-style pattern in vastai/cli/parser.py.
  • Discoverability gate only, not an access gate — a hidden command still runs if typed directly (e.g. vastai search network-volumes ...), so internal testing is unaffected.
  • Applied to all four network-volume commands.

Found while manually testing #462 — noticed search network-volumes in --help but its own usage: string has an unrelated pre-existing typo (says search network volumes, missing the hyphen, present on master too). Not fixed here since it's a separate, small, unrelated issue — happy to do it as a follow-up if wanted.

Test plan

  • poetry run pytest tests/cli — 375 passed
  • Manually verified: none of the four commands appear in vastai --help or tab completion; all four still parse and run when typed directly

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a general-purpose “hidden command” mechanism in the CLI parser to remove unreleased commands from vastai --help output and tab completion, while keeping those commands executable when invoked directly (discoverability gate only).

Changes:

  • Adds HIDDEN_COMMANDS + is_hidden_command() and a hidden= kwarg on @parser.command to mark commands as hidden.
  • Filters hidden subparsers out of both grouped --help rendering and completion map generation.
  • Adds tests covering the hidden-command registry behavior, decorator propagation, help suppression, and direct parsing of a hidden command.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
vastai/cli/parser.py Implements hidden-command metadata and filters hidden commands out of help/completion paths.
tests/cli/test_parser.py Adds unit/sanity tests to ensure hidden commands are not discoverable but remain runnable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sammy-vastai
sammy-vastai marked this pull request as ready for review July 21, 2026 21:43
@vastzuby

Copy link
Copy Markdown
Contributor

yeah anything network volume or cluster related should be hidden

@sammy-vastai
sammy-vastai merged commit f5487c8 into master Jul 24, 2026
19 checks passed
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.

3 participants