Documentation
¶
Overview ¶
Package herdr drives the herdr terminal multiplexer through its JSON CLI.
Two rules matter here. Never run bare `herdr` — that launches the TUI, even as a capability probe. And never fail flow because herdr is unavailable: a missing workspace is a warning, since the worktree and the editor are the parts that carry the work.
Index ¶
- type CLI
- func (c *CLI) Available(ctx context.Context) bool
- func (c *CLI) CloseWorkspace(ctx context.Context, id string) error
- func (c *CLI) CreateWorkspace(ctx context.Context, cwd, label string) (Workspace, error)
- func (c *CLI) FocusWorkspace(ctx context.Context, id string) error
- func (c *CLI) ListWorkspaces(ctx context.Context) ([]Workspace, error)
- func (c *CLI) Version(ctx context.Context) (string, error)
- type Client
- type Logger
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
Runner flowexec.Runner
// Bin is the herdr executable name.
Bin string
Log Logger
}
CLI is the herdr binary wrapper.
func (*CLI) Available ¶
Available probes herdr without launching its TUI. `herdr workspace list` succeeds only when the local server is reachable, which is exactly the question callers are asking.
func (*CLI) CloseWorkspace ¶
CloseWorkspace closes a workspace. flow never calls this during delete — that is an explicit non-goal — but `flow prune` and future commands may.
func (*CLI) CreateWorkspace ¶
CreateWorkspace opens a plain empty shell at cwd. It deliberately starts no agent and splits no panes.
func (*CLI) FocusWorkspace ¶
FocusWorkspace brings an existing workspace to the front.
func (*CLI) ListWorkspaces ¶
ListWorkspaces returns every workspace herdr knows about.
type Client ¶
type Client interface {
Available(ctx context.Context) bool
CreateWorkspace(ctx context.Context, cwd, label string) (Workspace, error)
ListWorkspaces(ctx context.Context) ([]Workspace, error)
FocusWorkspace(ctx context.Context, id string) error
CloseWorkspace(ctx context.Context, id string) error
}
Client is the herdr surface flow uses.
type Logger ¶
Logger records parse fallbacks at -v. The signature matches charmbracelet/log, whose message parameter is an any.
type Workspace ¶
type Workspace struct {
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
TabID string `json:"tab_id,omitempty"`
RootPaneID string `json:"root_pane_id,omitempty"`
CWD string `json:"cwd,omitempty"`
}
Workspace is a herdr workspace as flow records it.
func FindByLabel ¶
FindByLabel returns the workspace carrying label.
func (Workspace) Identified ¶
Identified reports whether flow learned the workspace's ID. A workspace can be created successfully yet unidentified if herdr's JSON shape has changed.