cli

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOauthTokenParams

func BuildOauthTokenParams(clientID, clientSecret, audience string) url.Values

func BuildOauthTokenURL

func BuildOauthTokenURL(domain string) string

func Execute

func Execute()

Execute is the primary entrypoint of the CLI app.

func GenMarkdownTree added in v1.0.0

func GenMarkdownTree(cmd *cobra.Command, dir string) error

GenMarkdownTree is the same as GenMarkdownTree, but with linkHandler.

func GenerateCommandPage added in v1.0.0

func GenerateCommandPage(cmd *cobra.Command, w io.Writer) error

GenerateCommandPage creates custom markdown for the individual command pages.

func GenerateDocs added in v1.0.0

func GenerateDocs() error

GenerateDocs will generate the documentation for all the commands under the ./docs folder.

func GenerateHomepage added in v1.0.0

func GenerateHomepage(cmd *cobra.Command, w io.Writer) error

GenerateHomepage creates custom markdown for the homepage.

func GeneratePage added in v1.0.0

func GeneratePage(w io.Writer, name, body string, data interface{}) error

func GenerateParentPage added in v1.0.0

func GenerateParentPage(cmd *cobra.Command, w io.Writer) error

GenerateParentPage creates custom markdown for the parent command pages.

func RunLoginAsMachine added in v1.0.0

func RunLoginAsMachine(ctx context.Context, inputs LoginInputs, cli *cli, cmd *cobra.Command) error

RunLoginAsMachine facilitates the authentication process using client credentials (client ID, client secret).

func WrappedAliases added in v0.10.3

func WrappedAliases(cmd *cobra.Command) string

WrappedAliases returns a formatted string containing the command aliases if defined, otherwise an empty string.

func WrappedInheritedFlagUsages

func WrappedInheritedFlagUsages(cmd *cobra.Command) string

WrappedInheritedFlagUsages returns a string containing the usage information for all flags which were inherited from parent commands, wrapped to the terminal's width.

func WrappedLocalFlagUsages

func WrappedLocalFlagUsages(cmd *cobra.Command) string

WrappedLocalFlagUsages returns a string containing the usage information for all flags specifically set in the current command, wrapped to the terminal's width.

func WrappedNonRequestParamsFlagUsages

func WrappedNonRequestParamsFlagUsages(cmd *cobra.Command) string

WrappedNonRequestParamsFlagUsages returns a string containing the usage information for all non-request parameters flags. The string is wrapped to the terminal's width.

func WrappedRequestParamsFlagUsages

func WrappedRequestParamsFlagUsages(cmd *cobra.Command) string

WrappedRequestParamsFlagUsages returns a string containing the usage information for all request parameters flags, i.e. flags used in operation commands to set values for request parameters. The string is wrapped to the terminal's width.

Types

type Argument added in v0.3.0

type Argument struct {
	Name string
	Help string
}

func (*Argument) Ask added in v0.3.0

func (a *Argument) Ask(cmd *cobra.Command, value interface{}) error

func (Argument) GetHelp added in v0.3.0

func (a Argument) GetHelp() string

func (Argument) GetIsRequired added in v0.3.0

func (a Argument) GetIsRequired() bool

func (Argument) GetLabel added in v0.3.0

func (a Argument) GetLabel() string

func (Argument) GetName added in v0.3.0

func (a Argument) GetName() string

func (*Argument) Pick added in v0.3.2

func (a *Argument) Pick(cmd *cobra.Command, result *string, fn pickerOptionsFunc) error

type Flag added in v0.2.3

type Flag struct {
	Name         string
	LongForm     string
	ShortForm    string
	Help         string
	IsRequired   bool
	AlwaysPrompt bool
}

func (*Flag) Ask added in v0.2.3

