executor

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(commands []llm.Command, cfg *config.Config, shellInfo shell.Info, explain bool) error

Run executes a list of commands sequentially, prompting for confirmation as needed.

func ShouldConfirm

func ShouldConfirm(cmd llm.Command, cfg *config.Config) bool

ShouldConfirm determines whether a command needs user confirmation before execution.

Decision matrix:

always_confirm=true        → confirm
risky                      → confirm
safe + allowlisted         → auto-execute
safe + certainty ≥ min     → auto-execute
safe + certainty < min     → confirm

Types

type CommandResult added in v0.1.4

type CommandResult struct {
	Index     int
	Command   llm.Command
	Confirmed bool
	Skipped   bool
	ExitCode  int
	Stdout    string
	Stderr    string
	Error     string
	StartedAt time.Time
	Duration  time.Duration
}

type RunResult added in v0.1.4

type RunResult struct {
	Commands []CommandResult
}

func RunWithResults added in v0.1.4

func RunWithResults(commands []llm.Command, cfg *config.Config, shellInfo shell.Info, explain bool) (*RunResult, error)

func (*RunResult) FirstFailure added in v0.1.4

func (r *RunResult) FirstFailure() *CommandResult

Jump to

Keyboard shortcuts

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