Documentation
¶
Overview ¶
Package config loads and merges git-courer configuration. Merge order: defaults → global (~/.config/git-courer/config.yaml) → project (.gcourer/config.yaml).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalConfigPath ¶
func GlobalConfigPath() string
GlobalConfigPath returns the platform-appropriate global config path.
func ProjectConfigPaths ¶
ProjectConfigPaths returns possible project config paths (first match wins).
Types ¶
type CommitConfig ¶
type CommitConfig struct {
TTL DurationConfig `yaml:"ttl"`
MaxPlanRetries int `yaml:"max_plan_retries"`
LockFile string `yaml:"lock_file"`
PlanFile string `yaml:"plan_file"`
BlockerFile string `yaml:"blocker_file"`
LogPath string `yaml:"log_path"`
MaxLogLines int `yaml:"max_log_lines"`
BackgroundThreshold int `yaml:"background_threshold"`
}
CommitConfig holds commit-related settings including plan TTL and file paths.
type Config ¶
type Config struct {
Ollama OllamaConfig `yaml:"ollama"`
Git GitConfig `yaml:"git"`
Secrets SecretsConfig `yaml:"secrets"`
Validation ValidationConfig `yaml:"validation"`
UI UIConfig `yaml:"ui"`
MCP MCPConfig `yaml:"mcp"`
Preview PreviewConfig `yaml:"preview"`
Commit CommitConfig `yaml:"commit"`
Release ReleaseConfig `yaml:"release"`
}
Config represents the git-courer configuration.
func LoadFromDir ¶
LoadFromDir loads configuration with cascade: defaults → global → project.
func (*Config) SaveGlobal ¶
SaveGlobal saves the config to the global config path.
type DurationConfig ¶
DurationConfig wraps time.Duration for YAML unmarshaling.
func NewDurationConfig ¶
func NewDurationConfig(d time.Duration) DurationConfig
NewDurationConfig creates a DurationConfig with the given duration.
func (DurationConfig) MarshalYAML ¶
func (d DurationConfig) MarshalYAML() (interface{}, error)
MarshalYAML implements custom marshaling for DurationConfig.
func (*DurationConfig) UnmarshalYAML ¶
func (d *DurationConfig) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML implements custom unmarshaling for DurationConfig.
type GitConfig ¶
type GitConfig struct {
WorkDir string `yaml:"workdir"`
AutoAddSecrets bool `yaml:"auto_add_secrets"`
RequireCleanRepo bool `yaml:"require_clean_repo"`
}
GitConfig holds git-related settings.
type OllamaConfig ¶
type OllamaConfig struct {
Host string `yaml:"host"`
Model string `yaml:"model"`
ContextWindow int `yaml:"context_window"`
AutoStart bool `yaml:"auto_start"`
ModelsDir string `yaml:"models_dir"`
}
OllamaConfig holds Ollama-related settings.
type PreviewConfig ¶
type PreviewConfig struct {
Enabled bool `yaml:"enabled"`
Operations map[string]bool `yaml:"operations"`
}
PreviewConfig holds preview/confirmation settings.
func (PreviewConfig) IsRequired ¶
func (p PreviewConfig) IsRequired(operationKey string) bool
IsRequired returns true if confirmation is required for the given operation key.
type ReleaseConfig ¶
type ReleaseConfig struct {
LogPath string `yaml:"log_path"`
MaxLogLines int `yaml:"max_log_lines"`
MaxCommitsPerChunk int `yaml:"max_commits_per_chunk"`
ChangelogPath string `yaml:"changelog_path"`
IntentPath string `yaml:"intent_path"`
}
ReleaseConfig holds release-related settings.
type SecretsConfig ¶
type SecretsConfig struct {
DetectionMode string `yaml:"detection_mode"`
Patterns []string `yaml:"patterns"`
UseLLMSecurityScan string `yaml:"use_llm_security_scan"`
}
SecretsConfig holds secrets detection settings.
type ValidationConfig ¶
type ValidationConfig struct {
RequireConfirmation bool `yaml:"require_confirmation"`
MaxCommitLength int `yaml:"max_commit_length"`
}
ValidationConfig holds validation settings.