cli

package
v0.117.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableOutputFormats = OutputFormats{
	OutputFormatPlain,
	OutputFormatJSON,
}

AvailableOutputFormats lists all valid output format values.

Functions

func Execute

func Execute()

Execute is the main entry point for the CLI.

func NewRootCommand added in v0.63.0

func NewRootCommand(ctx context.Context) *cobra.Command

NewRootCommand builds and returns the root cobra command for vault-cli. Callers can set args and I/O streams before calling ExecuteContext.

func PrintJSON added in v0.8.0

func PrintJSON(v any) error

PrintJSON prints any value as formatted JSON to stdout.

func Run

func Run(ctx context.Context, args []string) error

Run executes the CLI application.

Types

type OutputFormat added in v0.106.2

type OutputFormat string

OutputFormat represents the output format for CLI commands.

const (
	// OutputFormatPlain represents plain text output.
	OutputFormatPlain OutputFormat = "plain"
	// OutputFormatJSON represents JSON output.
	OutputFormatJSON OutputFormat = "json"
)

func (OutputFormat) IsJSON added in v0.106.2

func (f OutputFormat) IsJSON() bool

IsJSON returns true if the format is JSON.

func (OutputFormat) IsPlain added in v0.106.2

func (f OutputFormat) IsPlain() bool

IsPlain returns true if the format is plain text.

func (OutputFormat) Validate added in v0.106.2

func (f OutputFormat) Validate(ctx context.Context) error

Validate returns an error if the format is not a valid value.

type OutputFormats added in v0.106.2

type OutputFormats []OutputFormat

OutputFormats is a collection of OutputFormat values.

func (OutputFormats) Contains added in v0.106.2

func (f OutputFormats) Contains(format OutputFormat) bool

Contains returns true if the collection contains the given format.

Jump to

Keyboard shortcuts

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