cmd

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 34 Imported by: 1 module, 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 cmd wires the cobra command tree. It contains no business logic: each file parses flags, decides between interactive and plain output, calls pkg/app and renders the result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() int

Execute runs the CLI with the process streams and returns the exit code.

func NewRootCmd

func NewRootCmd(streams Streams) *cobra.Command

NewRootCmd builds the command tree bound to the given streams.

Types

type Globals

type Globals struct {
	NoInteractive bool
	Debug         bool
	Quiet         bool
	NoVerify      bool
	Cwd           string
}

Globals holds the persistent flags.

type Runtime

type Runtime struct {
	Globals Globals
	Streams Streams
	// Interactive is true when prompts and TUIs may be used.
	Interactive bool
	Runner      exec.Runner
	Git         *git.Client
	Log         *slog.Logger
	// Report prints every human facing line (docs/style.md).
	Report *ui.Reporter
	// contains filtered or unexported fields
}

Runtime is everything a command needs, built once after flag parsing.

func (*Runtime) Config

func (rt *Runtime) Config(ctx context.Context) (*config.Config, error)

Config loads stack.* settings lazily.

func (*Runtime) Repo

func (rt *Runtime) Repo(ctx context.Context) (git.Repo, error)

Repo discovers the repository lazily (from --cwd or the working directory).

type Streams

type Streams struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

Streams are the process's standard streams, injectable for tests.

Jump to

Keyboard shortcuts

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