cli

package
v0.0.0-...-f9a56e6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MPL-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLibraryRepoURL is the default GitHub repository for browsing the library.
	DefaultLibraryRepoURL = "https://github.com/start-cli/library"
)

Library repository constants

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the root command. This is the main entry point for the CLI.

func IsSilentError

func IsSilentError(err error) bool

IsSilentError returns true if the error should not be printed to stderr. Used by main.go to suppress output for errors that only set the exit code.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd creates a new root command instance with all subcommands attached. This factory function ensures tests get isolated command instances with their own Flags.

Types

type AgentConfig

type AgentConfig struct {
	Name         string            `json:"name"`
	Bin          string            `json:"bin,omitempty"`
	Command      string            `json:"command,omitempty"`
	DefaultModel string            `json:"defaultModel,omitempty"`
	Description  string            `json:"description,omitempty"`
	Models       map[string]string `json:"models,omitempty"`
	Tags         []string          `json:"tags,omitempty"`
	Source       string            `json:"source"`           // "global" or "local"
	Origin       string            `json:"origin,omitempty"` // Registry module path when installed from registry
}

AgentConfig represents an agent configuration for editing.

type ConfigListItem

type ConfigListItem struct {
	Category     string            `json:"category"`
	Name         string            `json:"name"`
	Description  string            `json:"description,omitempty"`
	Bin          string            `json:"bin,omitempty"`
	Command      string            `json:"command,omitempty"`
	DefaultModel string            `json:"defaultModel,omitempty"`
	File         string            `json:"file,omitempty"`
	Prompt       string            `json:"prompt,omitempty"`
	Role         string            `json:"role,omitempty"`
	Required     bool              `json:"required,omitempty"`
	Default      bool              `json:"default,omitempty"`
	Optional     bool              `json:"optional,omitempty"`
	Models       map[string]string `json:"models,omitempty"`
	Tags         []string          `json:"tags,omitempty"`
	Source       string            `json:"source"`
	Origin       string            `json:"origin,omitempty"`
}

ConfigListItem represents a single configured item for JSON output. All optional fields use omitempty so absent fields are not emitted.

type ContextConfig

type ContextConfig struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	File        string   `json:"file,omitempty"`
	Command     string   `json:"command,omitempty"`
	Prompt      string   `json:"prompt,omitempty"`
	Required    bool     `json:"required,omitempty"`
	Default     bool     `json:"default,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Source      string   `json:"source"`           // "global" or "local"
	Origin      string   `json:"origin,omitempty"` // Registry module path when installed from registry
}

ContextConfig represents a context configuration for editing.

type DescribeResult

type DescribeResult struct {
	ItemType string    // "Agent", "Role", "Context", "Task"
	Category string    // "agents", "roles", "contexts", "tasks"
	CueKey   string    // Top-level CUE key (e.g., "agents")
	Name     string    // Item name
	Value    cue.Value // The CUE value for this item
	AllNames []string  // All available items of this type
}

DescribeResult holds the result of preparing describe output.

type ExecutionEnv

type ExecutionEnv struct {
	Cfg        internalcue.LoadResult
	WorkingDir string
	Agent      orchestration.Agent
	Composer   *orchestration.Composer
	Executor   *orchestration.Executor
}

ExecutionEnv holds the common execution environment for start and task commands.

type Flags

type Flags struct {
	Agent   string
	Role    string
	Model   string
	Context []string
	DryRun  bool
	Quiet   bool
	Verbose bool
	Debug   bool
	NoColor bool
	Local   bool
	NoRole  bool
}

Flags holds all CLI flag values. Each command instance gets its own Flags, enabling parallel test execution without shared state.

type InstalledModule

type InstalledModule struct {
	Category     string   `json:"category"`
	Name         string   `json:"name"`
	Description  string   `json:"description,omitempty"`
	Tags         []string `json:"tags,omitempty"`
	Models       []string `json:"models,omitempty"`
	InstalledVer string   `json:"version,omitempty"`
	LatestVer    string   `json:"latestVersion,omitempty"`
	UpdateAvail  bool     `json:"updateAvailable,omitempty"`
	Scope        string   `json:"scope"`
	Origin       string   `json:"origin"`
	ConfigFile   string   `json:"configFile"`
}

InstalledModule represents an installed module with version info.

type ModuleMatch

type ModuleMatch struct {
	Name     string
	Category string
	Source   ModuleSource
	Entry    registry.IndexEntry
	Score    int
}

ModuleMatch represents a single matched module during resolution.

type ModuleSource

type ModuleSource string

ModuleSource indicates where a module was found.

const (
	ModuleSourceInstalled ModuleSource = "installed"
	ModuleSourceRegistry  ModuleSource = "registry"
)

type RoleConfig

type RoleConfig struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	File        string   `json:"file,omitempty"`
	Command     string   `json:"command,omitempty"`
	Prompt      string   `json:"prompt,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Optional    bool     `json:"optional,omitempty"` // If true, skip gracefully when file is missing
	Source      string   `json:"source"`             // "global" or "local"
	Origin      string   `json:"origin,omitempty"`   // Registry module path when installed from registry
}

