Skip to content

Conversation

@peterschmidt85
Copy link
Contributor

@peterschmidt85 peterschmidt85 commented Jan 23, 2026

  1. Similar to gh auth login, if the user does not pass --url to dstack login, the command prompts the user to enter it interactively. The default value in this case is https://sky.dstack.ai.

  2. If the logged-in user has more than one project, dstack login prompts the user to select a default project using an interactive menu.

Screenshot 2026-01-23 at 16 41 07
  1. Similar to dstack project, to explicitly avoid interactive prompts, dstack login now accepts -n/--no (does not change the default project) and -y/--yes (sets the user’s first project as the default).
Screenshot 2026-01-23 at 16 41 16

Note

Improves dstack login UX with interactive prompts and explicit non-interactive flags.

  • Prompts for --url when running in a TTY (default https://sky.dstack.ai); adds rich-styled UrlPrompt and graceful Ctrl-C handling
  • When multiple SSO providers exist in a TTY, prompts to select provider; otherwise requires -p/--provider
  • Adds -y/--yes and -n/--no to control default project selection; configures all projects first, then sets default based on flags/TTY conditions (single project auto-selected; interactive menu via select_default_project when supported)
  • Tweaks output messages (e.g., "Logged in as", "Added ... at ") and centralizes isatty checks
  • Wraps confirm_ask with KeyboardInterrupt handling; simplifies project.py Questionary import and cleans selection code
  • Extensive tests added/updated for new flows and messaging

Written by Cursor Bugbot for commit fc5dad7. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

token=selected_project.token,
default=True,
)
config_manager.save()
Copy link

Choose a reason for hiding this comment

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

Missing confirmation message after interactive project selection

Low Severity

The interactive project selection path (the else branch) successfully configures and saves the selected default project but does not print a confirmation message. All other code paths that set a default project (the --yes flag at lines 193-195 and the auto-default case at lines 224-226) print a "Set [project] project as default at [path]" message. This inconsistency means users who interactively select a project receive no feedback that their selection was applied.

Fix in Cursor Fix in Web

…ng of import and other exceptions when detecting if interactive menu is available). Plus, added handling KeyboardException in `dstack login`.
@peterschmidt85 peterschmidt85 merged commit a1f0d58 into master Jan 27, 2026
29 checks passed
@peterschmidt85 peterschmidt85 deleted the dstack-login-interactive-project-selection branch January 27, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants