cli

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Package cli provides the command-line interface for ReleasePilot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup()

Cleanup closes any open resources. Should be called before program exit.

func Execute

func Execute() error

Execute runs the root command.

func ExecuteContext

func ExecuteContext(ctx context.Context) error

ExecuteContext runs the root command with a context for graceful shutdown.

func IsCIMode

func IsCIMode() bool

IsCIMode returns true if running in CI/CD mode.

func IsJSONOutput

func IsJSONOutput() bool

IsJSONOutput returns true if JSON output is enabled.

func SetVersionInfo

func SetVersionInfo(version, commit, date string)

SetVersionInfo sets the version information from main.

Types

type ApproveOptions

type ApproveOptions struct {
	CommandOptions
	Edit bool
}

ApproveOptions holds options for the approve command.

type BlastOptions

type BlastOptions struct {
	CommandOptions
	Paths         []string
	IncludeShared bool
	OutputFormat  string
}

BlastOptions holds options for the blast command.

type BumpOptions

type BumpOptions struct {
	CommandOptions
	ReleaseType     string
	Prerelease      string
	BuildMetadata   string
	SkipTag         bool
	SkipPush        bool
	ForceVersion    string
	GenerateNotes   bool
	UpdateChangelog bool
	NoGitTag        bool
	NoCommit        bool
}

BumpOptions holds options for the bump command.

type CommandOptions

type CommandOptions struct {
	*Options
}

CommandOptions holds options for a specific command. Embed this in command-specific option structs.

type ComponentHealth

type ComponentHealth struct {
	Name    string            `json:"name"`
	Status  HealthStatus      `json:"status"`
	Message string            `json:"message,omitempty"`
	Details map[string]string `json:"details,omitempty"`
	Latency time.Duration     `json:"latency_ms,omitempty"`
}

ComponentHealth represents the health of a single component.

type HealthOptions

type HealthOptions struct {
	CommandOptions
}

HealthOptions holds options for the health command.

type HealthReport

type HealthReport struct {
	Status      HealthStatus      `json:"status"`
	Version     string            `json:"version"`
	Timestamp   time.Time         `json:"timestamp"`
	Components  []ComponentHealth `json:"components"`
	Environment map[string]string `json:"environment,omitempty"`
}

HealthReport contains the full health check results.

type HealthStatus

type HealthStatus string

HealthStatus represents the overall health status.

const (
	// HealthStatusHealthy indicates all checks passed.
	HealthStatusHealthy HealthStatus = "healthy"
	// HealthStatusDegraded indicates some non-critical checks failed.
	HealthStatusDegraded HealthStatus = "degraded"
	// HealthStatusUnhealthy indicates critical checks failed.
	HealthStatusUnhealthy HealthStatus = "unhealthy"
)

type MetricsOptions

type MetricsOptions struct {
	CommandOptions
}

MetricsOptions holds options for the metrics command.

type NotesOptions

type NotesOptions struct {
	CommandOptions
	NoAI        bool
	OutputFile  string
	Template    string
	Format      string
	FromVersion string
}

NotesOptions holds options for the notes command.

type Options

type Options struct {
	// Version information
	Version VersionInfo

	// Global flags
	ConfigFile string
	Verbose    bool
	DryRun     bool
	JSONOutput bool
	NoColor    bool
	LogLevel   string
	Model      string
	CIMode     bool

	// Runtime state
	Config  *config.Config
	Logger  *log.Logger
	LogFile *os.File
	Styles  Styles

	// I/O streams (for testing)
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
}

Options holds the CLI runtime options and dependencies. This struct encapsulates the global state for better testability and dependency injection.

func NewOptions

func NewOptions() *Options

NewOptions creates a new Options instance with default values.

func (*Options) Cleanup

func (o *Options) Cleanup()

Cleanup closes any open resources.

func (*Options) IsCI

func (o *Options) IsCI() bool

IsCI returns true if running in CI/CD mode.

func (*Options) IsDryRun

func (o *Options) IsDryRun() bool

IsDryRun returns true if dry-run mode is enabled.

func (*Options) IsJSON

func (o *Options) IsJSON() bool

IsJSON returns true if JSON output is enabled.

func (*Options) IsVerbose

func (o *Options) IsVerbose() bool

IsVerbose returns true if verbose output is enabled.

func (*Options) PrintError

func (o *Options) PrintError(msg string)

PrintError prints an error message.

func (*Options) PrintInfo

func (o *Options) PrintInfo(msg string)

PrintInfo prints an info message.

func (*Options) PrintSubtle

func (o *Options) PrintSubtle(msg string)

PrintSubtle prints subtle/muted text.

func (*Options) PrintSuccess

func (o *Options) PrintSuccess(msg string)

PrintSuccess prints a success message.

func (*Options) PrintTitle

func (o *Options) PrintTitle(msg string)

PrintTitle prints a title.

func (*Options) PrintWarning

func (o *Options) PrintWarning(msg string)

PrintWarning prints a warning message.

func (*Options) SetVersion

func (o *Options) SetVersion(version, commit, date string)

SetVersion sets the version information.

type PlanOptions

type PlanOptions struct {
	CommandOptions
	FromRef string
	ToRef   string
	ShowAll bool
	Minimal bool
}

PlanOptions holds options for the plan command.

type PublishOptions

type PublishOptions struct {
	CommandOptions
	SkipPlugins []string
	OnlyPlugins []string
	Force       bool
}

PublishOptions holds options for the publish command.

type Styles

type Styles struct {
	Title   lipgloss.Style
	Success lipgloss.Style
	Error   lipgloss.Style
	Warning lipgloss.Style
	Info    lipgloss.Style
	Subtle  lipgloss.Style
	Bold    lipgloss.Style
}

Styles holds the CLI styling configuration.

func DefaultStyles

func DefaultStyles() Styles

DefaultStyles returns the default CLI styles.

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

VersionInfo holds version metadata.

Jump to

Keyboard shortcuts

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