sbxexec

package
v0.0.0-...-a77abd7 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sbxexec provides the provider-agnostic sbx subprocess runner shared by the crush and opencode sandbox kit packages. Only the subprocess boundary lives here; package-specific pipeline steps continue to live beside their package-local state types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSbxCommand

func RunSbxCommand(spec CommandSpec) IOE.IOEither[error, F.Void]

RunSbxCommand looks up the sbx binary then runs the command under spec.Ctx, optionally piping Stdin. The context governs cancellation and deadlines: when it is cancelled, the spawned process is killed. Returns Left on lookup failure or non-zero exit.

exec.CommandContext is used instead of a bare &exec.Cmd{} so that spec.Ctx actually drives process lifetime. gosec rule G204 flags any subprocess launched with non-constant arguments; here spec.Args is built from validated CLI input inside this same process (never a raw shell string), so the directive is a false positive and is suppressed locally.

Types

type CommandSpec

type CommandSpec struct {
	Ctx   context.Context // context for command cancellation/deadline
	Bin   string          // binary name, e.g. "sbx"
	Args  []string        // full argument list
	Stdin string          // optional content piped to stdin
}

CommandSpec holds a resolved sbx CLI invocation.

Jump to

Keyboard shortcuts

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