RoleConfig represents a role configuration for editing.

type TaskConfig

type TaskConfig struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	File        string   `json:"file,omitempty"`
	Command     string   `json:"command,omitempty"`
	Prompt      string   `json:"prompt,omitempty"`
	Role        string   `json:"role,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Source      string   `json:"source"`           // "global" or "local"
	Origin      string   `json:"origin,omitempty"` // Registry module path when installed from registry
}

TaskConfig represents a task configuration for editing.

type TaskMatch

type TaskMatch struct {
	Name   string              // Task name (e.g., "golang/debug")
	Source TaskSource          // Where the task comes from
	Entry  registry.IndexEntry // Registry entry (only set if Source == TaskSourceRegistry)
}

TaskMatch represents a task found during resolution.

type TaskSource

type TaskSource string

TaskSource indicates where a task comes from.

const (
	TaskSourceInstalled TaskSource = "installed"
	TaskSourceRegistry  TaskSource = "registry"
)

type UpdateResult

type UpdateResult struct {
	Module       InstalledModule `json:"module"`
	OldVersion   string          `json:"oldVersion,omitempty"`
	NewVersion   string          `json:"newVersion,omitempty"`
	Updated      bool            `json:"updated"`
	Error        error           `json:"-"`
	ErrorMessage string          `json:"error,omitempty"`
}

UpdateResult tracks the result of an update operation.

type ValidateCategoryResult

type ValidateCategoryResult struct {
	Name    string                 `json:"name"`
	Modules []ValidateModuleResult `json:"modules"`
}

ValidateCategoryResult holds per-category module results for JSON output.

type ValidateCheckResult

type ValidateCheckResult struct {
	Status  string `json:"status"`
	Label   string `json:"label"`
	Message string `json:"message,omitempty"`
}

ValidateCheckResult mirrors doctor.CheckResult for JSON output.

type ValidateIndexResult

type ValidateIndexResult struct {
	Checks []ValidateCheckResult `json:"checks"`
}

ValidateIndexResult holds the index validation checks for JSON output.

type ValidateModuleResult

type ValidateModuleResult struct {
	Name    string   `json:"name"`
	Version string   `json:"version,omitempty"`
	Status  string   `json:"status"`
	Issues  []string `json:"issues,omitempty"`
}

ValidateModuleResult holds per-module validation results for JSON output.

type ValidateResult

type ValidateResult struct {
	Index      ValidateIndexResult      `json:"index"`
	Categories []ValidateCategoryResult `json:"categories"`
	Stats      ValidateStatsResult      `json:"stats"`
}

ValidateResult is the top-level JSON output for modules validate.

type ValidateStatsResult

type ValidateStatsResult struct {
	Checked int `json:"checked"`
	Pass    int `json:"pass"`
	Fail    int `json:"fail"`
}

ValidateStatsResult holds summary statistics for JSON output.

Jump to

Keyboard shortcuts

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