Documentation
¶
Overview ¶
Package executor provides CLI execution for Claude and Codex tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeExecutor ¶
type ClaudeExecutor struct {
Command string // command to execute, defaults to "claude"
Args string // additional arguments (space-separated), defaults to standard args
OutputHandler func(text string) // called for each text chunk, can be nil
Debug bool // enable debug output
ErrorPatterns []string // patterns to detect in output (e.g., rate limit messages)
// contains filtered or unexported fields
}
ClaudeExecutor runs claude CLI commands with streaming JSON parsing.
type CodexExecutor ¶
type CodexExecutor struct {
Command string // command to execute, defaults to "codex"
Model string // model to use, defaults to gpt-5.3-codex
ReasoningEffort string // reasoning effort level, defaults to "xhigh"
TimeoutMs int // stream idle timeout in ms, defaults to 3600000
Sandbox string // sandbox mode, defaults to "read-only"
ProjectDoc string // path to project documentation file
OutputHandler func(text string) // called for each filtered output line in real-time
Debug bool // enable debug output
ErrorPatterns []string // patterns to detect in output (e.g., rate limit messages)
// contains filtered or unexported fields
}
CodexExecutor runs codex CLI commands and filters output.
func (*CodexExecutor) Run ¶
func (e *CodexExecutor) Run(ctx context.Context, prompt string) Result
Run executes codex CLI with the given prompt and returns filtered output. stderr is streamed line-by-line to OutputHandler for progress indication. stdout is captured entirely as the final response (returned in Result.Output).
type CodexRunner ¶
type CodexRunner interface {
Run(ctx context.Context, name string, args ...string) (streams CodexStreams, wait func() error, err error)
}
CodexRunner abstracts command execution for codex. Returns both stderr (streaming progress) and stdout (final response).
type CodexStreams ¶
CodexStreams holds both stderr and stdout from codex command.
type CommandRunner ¶
type CommandRunner interface {
Run(ctx context.Context, name string, args ...string) (output io.Reader, wait func() error, err error)
}
CommandRunner abstracts command execution for testing. Returns an io.Reader for streaming output and a wait function for completion.
type CustomExecutor ¶ added in v0.8.0
type CustomExecutor struct {
Script string // path to the custom review script
OutputHandler func(text string) // called for each output line, can be nil
ErrorPatterns []string // patterns to detect in output (e.g., rate limit messages)
// contains filtered or unexported fields
}
CustomExecutor runs custom review scripts and streams output.
func (*CustomExecutor) Run ¶ added in v0.8.0
func (e *CustomExecutor) Run(ctx context.Context, promptContent string) Result
Run executes the custom review script with the prompt content written to a temp file. The script receives the path to the prompt file as its single argument. Output is streamed line-by-line to OutputHandler.
func (*CustomExecutor) SetRunner ¶ added in v0.8.0
func (e *CustomExecutor) SetRunner(r CustomRunner)
SetRunner sets the custom runner for testing purposes.
type CustomRunner ¶ added in v0.8.0
type CustomRunner interface {
Run(ctx context.Context, script, promptFile string) (stdout io.Reader, wait func() error, err error)
}
CustomRunner abstracts command execution for custom review scripts. Returns stdout reader and a wait function for completion.
type PatternMatchError ¶ added in v0.6.0
type PatternMatchError struct {
Pattern string // the pattern that matched
HelpCmd string // command to run for more information (e.g., "claude /usage")
}
PatternMatchError is returned when a configured error pattern is detected in output.
func (*PatternMatchError) Error ¶ added in v0.6.0
func (e *PatternMatchError) Error() string