showcli

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package showcli implements the `agent-receipts show <seq>` subcommand: inspect a single receipt by its chain sequence number, read from a daemon-written SQLite store. It opens the database read-only so it is safe to run while the daemon is the active writer.

Logic lives here, away from cmd/agent-receipts/main.go, so tests can drive the subcommand directly with arbitrary args / captured I/O without shelling out to a built binary.

Index

Constants

View Source
const (
	ExitOK         = 0 // receipt found and printed
	ExitNotFound   = 1 // no receipt at the requested sequence
	ExitUsageError = 2 // bad flags / unreadable DB / ambiguous chain
)

Exit codes are part of the CLI contract — scripts pivot on them.

Variables

This section is empty.

Functions

func Run

func Run(args []string, stdout, stderr io.Writer, envLookup func(string) string) int

Run executes the show subcommand with the given args (sans the program name and "show" subcommand token), writing output to stdout and diagnostics to stderr. Returns one of the Exit* constants.

envLookup is split out so tests can inject a deterministic environment without touching the real process env. Pass os.Getenv for the production caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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