cli: add quickstart flow for new users#7807
Conversation
83fde7c to
6f09ee7
Compare
|
@jedevc just reverted the |
|
LGTM once lint/tests are passing 🎉 Also FYI to @helderco since you've been the person working on the cobra part of the CLI the most. |
c01ed82 to
f13d704
Compare
This commit changes the CLI so it prints a custom Dagger Cloud trace URL when the user is not logged in or no DAGGER_CLOUD_TOKEN has been set. Additionally, a custom message gets printed at the end of `dagger init` and fro any commands that the user supplied the `-v` or `--debug` flags. Fixes DEV-4269 DEV-4268 Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
f13d704 to
381b927
Compare
|
merging as-is since the test failure is a flake. |
There was a problem hiding this comment.
nit: now this prints "Saved output to ..." instead of "Saved to ..." for Container, Directory, and File, which sounds a bit different, not sure if intentional (cc @helderco)
There was a problem hiding this comment.
this was my bad since I didn't rebase with main before merging and this is something helder fixed recently. Will revert in a follow-up PR. Thx for bringing this up Alex.
| case !ok && | ||
| cmd.Flags().Changed("verbose") || | ||
| cmd.Flags().Changed("debug") || | ||
| cmd == moduleInitCmd: | ||
| fmt.Fprintf(cmd.ErrOrStderr(), ` | ||
| Log-in or create an account to visualize %s in Dagger Cloud: | ||
| https://dagger.cloud/signup?quickstart=true | ||
|
|
||
| `, highlight.Render(`pipeline traces`)) |
There was a problem hiding this comment.
Just noticed this now - this should be !ok && (...) - since && has a higher precedence, it means that even when logged in, the message is still shown for debug and moduleInitCmd.
There was a problem hiding this comment.
noted, thx for reporting this one Justin <3
This commit changes the CLI so it prints a custom Dagger Cloud trace URL
when the user is not logged in or no
DAGGER_CLOUD_TOKENhas been set.Additionally, a custom message gets printed at the end of
dagger initand fro any commands that the user supplied the
-vor--debugflags.Fixes DEV-4269 DEV-4268
Here's some screenshots about how the feature looks:
Log-in message when

initis called and CLI is not authenticatedFull logged out trace URL:

Log-in message when

-vis supplied:The custom
/traces/$idURL will take the user to the quickstart flow which will create a Dagger Cloud organization after logging in.Signed-off-by: Marcos Lilljedahl marcosnils@gmail.com