cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cli is the tori command tree: a cobra hierarchy wrapped with charmbracelet/fang for polished help, version, and error rendering (spec §12). The commands are thin — they parse flags, build an x-cli engine, call the archive/render packages, and map the typed errors those return onto stable exit codes (spec §6). No scraping or rendering logic lives here.

Index

Constants

View Source
const (
	CodeOK        = 0
	CodeUsage     = 1
	CodePartial   = 2
	CodeNeedsAuth = 4
	CodeBlocked   = 5
	CodeNotFound  = 6
	CodeInterrupt = 130
)

Exit codes (spec §6). The CLI maps the engine's typed errors onto these so a script can branch on the outcome.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Build metadata, overridden at release time via -ldflags -X github.com/tamnd/tori/cli.Version=... (and Commit/Date). The defaults are what a plain `go build` or `go install` reports.

Functions

func Execute

func Execute(ctx context.Context) int

Execute builds the command tree, runs it through fang, and returns a process exit code. cmd/tori/main.go passes a signal-aware context so Ctrl-C cancels the in-flight capture and exits 130.

Types

This section is empty.

Jump to

Keyboard shortcuts

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