Documentation
¶
Index ¶
- Variables
- func ConfigDir() (string, error)
- func ConfigPath() (string, error)
- func DetectAvailableAgent(agents map[string]AgentConfig) string
- func LoadWithValidation(path string) (*Config, *ValidationResult, error)
- type AgentConfig
- type BehaviorSettings
- type BoardSettings
- type CleanupSettings
- type Config
- type OpencodeSettings
- type UIConfig
- type ValidationError
- type ValidationResult
- func (r *ValidationResult) AddError(section, field, message string, value any)
- func (r *ValidationResult) AddWarning(section, field, message string, value any)
- func (r *ValidationResult) FormatErrors() string
- func (r *ValidationResult) FormatWarnings() string
- func (r *ValidationResult) HasErrors() bool
- func (r *ValidationResult) HasWarnings() bool
Constants ¶
This section is empty.
Variables ¶
var AgentPriority = []string{"opencode", "claude", "aider"}
AgentPriority defines the order in which agents are preferred when auto-detecting. The first available agent in this list becomes the default.
Functions ¶
func DetectAvailableAgent ¶ added in v0.0.3
func DetectAvailableAgent(agents map[string]AgentConfig) string
DetectAvailableAgent returns the first agent from the priority list whose command is available in PATH. Falls back to the first priority agent if none are found (user may install later).
func LoadWithValidation ¶
func LoadWithValidation(path string) (*Config, *ValidationResult, error)
LoadWithValidation loads config and returns structured validation result
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Command string `json:"command"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
StatusFile string `json:"status_file"`
InitPrompt string `json:"init_prompt"`
}
AgentConfig defines how to spawn and monitor an AI agent
type BehaviorSettings ¶
type BehaviorSettings struct {
ConfirmQuitWithAgents bool `json:"confirm_quit_with_agents"` // Prompt before quitting with running agents
}
BehaviorSettings controls application behavior preferences
type BoardSettings ¶
type BoardSettings struct {
DefaultAgent string `json:"default_agent"`
WorktreeBase string `json:"worktree_base"`
AutoSpawnAgent bool `json:"auto_spawn_agent"`
AutoCreateBranch bool `json:"auto_create_branch"`
BranchPrefix string `json:"branch_prefix"`
BranchNaming string `json:"branch_naming"` // "template" | "ai" | "prompt"
BranchTemplate string `json:"branch_template"` // e.g., "{prefix}{slug}"
SlugMaxLength int `json:"slug_max_length"` // default: 40
InitPrompt string `json:"init_prompt"`
}
BoardSettings contains default settings for boards
type CleanupSettings ¶
type CleanupSettings struct {
DeleteWorktree bool `json:"delete_worktree"` // Remove git worktree on ticket delete
DeleteBranch bool `json:"delete_branch"` // Delete git branch after worktree removal
ForceWorktreeRemoval bool `json:"force_worktree_removal"` // Force removal even with uncommitted changes
}
CleanupSettings controls cleanup behavior when deleting tickets
type Config ¶
type Config struct {
Defaults BoardSettings `json:"defaults"`
Agents map[string]AgentConfig `json:"agents"`
UI UIConfig `json:"ui"`
Cleanup CleanupSettings `json:"cleanup"`
Behavior BehaviorSettings `json:"behavior"`
Opencode OpencodeSettings `json:"opencode"`
Keys map[string]string `json:"keys,omitempty"`
}
Config holds the global application configuration
func (*Config) GetEffectiveInitPrompt ¶
func (*Config) Validate ¶
func (c *Config) Validate() *ValidationResult
Validate performs full config validation and returns all errors and warnings
type OpencodeSettings ¶
type OpencodeSettings struct {
ServerEnabled bool `json:"server_enabled"` // Start opencode server for enhanced status detection
ServerPort int `json:"server_port"` // Port for opencode server (default: 4096)
PollInterval int `json:"poll_interval"` // Status polling interval in seconds (default: 1)
}
OpencodeSettings controls OpenCode server integration
type UIConfig ¶
type UIConfig struct {
Theme string `json:"theme"`
ShowAgentStatus bool `json:"show_agent_status"`
RefreshInterval int `json:"refresh_interval"`
ColumnWidth int `json:"column_width"`
TicketHeight int `json:"ticket_height"`
SidebarVisible bool `json:"sidebar_visible"`
}
UIConfig holds UI-related preferences
type ValidationError ¶
type ValidationError struct {
Section string // "defaults", "agents.claude", "ui", etc.
Field string // "command", "branch_naming", etc.
Message string // Human-readable error
Value any // The invalid value (for display)
}
ValidationError represents a single config validation issue
type ValidationResult ¶
type ValidationResult struct {
Errors []ValidationError
Warnings []ValidationError
}
ValidationResult holds all validation errors and warnings
func (*ValidationResult) AddError ¶
func (r *ValidationResult) AddError(section, field, message string, value any)
AddError adds a validation error
func (*ValidationResult) AddWarning ¶
func (r *ValidationResult) AddWarning(section, field, message string, value any)
AddWarning adds a validation warning
func (*ValidationResult) FormatErrors ¶
func (r *ValidationResult) FormatErrors() string
FormatErrors returns a formatted string of all errors for CLI output
func (*ValidationResult) FormatWarnings ¶
func (r *ValidationResult) FormatWarnings() string
FormatWarnings returns a formatted string of all warnings for CLI output
func (*ValidationResult) HasErrors ¶
func (r *ValidationResult) HasErrors() bool
HasErrors returns true if there are any validation errors
func (*ValidationResult) HasWarnings ¶
func (r *ValidationResult) HasWarnings() bool
HasWarnings returns true if there are any validation warnings