Client/host command classification with role-aware CLI display - #462
Closed
sammy-vastai wants to merge 1 commit into
Closed
Client/host command classification with role-aware CLI display#462sammy-vastai wants to merge 1 commit into
sammy-vastai wants to merge 1 commit into
Conversation
sammy-vastai
force-pushed
the
cln-3582-client-host-cli
branch
from
July 20, 2026 20:49
3271dbd to
4f24e59
Compare
3 tasks
sammy-vastai
force-pushed
the
cln-3582-client-host-cli
branch
from
July 21, 2026 18:25
4f24e59 to
64ea70d
Compare
sammy-vastai
force-pushed
the
cln-3582-client-host-cli
branch
from
July 21, 2026 19:24
64ea70d to
180e92f
Compare
2 tasks
Contributor
Author
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
is_host_only_command()invastai/cli/parser.py), replacing the 26 hand-written[Host]help-text prefixes with an auto-rendered one derived from the classification.~/.config/vastai/vast_role) that filters--help, tab completion, and error hints — display-only, never gates execution; the server remains the real permission enforcement layer.host(vastai set role host, or auto-detection in the follow-up PR). An unset or unrecognized role is treated as client, not "show everything" — this is what actually makes fresh installs show the filtered view without requiring the auto-detection in Auto-detect the client/host role from an existing API key #463.vastai set role host|clientto manually set/override the role.machine_read-style 401 on a host command gets a "did you mean" hint (e.g.show machines→show instances).Auto-detecting the role from an existing API key (rather than requiring
set roleto be run manually) is split into a follow-up stacked PR: #463.Test plan
poetry run pytest tests/cli— 397 passedset role host/set role clienttoggle correctly; the 401 hint fires even with an unset roletest_tar_utils.py/test_search.pyare unrelated (present onmastertoo)CLN-3582