cli

package
v0.1.0-alpha.41 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package cli wires the armada command tree: the client that talks to the control plane. Commands that run on a machine as root are in package daemon (the armadad binary).

Index

Constants

View Source
const InstallURL = "https://raw.githubusercontent.com/ryanbekhen/armada/main/install.sh"

InstallURL is where the installer is published.

Variables

This section is empty.

Functions

func ExampleProblems

func ExampleProblems(newRoot func() *cobra.Command) []string

ExampleProblems checks the command tree newRoot builds (ADR 0052): every runnable command has two to four examples, and every example line that runs the tree's program names a command, flags, and arguments that exist on a fresh tree. Lines that only run other programs (systemctl) and comment lines are allowed. Tests of both binaries call it.

func Execute

func Execute(ctx context.Context, args []string, stdout, stderr io.Writer) int

Execute runs the command tree with args and returns the process exit code. On a terminal it says, at most once a day, that a newer release exists.

func IsTerminal

func IsTerminal(w io.Writer) bool

IsTerminal reports whether w is a terminal.

func LatestLine

func LatestLine(ctx context.Context, current string) []string

LatestLine says how current compares with the latest release, or nothing when looking is turned off.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand builds the full command tree. Output goes to the writers configured on the returned command so tests can capture it.

func NewVersionCommand

func NewVersionCommand(more ...func(context.Context) []string) *cobra.Command

NewVersionCommand prints build information; both binaries have it. As text it adds what each of more returns (the client: the servers' versions) and the latest release.

func RPCError

func RPCError(err error) error

RPCError strips the gRPC wrapping from server errors for display. The message may carry text from a node or an app (a file name in a volume), so control characters are replaced: it cannot move the cursor or send terminal sequences. Line breaks stay, since the server lists several problems (a spec's) one per line; text it relays from agents has none.

func ReadSecretValue

func ReadSecretValue(cmd *cobra.Command, fromFile string) ([]byte, error)

ReadSecretValue reads at most secrets.MaxSize bytes from a file, a hidden terminal prompt, or piped stdin.

func Run

func Run(ctx context.Context, cmd *cobra.Command, args []string, stdin io.Reader, stdout, stderr io.Writer) int

Run runs a command tree with args and returns the process exit code; a nil stdin means os.Stdin. armadad runs its own tree through it.

func SetPollIntervals

func SetPollIntervals(wait, node time.Duration) (restore func())

SetPollIntervals sets how often commands that wait poll the control plane (app deploy --wait, job start --wait, node delete) and returns a function that restores them. armadad's tests drive these commands against a server they run in process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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