[Feature]: Support CLI login flow
Problem
Moved from https://github.com/dstackai/dstack-enterprise/issues/4
Currently to configure the dstack CLI, users need to log in via the UI, then follow UI instructions and run dstack project add. This means the CLI is not sufficient to authenticate that brings multiple limitations such as inability to automate user log in, CLI setup, etc.
Solution
dstack CLI should have a command like dstack login that launches browser log in flow, retrieves the user token, and configures the CLI with the token.
A related limitation is that the CLI is always set up against a project so it's not entirely obvious what the project should be when auto-configuring token for the CLI. We could auto-configure all projects accessible to the user. Also consider allowing the CLI to retrieve and save the token without projects so that it can be used in automation to configure first user projects (e.g. by self-joining public projects).
Workaround
No response
Would you like to help us implement this feature by sending a PR?
Yes