login

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoginCmd

func NewLoginCmd(f *cmdutil.Factory) *cobra.Command

NewLoginCmd returns a new instance of the login command.

func RunOAuthFlow

func RunOAuthFlow(ctx context.Context, opts *LoginOptions, signup bool) error

RunOAuthFlow runs the full browser-based OAuth + profile setup flow. If signup is true, the browser opens to the sign-up page instead of sign-in.

Types

type LoginOptions

type LoginOptions struct {
	IO     *iostreams.IOStreams
	Config config.IConfig

	AppName     string
	ProfileName string
	Region      string
	Default     bool

	// NoBrowser disables automatic browser opening; the authorize URL is
	// printed instead. The CLI still starts a local callback server and
	// waits for the redirect.
	NoBrowser bool

	// NonInteractive disables every prompt and defaults the output to JSON, so
	// the command is usable from scripts. It signs in only: unless --app-name
	// names one, choosing an application is left to `algolia application select`.
	// The browser step is unaffected - the authorize URL still has to be opened
	// for the flow to complete.
	NonInteractive bool

	// PrintFlags is nil for callers that don't expose output flags (e.g. signup).
	PrintFlags *cmdutil.PrintFlags

	NewDashboardClient func(clientID string) *dashboard.Client
}

LoginOptions holds all options for the login command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL