[UX] Extend dstack login with interactive selection of url and default project
#3492
+520
−79
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.
Similar to
gh auth login, if the user does not pass--urltodstack login, the command prompts the user to enter it interactively. The default value in this case ishttps://sky.dstack.ai.If the logged-in user has more than one project,
dstack loginprompts the user to select a default project using an interactive menu.dstack project, to explicitly avoid interactive prompts,dstack loginnow accepts-n/--no(does not change the default project) and-y/--yes(sets the user’s first project as the default).Note
Improves
dstack loginUX with interactive prompts and explicit non-interactive flags.--urlwhen running in a TTY (defaulthttps://sky.dstack.ai); adds rich-styledUrlPromptand graceful Ctrl-C handling-p/--provider-y/--yesand-n/--noto control default project selection; configures all projects first, then sets default based on flags/TTY conditions (single project auto-selected; interactive menu viaselect_default_projectwhen supported)isattychecksconfirm_askwith KeyboardInterrupt handling; simplifiesproject.pyQuestionary import and cleans selection codeWritten by Cursor Bugbot for commit fc5dad7. This will update automatically on new commits. Configure here.