Help us shape the future of Go! Take the 2026 Go Developer Survey

spawn

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package spawn provides the Spawner interface used by both `entire review` and `trace investigate` to start an agent process non-interactively.

The interface is intentionally env-contract-agnostic: callers compose their own TRACE_REVIEW_* or TRACE_INVESTIGATE_* env via review.AppendReviewEnv or investigate.AppendInvestigateEnv before calling BuildCmd. Spawners only own the agent-specific argv shape and stdin wiring; they do not append review/investigate env.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spawner

type Spawner interface {
	// Name returns the agent's stable registry name (e.g. "claude-code").
	Name() string

	// BuildCmd constructs the *exec.Cmd to spawn the agent.
	//   - env: the full process environment to set on cmd.Env (the caller has
	//     already appended TRACE_REVIEW_* or TRACE_INVESTIGATE_* values
	//     and stripped any stale entries before calling).
	//   - prompt: the composed prompt string. The spawner decides whether
	//     this goes via argv or stdin per the agent's CLI shape.
	BuildCmd(ctx context.Context, env []string, prompt string) *exec.Cmd
}

Spawner builds *exec.Cmd values for a specific agent in non-interactive, review/investigate mode. The returned Cmd MUST NOT be started yet — callers may attach pipes, modify env, etc., before invoking Start.

Jump to

Keyboard shortcuts

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