Versions in this module Expand all Collapse all v0 v0.1.0 May 23, 2026 Changes in this version + var ErrEnvironmentClosed = errors.New("environment is closed") type Command + func ShellCommand(script string) *Command + func (c *Command) Validate() error type Executor + func (e *Executor) RunInteractiveTTY(ctx context.Context, cmd *Command, opts ...ExecOption) (*Result, error) type FileOption + func WithRecursive(recursive bool) FileOption type SudoOption + func WithSudoCustomFlags(flags ...string) SudoOption + func WithSudoGroup(group string) SudoOption + type TransportError struct + Command *Command + Err error + func (e *TransportError) Error() string + func (e *TransportError) Unwrap() error v0.0.3 Feb 6, 2026 Changes in this version + type Builder struct + func Cmd(binary string) *Builder + func (b *Builder) Arg(arg string) *Builder + func (b *Builder) Args(args ...string) *Builder + func (b *Builder) Build() *Command + func (b *Builder) Dir(dir string) *Builder + func (b *Builder) Env(key, value string) *Builder + func (b *Builder) Input(s string) *Builder + func (b *Builder) Stderr(w io.Writer) *Builder + func (b *Builder) Stdin(r io.Reader) *Builder + func (b *Builder) Stdout(w io.Writer) *Builder + func (b *Builder) Tty() *Builder type Environment + LookPath func(ctx context.Context, file string) (string, error) type ExecConfig + SudoConfig *SudoConfig + type SudoConfig struct + CustomFlags []string + Group string + PreserveEnv bool + User string + type SudoOption func(*SudoConfig) + func WithSudoPreserveEnv() SudoOption + func WithSudoUser(user string) SudoOption v0.0.2 Jan 23, 2026 v0.0.1 Jan 22, 2026 Changes in this version + var ErrNotSupported = errors.New("operation not supported") + type BufferedResult struct + Stderr []byte + Stdout []byte + type Command struct + Args []string + Cmd string + Dir string + Env []string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + Tty bool + func NewCommand(binary string, args ...string) *Command + func ParseCommand(cmdStr string) (*Command, error) + func (c *Command) String() string + type Environment interface + Download func(ctx context.Context, remotePath, localPath string, opts ...FileOption) error + Run func(ctx context.Context, cmd *Command) (*Result, error) + Start func(ctx context.Context, cmd *Command) (Process, error) + TargetOS func() TargetOS + Upload func(ctx context.Context, localPath, remotePath string, opts ...FileOption) error + type ExecConfig struct + RetryAttempts int + RetryDelay time.Duration + Sudo bool + type ExecOption func(*ExecConfig) + func WithRetry(attempts int, delay time.Duration) ExecOption + func WithSudo() ExecOption + type Executor struct + func NewExecutor(env Environment) *Executor + func (e *Executor) Download(ctx context.Context, remotePath, localPath string, opts ...FileOption) error + func (e *Executor) LookPath(ctx context.Context, file string) (string, error) + func (e *Executor) Run(ctx context.Context, cmd *Command, opts ...ExecOption) (*Result, error) + func (e *Executor) RunBuffered(ctx context.Context, cmd *Command, opts ...ExecOption) (*BufferedResult, error) + func (e *Executor) RunLineStream(ctx context.Context, cmd *Command, onLine func(string), _ ...ExecOption) error + func (e *Executor) RunShell(ctx context.Context, cmdStr string, opts ...ExecOption) (*BufferedResult, error) + func (e *Executor) Start(ctx context.Context, cmd *Command) (Process, error) + func (e *Executor) TargetOS() TargetOS + func (e *Executor) Upload(ctx context.Context, localPath, remotePath string, opts ...FileOption) error + type ExitError struct + Cause error + Command *Command + ExitCode int + Stderr []byte + func (e *ExitError) Error() string + func (e *ExitError) Unwrap() error + type FileConfig struct + GID int + Permissions os.FileMode + Progress ProgressFunc + Recursive bool + UID int + func DefaultFileConfig() FileConfig + type FileOption func(*FileConfig) + func WithOwner(uid, gid int) FileOption + func WithPermissions(mode os.FileMode) FileOption + func WithProgress(fn ProgressFunc) FileOption + type Process interface + Result func() *Result + Signal func(sig os.Signal) error + Wait func() error + type ProgressFunc func(current, total int64) + type Result struct + Duration time.Duration + Error error + ExitCode int + func (r *Result) Failed() bool + func (r *Result) Success() bool + type TargetOS int + const OSDarwin + const OSLinux + const OSUnknown + const OSWindows + func DetectLocalOS() TargetOS + func ParseTargetOS(osStr string) TargetOS + func (os TargetOS) ShellCommand(script string) *Command + func (os TargetOS) String() string