Documentation
¶
Overview ¶
Package tui is Stampede's interactive terminal UI: slash commands, plain language requests turned into commands, and live run views.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplayScenario ¶
ReplayScenario builds a scenario that replays a recording against base.
Types ¶
type Command ¶
type Command struct {
Name string
Args []string
// Flags hold --key value pairs.
Flags map[string]string
}
Command is a parsed slash command.
func Interpret ¶
Interpret turns a plain-language request into a command. It is deliberately simple and always shows the result for confirmation; it never guesses at anything it cannot name.
func ParseSlash ¶
ParseSlash parses "/run spike checkout --rate 100/s".
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model.
func New ¶
New builds the model. c may be nil, in which case /run works on local scenario files with the in-process engine.
type Options ¶
type Options struct {
// Init is stampede init with the confirmation already given: it
// detects the target's product type, installs the matching pack into
// dir and dry-runs it, writing its progress to w.
Init func(ctx context.Context, w io.Writer, target, dir string, env []string) error
// CheckTarget applies stampede run's safety rules to a local run of
// s and returns the host policy its requests must pass. Messages go
// to w. Nil leaves local runs without a host policy.
CheckTarget func(ctx context.Context, w io.Writer, s *scenario.Scenario, env map[string]string) (func(*url.URL) bool, error)
}
Options connect the console to commands that live in the CLI.