Skip to content

Add prototype for CLI signup command - #131

Draft
shakeelrao wants to merge 15 commits into
mainfrom
shak/signup-prototype
Draft

shakeelrao wants to merge 15 commits into
mainfrom
shak/signup-prototype

Conversation

@shakeelrao

@shakeelrao shakeelrao commented Nov 24, 2026 •

Copy link
Copy Markdown

Prototype: temporal cloud signup

Draft for prototype review. The command is hidden from --help.

What it does

  1. Logs in to Auth0 with the onboarding audience. The token stays in memory and is never written to the profile.
  2. Calls OnboardingService.GetOrCreateCLIOnboardingState and polls until onboarding completes. The polling slows down the same way the website's does.
  3. Tells the user to run temporal cloud login afterwards.

--login-method google|microsoft|password picks the provider. Without it, the command shows an arrow-key picker in a terminal; otherwise (no TTY or -o json) Auth0 shows its own picker.

Changes to existing behaviour

  • Login prompts now go to stderr, so -o json output stays parseable.
  • --disable-pop-up now really skips opening the browser and only prints the URL.

Known gaps

  • No handling yet for the server's FailedPrecondition reasons (waiting on server support).
  • The user will likely need to run signup multiple times for email + password: the first run ends at email verification, a later one at MFA enrollment, and only then does onboarding start.
  • Reuses the existing CLI Auth0 app, so password sign-up is enabled and Auth0 shows its consent screen for the localhost redirect.
  • Nothing checks that the vendored proto stays in sync.
  • No automatic cloud login, no token storage on disk, and no cross-process refresh lock.

shakeelrao and others added 2 commits November 23, 2026 23:25
Copy the GetOrCreateCLIOnboardingState RPC from saas-proto (#1455, CAS-297)
into proto/onboardingservice/v1, trimmed to the fields the CLI uses.
Omitted fields are reserved, so the wire format matches the server.
saas-proto remains the source of truth.

Generate Go code with buf (`make proto`); protoc-gen-go and
protoc-gen-go-grpc are pinned as go tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Log in to Auth0 with the onboarding audience, call
GetOrCreateCLIOnboardingState, and poll until onboarding completes. The
sign-up token stays in memory; the user runs `temporal cloud login`
afterwards.

- --login-method google|microsoft|password, or an arrow-key picker in
  an interactive terminal. Without a TTY, Auth0 shows its own picker.
- Login prompts now go to stderr so -o json output stays clean.
- --disable-pop-up now prints the URL without opening a browser.
- The command is hidden from help until the prod handler ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread Makefile Resolved
Comment on lines +155 to +161
docs:
keywords:
- signup
- onboarding
description-header: Sign up
tags:
- login

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect this would end up getting published upon merge. Can we either keep this on a development branch or make sure it won't make it into the docs until it's actually usable by others?

@shakeelrao shakeelrao Nov 25, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

agreed. i can probably merge all the code outside of the command now (in separate PRs) and leave the command implementation out of main until we're ready to ship.

Comment on lines +15 to +19
const (
keyCtrlC = '\x03'
keyCtrlD = '\x04'
keyEsc = '\x1b'
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these and all the other terminal control codes the same on Windows?

@shakeelrao shakeelrao Nov 25, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i plan to add the picker in a dedicated PR (if we decide to keep it), so we can harden the code then. will add to the TODO list so i don't forget :3


func isTerminal(stream any) bool {
f, ok := stream.(fdFile)
return ok && term.IsTerminal(int(f.Fd()))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Elsewhere in the generated commands.gen.go, we use istatty.IsTerminal. Can we do the same here?

@shakeelrao shakeelrao Nov 25, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we need x/term for raw mode anyway, so using it for the TTY check too keeps the check and the raw-mode setup on the same implementation. isatty is only in generated code, and it wouldn't change behaviour, so i'm inclined to re-use x/term instead of bringing in a new import for a functionally equivalent call. wdyt?

Comment thread temporalcloudcli/prompter/select.go Resolved
func (b bearerTokenCredentials) GetRequestMetadata(context.Context, ...string) (map[string]string, error) {
token, err := b.tokenSource.Token()
if err != nil {
return nil, fmt.Errorf("failed to get access token: %w", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Errors that come through here can end up being pretty opaque to the end user. Are there any known error cases we should make friendlier like we do in the cloud client?

@shakeelrao shakeelrao Nov 25, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, when the server implementation is finalized, i think we can wrap known error modes as friendly errors.

This branch is waiting to be deployed

1 waiting deployment
integration — 8c3349e6 Waiting Nov 25, 2026 by shakeelrao via Integration tests #85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants