Documentation
¶
Overview ¶
Package cli implements leather's command dispatch and serve loop.
Index ¶
- func NewDevtoolsHandler(deps DevtoolsHandlerDeps) http.Handler
- func Run(args []string, stdout, stderr io.Writer, version, commit string) int
- func RunChat(args []string, stdin io.Reader, stdout, stderr io.Writer) int
- func RunIngest(args []string, stdout, stderr io.Writer) int
- func RunOnce(args []string, stdout, stderr io.Writer) int
- func RunReplay(args []string, stdout, stderr io.Writer, version, commit string) int
- func RunServe(args []string, stdout, stderr io.Writer, version, commit string) int
- func RunStatus(args []string, stdout, stderr io.Writer) int
- func RunTestAgent(args []string, stdout, stderr io.Writer) int
- func RunValidate(args []string, stdout, stderr io.Writer) int
- func RunVersion(_ []string, stdout, _ io.Writer, version, commit string) int
- type DevtoolsHandlerDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDevtoolsHandler ¶
func NewDevtoolsHandler(deps DevtoolsHandlerDeps) http.Handler
NewDevtoolsHandler builds all /api/devtools routes.
func Run ¶
Run is leather's main entry point. It parses the first argument as a subcommand and dispatches to the appropriate handler, returning an exit code. version and commit are set by -ldflags at build time.
func RunChat ¶
RunChat starts an interactive chat session backed by the leather session abstraction (token budget, automatic context summarization). Usage: leather chat [flags]
func RunIngest ¶
RunIngest implements the "leather ingest" subcommand. Returns exit code: 0 success, 1 error, 2 usage error.
func RunOnce ¶
RunOnce loads and executes a single agent definition, then exits. Usage: leather run [flags] <path-to-agent.agent.md>
func RunReplay ¶
RunReplay implements `leather replay <file> [serve flags...]` as a thin wrapper around `leather serve --replay <file> --api`. The replay subsystem runs inside the serve loop; exposing a top-level `replay` subcommand makes the entry point discoverable (T6.8).
Usage:
leather replay <snapshot.json> [--addr 127.0.0.1:7749] [other serve flags] leather replay --live <dir> [other serve flags]
func RunServe ¶
RunServe starts the leather scheduler loop and blocks until signalled. It exits cleanly on SIGINT or SIGTERM, draining in-flight jobs first.
func RunTestAgent ¶
RunTestAgent implements the "leather test-agent" subcommand. It loads an agent definition, runs it using a MockLLM (no real LLM calls), prints the turn transcript, and exits 0 on success, 1 on error, 2 on usage error.
Usage: leather test-agent <agent-file> [flags]
--lifecycle <file> apply a *.lifecycle.yaml before running --mock-response <text> LLM response text (default: "mock response") --tool-response <name>=<text> tool name to response text (repeatable, reserved for future use) --max-tokens <n> token budget (default 8192)
func RunValidate ¶
RunValidate parses and validates all agent, skill, and worker definition files. Exits 0 if all files are valid, 1 if any have errors, 2 on usage errors.
Output format:
ok: <name> (<path>) — file parsed and schema-clean error: <file>: <message> — parse or semantic error schema: <file>: field "<name>": <msg> — schema violation