cli

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 115 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 wires every komando command. Design rules:

  • piped or agent output is exactly one JSON envelope (or NDJSON when streaming); a terminal gets text
  • an AI agent is never prompted, and missing input is an error with a hint; a person at a terminal can be asked
  • exit codes are stable (see internal/out)
  • destructive actions require explicit flags; changes are audited, except `update` run as root

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() int

Execute runs the komando program: one call, made from this process (its arguments, environment and terminal), and its exit code.

func Guard added in v0.18.0

func Guard(cl *call, st *store.State, hosts []*store.Host, command string, mutating bool) error

Guard enforces the safety policy before anything mutating runs.

func GuardConns added in v0.18.0

func GuardConns(cl *call, st *store.State, conns []*store.Conn, v driver.Verdict) error

GuardConns is Guard for conns. The driver classifies the operation first; destructive needs --allow-dangerous, and any change to a protected conn needs --yes. Exit code and codes match Guard so agents handle both alike.

func GuardScript added in v0.18.0

func GuardScript(cl *call, st *store.State, hosts []*store.Host, script string, mutating bool) error

GuardScript is Guard for a line komando writes whole for one of its own commands (pkg security, docker prune, the Swarm changes), where typed words are only quoted operands and the command rates its own words: the rules that copy a command's check for exec text (policy.CheckScript) and the compose-file reader do not apply.

func RunCall added in v0.14.0

func RunCall(ctx context.Context, c engine.Call, args []string) int

RunCall runs one komando command (args are the words after "komando") as the call c: its envelope or text goes to c.Stdout, its notes to c.Stderr, and its approvals and environment are its own. It returns the exit code. Calls may run at the same time in one process.

Types

This section is empty.

Source Files

Directories

Path Synopsis
kit
gatehere
Package gatehere holds the rules of ssh-gate's server mode (--here): a phone's key that logs in to a server runs komando there through the gate, and the gate decides what may run on that server itself.
Package gatehere holds the rules of ssh-gate's server mode (--here): a phone's key that logs in to a server runs komando there through the gate, and the gate decides what may run on that server itself.
phonekey
Package phonekey holds what `credential key install --public-key-file` (C372) checks and writes: a device's public key line for a user on a server, always behind komando's gate in server mode (option C of the U107 design).
Package phonekey holds what `credential key install --public-key-file` (C372) checks and writes: a device's public key line for a user on a server, always behind komando's gate in server mode (option C of the U107 design).
term
Package term holds what every command prints to a terminal: how wide text is in columns, text tables and the line an empty list says.
Package term holds what every command prints to a terminal: how wide text is in columns, text tables and the line an empty list says.

Jump to

Keyboard shortcuts

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