config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the path to the user's config directory

func ConfigFile

func ConfigFile() string

ConfigFile returns the path to the config file

func IsValidCompletionAction

func IsValidCompletionAction(action string) bool

IsValidCompletionAction checks if the given action is valid

func SetDefaults

func SetDefaults()

SetDefaults registers default values with viper

func ValidCompletionActions

func ValidCompletionActions() []string

ValidCompletionActions returns the list of valid completion action values

Types

type BranchConfig

type BranchConfig struct {
	// Prefix is the branch name prefix (default: "claudio")
	// Examples: "claudio", "Iron-Ham", "feature"
	Prefix string `mapstructure:"prefix"`
	// IncludeID includes the instance ID in branch names (default: true)
	// When true: <prefix>/<id>-<slug>
	// When false: <prefix>/<slug>
	IncludeID bool `mapstructure:"include_id"`
}

BranchConfig controls branch naming conventions

type CleanupConfig

type CleanupConfig struct {
	// WarnOnStale shows a warning on start if stale resources exist (default: true)
	WarnOnStale bool `mapstructure:"warn_on_stale"`
	// KeepRemoteBranches prevents deletion of branches that exist on remote (default: true)
	KeepRemoteBranches bool `mapstructure:"keep_remote_branches"`
}

CleanupConfig controls automatic and manual cleanup behavior

type CompletionConfig

type CompletionConfig struct {
	// DefaultAction is the action to take when an instance completes
	// Options: "prompt", "keep_branch", "merge_staging", "merge_main", "auto_pr"
	DefaultAction string `mapstructure:"default_action"`
}

CompletionConfig controls what happens when an instance completes

type Config

type Config struct {
	Completion CompletionConfig `mapstructure:"completion"`
	TUI        TUIConfig        `mapstructure:"tui"`
	Session    SessionConfig    `mapstructure:"session"`
	Instance   InstanceConfig   `mapstructure:"instance"`
	Branch     BranchConfig     `mapstructure:"branch"`
	PR         PRConfig         `mapstructure:"pr"`
	Cleanup    CleanupConfig    `mapstructure:"cleanup"`
	Resources  ResourceConfig   `mapstructure:"resources"`
	Ultraplan  UltraplanConfig  `mapstructure:"ultraplan"`
}

Config represents the complete Claudio configuration

func Default

func Default() *Config

Default returns a Config with sensible default values

func Get

func Get() *Config

Get returns the current configuration (convenience function)

func Load

func Load() (*Config, error)

Load reads the configuration from viper into a Config struct

type InstanceConfig

type InstanceConfig struct {
	// OutputBufferSize is the size of the output ring buffer in bytes
	OutputBufferSize int `mapstructure:"output_buffer_size"`
	// CaptureInterval is how often to capture output from tmux (in milliseconds)
	CaptureIntervalMs int `mapstructure:"capture_interval_ms"`
	// TmuxWidth is the width of the tmux pane
	TmuxWidth int `mapstructure:"tmux_width"`
	// TmuxHeight is the height of the tmux pane
	TmuxHeight int `mapstructure:"tmux_height"`
	// ActivityTimeoutMinutes is the number of minutes of no new output before marking as stuck (0 = disabled)
	ActivityTimeoutMinutes int `mapstructure:"activity_timeout_minutes"`
	// CompletionTimeoutMinutes is the maximum total runtime in minutes before marking as timeout (0 = disabled)
	CompletionTimeoutMinutes int `mapstructure:"completion_timeout_minutes"`
	// StaleDetection enables detection of stuck instances via output pattern analysis
	StaleDetection bool `mapstructure:"stale_detection"`
}

InstanceConfig controls instance behavior

func (*InstanceConfig) ActivityTimeout

func (c *InstanceConfig) ActivityTimeout() time.Duration

ActivityTimeout returns the activity timeout as a time.Duration (0 means disabled)

func (*InstanceConfig) CaptureInterval

func (c *InstanceConfig) CaptureInterval() time.Duration

CaptureInterval returns the capture interval as a time.Duration

func (*InstanceConfig) CompletionTimeout

func (c *InstanceConfig) CompletionTimeout() time.Duration

CompletionTimeout returns the completion timeout as a time.Duration (0 means disabled)

type NotificationConfig

type NotificationConfig struct {
	// Enabled controls whether notifications are played (default: true)
	Enabled bool `mapstructure:"enabled"`
	// UseSound plays system sound on macOS in addition to bell (default: false)
	UseSound bool `mapstructure:"use_sound"`
	// SoundPath custom sound file path (macOS only, default: system Glass sound)
	SoundPath string `mapstructure:"sound_path"`
}

NotificationConfig controls notification behavior for ultraplan

type PRConfig

type PRConfig struct {
	// Draft creates PRs as drafts by default
	Draft bool `mapstructure:"draft"`
	// AutoRebase rebases on main before creating PR (default: true)
	AutoRebase bool `mapstructure:"auto_rebase"`
	// UseAI uses Claude to generate PR title and description (default: true)
	UseAI bool `mapstructure:"use_ai"`
	// AutoPROnStop automatically creates a PR when an instance is stopped with 'x' (default: false)
	AutoPROnStop bool `mapstructure:"auto_pr_on_stop"`
	// Template is a custom PR body template using Go text/template syntax
	Template string `mapstructure:"template"`
	// Reviewers configuration for automatic reviewer assignment
	Reviewers ReviewerConfig `mapstructure:"reviewers"`
	// Labels to add to all PRs by default
	Labels []string `mapstructure:"labels"`
}

PRConfig controls pull request creation behavior

type ResourceConfig

type ResourceConfig struct {
	// CostWarningThreshold triggers a warning when session cost exceeds this amount (USD)
	CostWarningThreshold float64 `mapstructure:"cost_warning_threshold"`
	// CostLimit pauses all instances when session cost exceeds this amount (USD), 0 = no limit
	CostLimit float64 `mapstructure:"cost_limit"`
	// TokenLimitPerInstance limits tokens per instance, 0 = no limit
	TokenLimitPerInstance int64 `mapstructure:"token_limit_per_instance"`
	// ShowMetricsInSidebar shows token/cost metrics in TUI sidebar
	ShowMetricsInSidebar bool `mapstructure:"show_metrics_in_sidebar"`
}

ResourceConfig controls resource monitoring and cost tracking

type ReviewerConfig

type ReviewerConfig struct {
	// Default reviewers to always assign
	Default []string `mapstructure:"default"`
	// ByPath maps file path patterns to reviewers (glob patterns supported)
	ByPath map[string][]string `mapstructure:"by_path"`
}

ReviewerConfig controls automatic reviewer assignment

type SessionConfig

type SessionConfig struct {
}

SessionConfig controls session behavior

type TUIConfig

type TUIConfig struct {
	// AutoFocusOnInput automatically focuses new instances for input
	AutoFocusOnInput bool `mapstructure:"auto_focus_on_input"`
	// MaxOutputLines limits how many lines of output to display per instance
	MaxOutputLines int `mapstructure:"max_output_lines"`
}

TUIConfig controls the terminal UI behavior

type UltraplanConfig

type UltraplanConfig struct {
	// Notifications controls audio notifications for user input
	Notifications NotificationConfig `mapstructure:"notifications"`
}

UltraplanConfig controls ultraplan behavior

Jump to

Keyboard shortcuts

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