cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 18 Imported by: 0 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

Overview

Package cli builds the command-line interface from the registry: every Spec becomes a cobra subcommand with its flags.

Index

Constants

View Source
const (
	ExitOK       = 0
	ExitInput    = 1 // invalid input
	ExitUsage    = 2 // usage error
	ExitInternal = 3 // internal error
)

Exit codes.

View Source
const DefaultMaxInput = 64 << 20

DefaultMaxInput is the --max-input limit (64 MB).

Variables

This section is empty.

Functions

func Execute

func Execute(args []string, d Deps) int

Execute runs the CLI with args and returns the exit code.

Types

type Deps

type Deps struct {
	Registry        *registry.Registry
	Stdin           io.Reader
	Stdout, Stderr  io.Writer
	StdinTTY        bool
	StdoutTTY       bool
	Getenv          func(string) string
	RenderStyles    render.Styles
	RunTUI          func(clipboard bool) error // nil: no TUI available
	Clipboard       clipboard.Clipboard        // for --copy
	Version, Commit string
}

Deps is everything the CLI takes from the environment; tests replace it.

Jump to

Keyboard shortcuts

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