herdr

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package herdr is the binary's door to Herdr, the terminal multiplexer `f10 start` opens a task's worktree in, `f10 forward` reaches its agent through 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

Constants

This section is empty.

Variables

View Source
var ErrNotInside = errors.New("f10 start, forward, drive and finish run inside a Herdr session: " +
	"open a pane there, or install it from https://herdr.dev")

ErrNotInside is the one refusal: start, forward, drive 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

func CloseWorkspace(ctx context.Context, dir, id string) error

CloseWorkspace closes the workspace, its tabs and panes, and whatever agent ran in them.

func FocusWorkspace

func FocusWorkspace(ctx context.Context, dir, id string) error

FocusWorkspace brings the workspace to the front.

func Prompt

func Prompt(ctx context.Context, dir, name, text string) error

Prompt submits text to the named agent and returns as soon as it is submitted. Never --wait: the caller may itself be an agent in Herdr.

func StartAgent

func StartAgent(ctx context.Context, dir, name, kind, pane string) error

StartAgent launches an agent of kind in pane under name. It returns once Herdr sees the agent ready for input, which is herdr's own wait, not ours.

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.

func Workspaces

func Workspaces(ctx context.Context, dir string) ([]Listed, error)

Workspaces lists every workspace the session shows.

type Workspace

type Workspace struct {
	ID          string
	RootPane    string
	AlreadyOpen bool // Herdr was showing this checkout before the call
}

A Workspace is what opening a worktree yields: the ids the agent calls are addressed by.

func OpenWorktree

func OpenWorktree(ctx context.Context, dir, path, label string) (Workspace, error)

OpenWorktree turns the checkout at path into a workspace labelled label, or returns the one already showing it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL