cli

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 25 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 stream their states to."`
	Gen       genCommand       `cmd:"" help:"Generate TypeScript schema declarations and the script API."`
	Status    statusCommand    `cmd:"" help:"List the mirrors reporting to the SPECTRE server and the divergences they reported, or clear divergences."`
	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