Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultProfileName ¶
DefaultProfileName returns the configured default profile name, if any. The local .sift.toml takes precedence over the global config.
func RegisterFlags ¶
RegisterFlags binds every config option to fs, using the current field values as flag defaults.
Types ¶
type Config ¶
type Config struct {
// Directory settings
RootDir string
// Logging settings
Verbose bool
Quiet bool
LogLevel string
NoColor bool
UseColors bool
Highlight bool
NoHighlight bool
Theme string
// UITheme is the persisted interactive picker palette. It is separate
// from Theme, which controls syntax highlighting.
UITheme string
HighlightMaxBytes int
WindowTitle string
NoWindowTitle bool
OutputFile string
ShowSkipped bool
// Processing settings
Concurrent bool
MaxWorkers int
MaxFileSizeMB int64
ShowProgress bool
Timeout time.Duration
// Filtering settings
IgnoreHidden bool
IgnoreGit bool
CustomIgnore string
Extensions string
IncludeBinary bool
// SmartFilter skips generated/lock/minified artifacts and oversized files.
SmartFilter bool
SmartMaxTokens int
// Output format
Style string
JSONOutput bool
MarkdownOutput bool
// NoNerdFonts forces ASCII glyphs in the interactive picker.
NoNerdFonts bool
// Scoring tunes the relevance and selection optimizer. Zero fields mean
// "use the default"; the shared engine fills them in. Values are loaded
// from a [scoring] section and apply to both rank scoring and the utility
// optimizer, so no tuning numbers are hardcoded outside internal/lang.
Scoring Scoring
// Profile selection
Profile string
// Token and context settings
Budget int
TokenizeModel string
Mode string
// Prompt is an optional task/directive section prepended to the output.
Prompt string
// Safety
SecretScan bool
ForceSecrets bool
Clipboard bool
// Version info
ShowVersion bool
Version string
}
Config holds all application configuration settings.
func (*Config) EffectiveStyle ¶
EffectiveStyle returns the resolved output style, honoring the legacy --json and --markdown flags.
func (*Config) ResolveColors ¶
func (c *Config) ResolveColors()
ResolveColors determines whether colored output should be used.
type Profile ¶
type Profile struct {
Style string `toml:"style"`
TokenizeModel string `toml:"tokenize_model"`
Budget int `toml:"budget"`
Mode string `toml:"compress_mode"`
Prompt string `toml:"prompt"`
SecretScan *bool `toml:"secret_scan"`
ForceSecrets *bool `toml:"force_secrets"`
IgnoreHidden *bool `toml:"ignore_hidden"`
IgnoreGit *bool `toml:"ignore_git"`
Extensions []string `toml:"extensions"`
SmartFilter *bool `toml:"smart_filter"`
SmartMaxTokens int `toml:"smart_max_tokens"`
Highlight *bool `toml:"highlight"`
NoHighlight *bool `toml:"no_highlight"`
Theme string `toml:"theme"`
HighlightMaxBytes int `toml:"highlight_max_bytes"`
WindowTitle string `toml:"window_title"`
NoWindowTitle *bool `toml:"no_window_title"`
Scoring *Scoring `toml:"scoring"`
}
Profile is a named set of configuration overrides loaded from TOML. Pointer fields distinguish "not set" from an explicit value.
func LoadProfile ¶
LoadProfile returns the merged profile with the given name. Global config values are applied first, then local overrides them.
type Scoring ¶
type Scoring struct {
// Composite weights for the git/role/centrality relevance score.
RecencyWeight float64 `toml:"recency_weight"`
ChurnWeight float64 `toml:"churn_weight"`
CentralityWeight float64 `toml:"centrality_weight"`
RoleWeight float64 `toml:"role_weight"`
// Mode bands for the relevance score.
FullBand float64 `toml:"full_band"`
SkipBand float64 `toml:"skip_band"`
// Utility optimizer knobs.
BaseMin float64 `toml:"base_min"`
BaseMax float64 `toml:"base_max"`
RelevanceWeight float64 `toml:"relevance_weight"`
PreferenceBonus float64 `toml:"preference_bonus"`
SignatureBonus float64 `toml:"signature_bonus"`
SkipMultiplier float64 `toml:"skip_multiplier"`
SigQualityMin float64 `toml:"sig_quality_min"`
SigQualityMax float64 `toml:"sig_quality_max"`
// Retention overrides per lang role name (e.g. "entrypoint", "docs").
// An empty map leaves the lang-default retention in place; a present key
// overrides it. Config takes priority over the default.
Retention map[string]float64 `toml:"retention"`
}
Scoring holds the numeric tuning for the relevance ranker and the selection optimizer. Every field defaults to 0, which the consuming engine interprets as "use the built-in default". This keeps tuning values config-driven from a [scoring] TOML section while letting the defaults live once, in the engine.