Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultModel = "claude-sonnet-4-5-20250929" AnalyzeModel = "claude-sonnet-4-5-20250929" PromptModel = "claude-opus-4-5-20251101" ValidationModel = "claude-haiku-4-5-20251001" )
Model constants define the Claude models used for different operations.
Variables ¶
View Source
var ValidConfigKeys = map[string]bool{ "model": true, "apiKey": true, }
ValidConfigKeys are the keys accepted by "config set".
Functions ¶
func MaskAPIKey ¶
MaskAPIKey masks all but the last 4 characters with *.
func Save ¶
func Save(cfg UserConfig) error
Save writes the config file, creating the directory with 0o700 and file with 0o600.
Types ¶
type ResolvedConfig ¶
type ResolvedConfig struct {
APIKey string
APIKeySource string
Model string
ModelSource string
AnalyzeModel string
PromptModel string
}
ResolvedConfig holds the final resolved values with their sources.
func Resolve ¶
func Resolve(flagAPIKey, flagModel string) ResolvedConfig
Resolve computes the final config from flags, env, and file. Priority for API key: flag > env > config file > (none). Priority for model: flag > CODE_REVIEW_CLI_MODEL env > config file > default.
type UserConfig ¶
type UserConfig struct {
APIKey string `json:"apiKey,omitempty"`
Model string `json:"model,omitempty"`
}
UserConfig is the on-disk JSON config.
func Load ¶
func Load() (UserConfig, error)
Load reads the config file. Returns empty config if not found.
Click to show internal directories.
Click to hide internal directories.