Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package cli is the built-in command line: its commands and the terminal output they write. It is the only package that writes to the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandLine

type CommandLine struct {
	Log    logger.Config   `embed:"" prefix:"log-"`
	Config kong.ConfigFlag `placeholder:"FILE" help:"Load flag values from a TOML file. Command-line flags take precedence."`
	// A deployment's own SPECTRE_VERSION must not make every command exit.
	Version kong.VersionFlag `env:"-" help:"Print the version and exit."`

	Supervise   superviseCommand   `cmd:"" help:"Supervise a candidate and a reference behind the embedded proxies, splitting resources between them."`
	Serve       serveCommand       `cmd:"" help:"Run the SPECTRE server, which mirrors report their quarantines to."`
	Gen         genCommand         `cmd:"" help:"Generate TypeScript schema declarations and the script API."`
	Divergences divergencesCommand `cmd:"" help:"List or clear the divergences that mirrors reported to the SPECTRE server."`
	State       stateCommand       `cmd:"" help:"Describe a service's migration state."`

	Init initCommand `cmd:"" help:"Set a service checkout up for a SPECTRE migration from a template."`
}

CommandLine is the built-in command line. Extensions add to it, so custom binaries never copy it.

type Output

type Output struct {
	Writer  io.Writer
	Palette terminal.Palette
}

Output is where a command writes, with the palette that suits it.

func NewOutput

func NewOutput(file *os.File) Output

NewOutput writes to file, styling text only when file is a colour terminal.

Directories

Path Synopsis
Package terminal styles command output for terminals.
Package terminal styles command output for terminals.

Jump to

Keyboard shortcuts

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