func (f *Flag) Ask(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskBool added in v0.4.1

func (f *Flag) AskBool(cmd *cobra.Command, value *bool, defaultValue *bool) error

func (*Flag) AskBoolU added in v0.4.1

func (f *Flag) AskBoolU(cmd *cobra.Command, value *bool, defaultValue *bool) error

func (*Flag) AskInt added in v0.11.7

func (f *Flag) AskInt(cmd *cobra.Command, value *int, defaultValue *string) error

func (*Flag) AskIntU added in v0.11.7

func (f *Flag) AskIntU(cmd *cobra.Command, value *int, defaultValue *string) error

func (*Flag) AskMany added in v0.3.1

func (f *Flag) AskMany(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskManyU added in v0.3.1

func (f *Flag) AskManyU(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskPassword added in v0.7.0

func (f *Flag) AskPassword(cmd *cobra.Command, value *string, defaultValue *string) error

func (*Flag) AskPasswordU added in v0.7.0

func (f *Flag) AskPasswordU(cmd *cobra.Command, value *string, defaultValue *string) error

func (*Flag) AskU added in v0.2.3

func (f *Flag) AskU(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (Flag) GetHelp added in v0.3.0

func (f Flag) GetHelp() string

func (Flag) GetIsRequired added in v0.3.0

func (f Flag) GetIsRequired() bool

func (Flag) GetLabel added in v0.3.0

func (f Flag) GetLabel() string

func (Flag) GetName added in v0.3.0

func (f Flag) GetName() string

func (*Flag) IsSet added in v0.6.0

func (f *Flag) IsSet(cmd *cobra.Command) bool

func (*Flag) OpenEditor added in v0.10.2

func (f *Flag) OpenEditor(cmd *cobra.Command, value *string, defaultValue, filename string, infoFn func()) error

func (*Flag) OpenEditorU added in v0.10.2

func (f *Flag) OpenEditorU(cmd *cobra.Command, value *string, defaultValue string, filename string) error

func (*Flag) OpenEditorW added in v0.10.2

func (f *Flag) OpenEditorW(cmd *cobra.Command, value *string, defaultValue, filename string, infoFn func(), tempFileFn func(string)) error

func (*Flag) Pick added in v0.10.1

func (f *Flag) Pick(cmd *cobra.Command, result *string, fn pickerOptionsFunc) error

func (*Flag) PickU added in v0.11.0

func (f *Flag) PickU(cmd *cobra.Command, result *string, fn pickerOptionsFunc) error

func (*Flag) RegisterBool added in v0.3.0

func (f *Flag) RegisterBool(cmd *cobra.Command, value *bool, defaultValue bool)

func (*Flag) RegisterBoolU added in v0.3.0

func (f *Flag) RegisterBoolU(cmd *cobra.Command, value *bool, defaultValue bool)

func (*Flag) RegisterInt added in v0.3.0

func (f *Flag) RegisterInt(cmd *cobra.Command, value *int, defaultValue int)

func (*Flag) RegisterIntU added in v0.3.0

func (f *Flag) RegisterIntU(cmd *cobra.Command, value *int, defaultValue int)

func (*Flag) RegisterString added in v0.2.3

func (f *Flag) RegisterString(cmd *cobra.Command, value *string, defaultValue string)

func (*Flag) RegisterStringMap added in v0.9.0

func (f *Flag) RegisterStringMap(cmd *cobra.Command, value *map[string]string, defaultValue map[string]string)

func (*Flag) RegisterStringMapU added in v0.9.0

func (f *Flag) RegisterStringMapU(cmd *cobra.Command, value *map[string]string, defaultValue map[string]string)

func (*Flag) RegisterStringSlice added in v0.2.5

func (f *Flag) RegisterStringSlice(cmd *cobra.Command, value *[]string, defaultValue []string)

func (*Flag) RegisterStringSliceU added in v0.2.5

func (f *Flag) RegisterStringSliceU(cmd *cobra.Command, value *[]string, defaultValue []string)

func (*Flag) RegisterStringU added in v0.2.3

func (f *Flag) RegisterStringU(cmd *cobra.Command, value *string, defaultValue string)

func (*Flag) Select added in v0.2.5

func (f *Flag) Select(cmd *cobra.Command, value interface{}, options []string, defaultValue *string) error

func (*Flag) SelectU added in v0.2.5

func (f *Flag) SelectU(cmd *cobra.Command, value interface{}, options []string, defaultValue *string) error

type LoginInputs added in v1.0.0

type LoginInputs struct {
	Domain           string
	ClientID         string
	ClientSecret     string
	AdditionalScopes []string
}

type Tenant added in v0.11.10

type Tenant struct {
	Name         string         `json:"name"`
	Domain       string         `json:"domain"`
	AccessToken  string         `json:"access_token,omitempty"`
	Scopes       []string       `json:"scopes,omitempty"`
	ExpiresAt    time.Time      `json:"expires_at"`
	Apps         map[string]app `json:"apps,omitempty"`
	DefaultAppID string         `json:"default_app_id,omitempty"`
	ClientID     string         `json:"client_id"`
}

Tenant is the cli's concept of an auth0 tenant. The fields are tailor fit specifically for interacting with the management API.

func RunLoginAsUser added in v1.0.0

func RunLoginAsUser(ctx context.Context, cli *cli, additionalScopes []string) (Tenant, error)

RunLoginAsUser runs the login flow guiding the user through the process by showing the login instructions, opening the browser.

Jump to

Keyboard shortcuts

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