Documentation
¶
Index ¶
- Constants
- func DetectCommands(ctx context.Context, claude *anthropic.Client, workDir string) ([]config.Command, error)
- func List(cfg *config.ProjectConfig, streams iostream.Streams) error
- func RunAll(ctx context.Context, workDir string, force bool, cfg *config.ProjectConfig, ...) error
- func RunDryRun(cfg *config.ProjectConfig, name string, streams iostream.Streams) error
- func RunInline(ctx context.Context, workDir, name, command string, force bool, ...) error
- func RunNamed(ctx context.Context, workDir, name string, force bool, ...) error
- func RunRemote(ctx context.Context, ...) error
- func Status(workDir, name string, cfg *config.ProjectConfig, streams iostream.Streams) error
- func WriteCache(workDir, name, fileExt string, exitCode int, output string) error
- type CachedResult
- type PackageManager
Constants ¶
const DefaultTimeout = 300
DefaultTimeout is the per-command execution timeout in seconds.
Variables ¶
This section is empty.
Functions ¶
func DetectCommands ¶ added in v0.7.2
func DetectCommands(ctx context.Context, claude *anthropic.Client, workDir string) ([]config.Command, error)
DetectCommands returns the full set of validate commands for the repo with metadata. For known toolchains it returns richer commands without calling Claude. Claude is only used as a fallback for unknown toolchains, and only when a client is provided.
func List ¶
func List(cfg *config.ProjectConfig, streams iostream.Streams) error
List prints all configured command names and their run strings.
func RunAll ¶
func RunAll(ctx context.Context, workDir string, force bool, cfg *config.ProjectConfig, streams iostream.Streams) error
RunAll runs all configured commands with optional cache bypass.
func RunInline ¶
func RunInline(ctx context.Context, workDir, name, command string, force bool, streams iostream.Streams) error
RunInline runs an inline command string, caching the result under the given name.
func RunNamed ¶
func RunNamed(ctx context.Context, workDir, name string, force bool, cfg *config.ProjectConfig, streams iostream.Streams) error
RunNamed runs a single named command from config with caching.
func RunRemote ¶
func RunRemote(ctx context.Context, exec func(ctx context.Context, script string) (stdout, stderr string, exitCode int, err error), cfg *config.ProjectConfig, dest string, streams iostream.Streams) error
RunRemote runs commands on a remote sandbox via SSH.
Types ¶
type CachedResult ¶
type CachedResult struct {
Status string `json:"status"` // "pass" or "fail"
ExitCode int `json:"exitCode"`
Output string `json:"output"`
ContentHash string `json:"contentHash"`
Timestamp int64 `json:"timestamp"`
}
CachedResult is the sentinel file format for validate command caching.
func CheckCache ¶
func CheckCache(workDir, name, fileExt string) *CachedResult
CheckCache reads a cached result and returns it if the content hash still matches. fileExt optionally scopes the content hash to files matching the extension.
type PackageManager ¶ added in v0.7.2
PackageManager holds the name and CI-safe install command for a detected package manager.
func DetectPackageManager ¶ added in v0.7.2
func DetectPackageManager(workDir string) *PackageManager
DetectPackageManager returns the detected package manager and its CI-safe install command, or nil.