Documentation
¶
Overview ¶
Package cli provides shared functionality required by commands exposed by the CLI.
Index ¶
- func ClientFromContext(ctx context.Context) *secrets.Client
- func ClientToContext(ctx context.Context, client *secrets.Client) context.Context
- func CreateClient(cmd *cobra.Command, _ []string) error
- func PromptPassword(prompt string) (string, error)
- func PromptYesNo(prompt string) (bool, error)
- func Write(value any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFromContext ¶
ClientFromContext returns a secrets.Client from the context.Context, or nil if one is not found.
func ClientToContext ¶
ClientToContext adds the given secrets.Client to the context.Context.
func CreateClient ¶
CreateClient is to be used as a PersistentPreRun function for a cobra root command that adds a secrets.Client instance into the command context for child commands to use.
func PromptPassword ¶
PromptPassword creates an "enter password" prompt on stdin that masks the input text, returning the entered password as a string.
func PromptYesNo ¶
PromptYesNo creates a "yes/no" prompt on stdin, returning a boolean representing if action should be taken.
Types ¶
This section is empty.