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

cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MPL-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Package cli is tk's Cobra command tree, exit codes, signals, and output rules. Handlers return errors; cmd/tk/main.go is the sole place that formats and exits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute builds the command tree and runs it.

func ExitCodeFromError

func ExitCodeFromError(err error) int

ExitCodeFromError maps err to a process exit code (nil → 0).

func PrintError

func PrintError(err error)

PrintError writes a fatal error to stderr.

func SignalExitCode

func SignalExitCode() int

SignalExitCode returns 128+signum when interrupted, else 0 (checked before error map).

Types

type App

type App struct {
	Ctx       *cue.Context
	ConfigDir string
	StateDir  string
	// AgentdexOpts are extra Open options for skill install/list/uninstall
	// (tests inject catalog dir, look path, env; production leaves nil).
	AgentdexOpts []agentdex.Option
}

App carries process-wide CUE context and XDG config/state directories.

type ExitError

type ExitError struct {
	Code int
	Err  error
	// Plain: non-fault diagnostic (e.g. empty next queue); printed without "error:" label.
	Plain bool
}

ExitError is the process exit code a handler wants main to use.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

Jump to

Keyboard shortcuts

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