cli

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cli provides shared functionality required by commands exposed by the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFromContext

func ClientFromContext(ctx context.Context) *secrets.Client

ClientFromContext returns a secrets.Client from the context.Context, or nil if one is not found.

func ClientToContext

func ClientToContext(ctx context.Context, client *secrets.Client) context.Context

ClientToContext adds the given secrets.Client to the context.Context.

func CreateClient

func CreateClient(cmd *cobra.Command, _ []string) error

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

func PromptPassword(prompt string) (string, error)

PromptPassword creates an "enter password" prompt on stdin that masks the input text, returning the entered password as a string.

func PromptYesNo

func PromptYesNo(prompt string) (bool, error)

PromptYesNo creates a "yes/no" prompt on stdin, returning a boolean representing if action should be taken.

func Write

func Write(value any) error

Write the JSON-encoded value with indentation to os.Stdout.

Types

This section is empty.

Directories

Path Synopsis
Package config provides types and functions for working with configuration files used by the CLI.
Package config provides types and functions for working with configuration files used by the CLI.

Jump to

Keyboard shortcuts

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