Documentation
¶
Overview ¶
Package cli is hmm's command line: flag parsing, stdin handling, the turn pump, session persistence, and exit codes. Presentation is not here — Run wires the streams into one ui.Console and every line of output goes through it; main only wires the real OS streams and signals.
Index ¶
Constants ¶
const Version = "0.1.0"
Version is reported by --version.
Variables ¶
This section is empty.
Functions ¶
func IsTTY ¶
IsTTY reports whether f is a real terminal. The ModeCharDevice stat check alone counts /dev/null as a TTY (it is a character device), which made non-interactive runs print the model picker into nothing; the TCGETS ioctl asks the device itself. Linux only; other platforms build the stat-check fallback in tty_other.go.
Types ¶
type IO ¶
type IO struct {
Stdin io.Reader
StdinIsTTY bool
Stdout io.Writer
Stderr io.Writer
StdoutIsTTY bool // markdown-rendered answers (glamour) on a TTY
StderrIsTTY bool // spinner + colored activity feed on a TTY
// NewModel resolves the provider config into a model. Default:
// agent.NewModel. Tests substitute wefttest.Script.
NewModel func(agent.Config) (weft.Model, error)
// Store persists sessions. Default: session.New() ($HMM_HOME
// aware). A nil Store with SessionDir set is a test store.
Store *session.Store
SessionDir string
// Library mounts the plugin library. Default: plugins.New()
// ($HMM_HOME aware), scanned at startup.
Library *plugins.Library
Now func() time.Time
}
IO carries everything Run touches, so tests inject scripts, buffers, and a fake store. Zero NewModel/Store/Now fall back to the real things.