Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns ~/.config/prr/config.json
func LoadCustomInstructions ¶
func LoadCustomInstructions() string
LoadCustomInstructions searches for a custom instructions file in the repo root and returns its contents. Returns empty string if no file is found.
Search order:
- .prr/instructions.md
- .github/prr-instructions.md
func LoadModels ¶
func LoadModels() (map[string]ModelConfig, error)
LoadModels returns model configs by merging embedded defaults with user overrides from ~/.config/prr/models.json. If the user file doesn't exist, it is created with the embedded defaults.
func LoadPipeTargets ¶ added in v1.3.0
LoadPipeTargets reads pipe targets from the config file. Returns nil (not an error) if the config doesn't exist or has no pipes configured.
func Save ¶
Save writes the config back to the default path, preserving any fields the user may have set manually. It re-reads the file first so that only known fields are overwritten (provider, model, parallel_reviews).
func ShouldExcludeFromReview ¶
ShouldExcludeFromReview returns true if the given file path should be excluded from AI review based on default exclusion patterns.
Types ¶
type Config ¶
type Config struct {
Provider string `json:"provider"` // "gemini", "anthropic", "openai"
APIKey string `json:"api_key"`
Model string `json:"model"`
Theme string `json:"theme,omitempty"` // UI theme ID (e.g. "catppuccin-mocha", "dracula")
ParallelReviews int `json:"parallel_reviews,omitempty"` // number of concurrent batch reviews (default 3)
Pipes []pipe.Target `json:"pipes,omitempty"` // external process pipe targets
Debug bool `json:"-"` // set via --debug flag, not persisted
}
Config holds the application configuration.
type ModelConfig ¶
type ModelConfig struct {
MaxOutputTokens int `json:"max_output_tokens"`
Temperature float64 `json:"temperature"`
ThinkingBudget int `json:"thinking_budget"` // 0 = thinking disabled for this model
}
ModelConfig holds per-model tuning parameters.
func GetModelConfig ¶
func GetModelConfig(models map[string]ModelConfig, modelID string) ModelConfig
GetModelConfig returns the config for a specific model. If no exact match, returns a sensible fallback.