Documentation
¶
Overview ¶
Package cli builds the lo command tree.
Index ¶
Constants ¶
const ( AnnotationDestructive = "lok8s.dev/destructive" AnnotationReadonly = "lok8s.dev/readonly" AnnotationIdempotent = "lok8s.dev/idempotent" )
Annotation keys carried on every command. They mirror the argsh usage markers (`@destructive`, `@readonly`, `@idempotent`) and drive confirmation gating and MCP tool filtering.
Variables ¶
var ErrCheckFailed = ErrHandled
ErrCheckFailed is the `--check` verdict: something would be ejected, or something drifted. main prints nothing for it (the command already did) and exits 1.
var ErrHandled = ui.ErrHandled // one sentinel for every package; see internal/ui
ErrHandled marks an error whose message was already printed in the bash implementation's own format ([error] … on stderr). The caller exits non-zero without printing anything further.
Functions ¶
func NewRoot ¶
NewRoot builds the full lo command tree: the usage-mirrored tree plus the Go-only commands. The project's spec.implementation (routing.go) is read once here: a routed command is registered as a shim to the bash tree in the project, `default: bash` shims the whole usage tree, and the Go-only commands stay Go.
func Shim ¶
Shim replaces the current process with the argsh implementation (`lo` in the bash tree), passing argv through verbatim so both implementations parse identically. The tree is a checkout or ejected tree when the project has one, else the copy embedded in the binary, extracted once into the versioned cache (assets.BashTree). This is the `lo drivers <name>` fallback for a driver without a Go twin; a routed command (routing.go) goes through execShim with the project's tree instead and never reaches the cache.
func WatchInterrupt ¶
WatchInterrupt cancels the returned context on the first SIGINT or SIGTERM and reports the exit code that signal maps to. The bash entrypoint set no trap: the shell died of the signal, the process exit code was 128+n (130 for SIGINT, 143 for SIGTERM) and nothing was printed. The Go binary cancels the command context instead, so every Runner child and every wait loop stops, and main exits with the same code. The watch ends with the first signal: a second one takes the default action again and ends a process that did not stop on its own.
exitCode stops the watch and returns 0 while no signal arrived, else 128+n. Call it once, after the command returned.
Types ¶
This section is empty.
Source Files
¶
- cmd_addons.go
- cmd_ai.go
- cmd_assets.go
- cmd_audit.go
- cmd_build.go
- cmd_chat.go
- cmd_crds.go
- cmd_deploy.go
- cmd_doctor.go
- cmd_down.go
- cmd_drivers.go
- cmd_env.go
- cmd_gitops.go
- cmd_hooks.go
- cmd_image.go
- cmd_init.go
- cmd_init_wizard.go
- cmd_k8s.go
- cmd_kubeconfig.go
- cmd_kubehz.go
- cmd_kustomize.go
- cmd_lint.go
- cmd_mcp.go
- cmd_operator.go
- cmd_provision.go
- cmd_recover.go
- cmd_registry.go
- cmd_secrets.go
- cmd_status.go
- cmd_tilt.go
- cmd_toolchain.go
- cmd_trust.go
- cmd_up.go
- cmd_use.go
- cmd_version.go
- commands.go
- dispatch.go
- drivers.go
- exit.go
- interrupt.go
- root.go
- routing.go
- shim.go