executil

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package executil provides helpers for templated shell execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommand

func BuildCommand(ctx context.Context, command string, args []string, env map[string]string, data TemplateData) (*exec.Cmd, error)

BuildCommand builds an exec.Cmd with rendered command, args and env.

func RenderTemplate

func RenderTemplate(value string, data TemplateData) (string, error)

RenderTemplate renders a string template with TemplateData.

func RunCommand

func RunCommand(ctx context.Context, command string, args []string, env map[string]string, data TemplateData) (string, int, error)

RunCommand executes a command and returns output, exit code, and error.

Types

type TemplateData

type TemplateData struct {
	// Args are tool arguments.
	Args map[string]any
	// ToolName is the tool name.
	ToolName string
	// CorrelationID links related operations.
	CorrelationID string
}

TemplateData defines the available fields in command templates.

Jump to

Keyboard shortcuts

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