Documentation
¶
Overview ¶
Package herdr is the binary's door to Herdr, the terminal multiplexer `f10 start` opens a task's worktree in and `f10 finish` closes it from. Six calls, all over the herdr CLI: open a worktree as a workspace, start an agent in its root pane, hand that agent a prompt, list the workspaces, focus one, close one. Every answer is JSON, and the ids the next call needs are read from it rather than predicted.
Index ¶
- Variables
- func Available() error
- func CloseWorkspace(ctx context.Context, dir, id string) error
- func FocusWorkspace(ctx context.Context, dir, id string) error
- func Prompt(ctx context.Context, dir, name, text string) error
- func StartAgent(ctx context.Context, dir, name, kind, pane string) error
- type Listed
- type Workspace
Constants ¶
This section is empty.
Variables ¶
var ErrNotInside = errors.New("f10 start and finish run inside a Herdr session: " +
"open a pane there, or install it from https://herdr.dev")
ErrNotInside is the one refusal: start and finish run inside a Herdr session and nowhere else, by decision rather than by accident of a missing fallback.
Functions ¶
func Available ¶
func Available() error
Available reports whether this process can reach Herdr: the session marks itself in the environment, and the CLI has to be on PATH.
func CloseWorkspace ¶
CloseWorkspace closes the workspace, its tabs and panes, and whatever agent ran in them.
func FocusWorkspace ¶
FocusWorkspace brings the workspace to the front.
Types ¶
type Listed ¶
type Listed struct {
ID string
Label string
Path string
Focused bool
Agent string // herdr's agent_status: idle, working, done, unknown
}
A Listed is one workspace as `workspace list` reports it. Path is the checkout the workspace shows, or "" for a workspace with no worktree.