commandop

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOp

func GetOp() ops.RegisterableOp

NewCommandExecutionActivity creates a new command execution activity that implements RegisterableOp

Types

type CommandExecutionConfig

type CommandExecutionConfig struct {
	// Optional: working directory for command execution
	WorkingDir string `json:"working_dir"`
	// Optional: shell to use (bash, sh, powershell, cmd)
	Shell string `json:"shell"`
	// Optional: environment variables
	Env map[string]string `json:"env"`
}

CommandExecutionConfig defines the configuration for command execution activities - ALL fields MUST have json tags

type CommandExecutionInput

type CommandExecutionInput struct {
	Run              string                `json:"run" validate:"required"`                                                // Required: command to execute
	WorkingDirectory string                `json:"working_directory" default:"{{ context.environment.op.worktree_path }}"` // Optional: override working directory
	Shell            string                `json:"shell" validate:"omitempty,oneof=bash sh powershell cmd"`                // Optional: override shell
	Env              map[string]string     `json:"env"`                                                                    // Optional: additional env vars
	Sandbox          *process.SandboxInput `json:"sandbox,omitempty"`                                                      // Optional: sandbox execution mode
	ContinueOnError  bool                  `json:"continue_on_error"`                                                      // Optional: don't fail on non-zero exit
	Timeout          string                `json:"timeout"`                                                                // Optional: timeout duration (e.g., "30s")
}

CommandExecutionInput defines the input for command execution activities - ALL fields MUST have json tags

type CommandExecutionOutput

type CommandExecutionOutput struct {
	Stdout       string `json:"stdout"`        // Standard output
	Stderr       string `json:"stderr"`        // Standard error
	ExitCode     int    `json:"exit_code"`     // Process exit code
	Success      bool   `json:"success"`       // Whether command succeeded
	TimedOut     bool   `json:"timed_out"`     // Whether command timed out
	ErrorMessage string `json:"error_message"` // Error message if failed
}

CommandExecutionOutput defines the output from command execution activities - ALL fields MUST have json tags

Jump to

Keyboard shortcuts

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