cli

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxIterations limits how many batches we fetch to prevent infinite loops
	MaxIterations = 10
	// BatchSize is the number of runs to fetch in each iteration
	BatchSize = 20
)

Constants for the iterative algorithm

Variables

View Source
var ErrNoArtifacts = errors.New("no artifacts found for this run")

ErrNoArtifacts indicates that a workflow run has no artifacts

Functions

func AddWorkflow

func AddWorkflow(workflow string, number int, verbose bool, engineOverride string, name string, force bool) error

AddWorkflow adds a workflow from components to .github/workflows

func AddWorkflowWithRepo

func AddWorkflowWithRepo(workflow string, number int, verbose bool, engineOverride string, repoSpec string, name string, force bool) error

AddWorkflowWithRepo adds a workflow from components to .github/workflows with optional repository installation

func AddWorkflowWithRepoAndPR

func AddWorkflowWithRepoAndPR(workflow string, number int, verbose bool, engineOverride string, repoSpec string, name string, force bool) error

AddWorkflowWithRepoAndPR adds a workflow from components to .github/workflows with optional repository installation and creates a PR

func CompileWorkflows

func CompileWorkflows(markdownFile string, verbose bool, engineOverride string, validate bool, autoCompile bool, watch bool, writeInstructions bool) error

CompileWorkflows compiles markdown files into GitHub Actions workflow files

func DisableWorkflows

func DisableWorkflows(pattern string) error

DisableWorkflows disables workflows matching a pattern

func DownloadWorkflowLogs

func DownloadWorkflowLogs(workflowName string, count int, startDate, endDate, outputDir string, verbose bool) error

DownloadWorkflowLogs downloads and analyzes workflow logs with metrics

func EnableWorkflows

func EnableWorkflows(pattern string) error

EnableWorkflows enables workflows matching a pattern

func GetVersion

func GetVersion() string

GetVersion returns the current version

func InspectWorkflowMCP

func InspectWorkflowMCP(workflowFile string, serverFilter string, verbose bool) error

InspectWorkflowMCP inspects MCP servers used by a workflow and lists available tools, resources, and roots

func InstallPackage

func InstallPackage(repoSpec string, local bool, verbose bool) error

InstallPackage installs agent workflows from a GitHub repository

func IsRunnable

func IsRunnable(markdownPath string) (bool, error)

IsRunnable checks if a workflow can be run locally (has schedule or workflow_dispatch trigger)

func ListPackages

func ListPackages(local bool, verbose bool) error

ListPackages lists all installed packages

func ListWorkflows

func ListWorkflows(verbose bool) error

ListWorkflows lists available workflow components

func NewInspectCommand

func NewInspectCommand() *cobra.Command

NewInspectCommand creates the inspect command

func NewLogsCommand

func NewLogsCommand() *cobra.Command

NewLogsCommand creates the logs command

func NewWorkflow

func NewWorkflow(workflowName string, verbose bool, force bool) error

NewWorkflow creates a new workflow markdown file with template content

func RemoveWorkflows

func RemoveWorkflows(pattern string, keepOrphans bool) error

RemoveWorkflows removes workflows matching a pattern

func RunWorkflowOnGitHub

func RunWorkflowOnGitHub(workflowIdOrName string, verbose bool) error

RunWorkflowOnGitHub runs an agentic workflow on GitHub Actions

func SetVersionInfo

func SetVersionInfo(v string)

SetVersionInfo sets the version information for the CLI

func StatusWorkflows

func StatusWorkflows(pattern string, verbose bool) error

func UninstallPackage

func UninstallPackage(repoSpec string, local bool, verbose bool) error

UninstallPackage removes an installed package

Types

type GitHubWorkflow

type GitHubWorkflow struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Path  string `json:"path"`
	State string `json:"state"`
}

GitHubWorkflow represents a GitHub Actions workflow from the API

type IncludeDependency

type IncludeDependency struct {
	SourcePath string // Path in the source (local)
	TargetPath string // Relative path where it should be copied in .github/workflows
}

IncludeDependency represents a file dependency from @include directives

type JSONMetrics

type JSONMetrics struct {
	TokenUsage    int
	EstimatedCost float64
	Timestamp     time.Time
}

JSONMetrics represents metrics extracted from JSON log entries

type LogMetrics

type LogMetrics struct {
	Duration      time.Duration
	TokenUsage    int
	EstimatedCost float64
	ErrorCount    int
	WarningCount  int
}

LogMetrics represents extracted metrics from log files

type Package

type Package struct {
	Name      string
	Path      string
	Workflows []string
	CommitSHA string
}

Package represents an installed package

type WorkflowMatch

type WorkflowMatch struct {
	Path        string
	PackageName string
	Org         string
	Repo        string
}

WorkflowMatch represents a workflow match in package search

type WorkflowRun

type WorkflowRun struct {
	DatabaseID    int64     `json:"databaseId"`
	Number        int       `json:"number"`
	URL           string    `json:"url"`
	Status        string    `json:"status"`
	Conclusion    string    `json:"conclusion"`
	WorkflowName  string    `json:"workflowName"`
	CreatedAt     time.Time `json:"createdAt"`
	StartedAt     time.Time `json:"startedAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
	Event         string    `json:"event"`
	HeadBranch    string    `json:"headBranch"`
	HeadSha       string    `json:"headSha"`
	DisplayTitle  string    `json:"displayTitle"`
	Duration      time.Duration
	TokenUsage    int
	EstimatedCost float64
	LogsPath      string
}

WorkflowRun represents a GitHub Actions workflow run with metrics

type WorkflowSourceInfo

type WorkflowSourceInfo struct {
	IsPackage          bool
	PackagePath        string
	QualifiedName      string
	NeedsQualifiedName bool
	SourcePath         string
}

WorkflowSourceInfo contains information about where a workflow was found

Jump to

Keyboard shortcuts

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