Documentation
¶
Overview ¶
Package config loads hmm's set-it-once configuration file — provider, model, and provider keys, so a plain `hmm "question"` needs no flags and no env vars. Precedence lives in the CLI: flag > env > this file > built-in defaults.
The file is a deliberately tiny TOML subset — flat `key = value` lines with strings, integers, booleans, and # comments. No tables, no arrays: hmm's config is flat, and an unknown key is an error naming the line, not a silently ignored typo.
Index ¶
Constants ¶
const Template = `` /* 891-byte string literal not displayed */
Template is what `hmm config init` writes: everything commented, one of each kind, ready to edit.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init writes Template to path with 0600 permissions, refusing to overwrite an existing file. Returns whether it wrote.
func Path ¶
Path is the config file hmm reads: $HMM_CONFIG (legacy $BOBINA_CONFIG), else ~/.config/hmm/config.toml — falling back to the pre-rename ~/.config/bobina/config.toml when only that exists.
Types ¶
type Config ¶
type Config struct {
Provider string
Model string // global fallback for any provider
SystemAppend string // --system: appended to the default prompt
MaxSteps int // 0 keeps weft's default
Sequential bool
Yolo bool
AnthropicModel string // per-provider model; beats Model for that
OpenAIModel string // provider, so a default for one never
GoogleModel string // leaks into another (a config for kimi
ZaiModel string // must not name kimi-latest to z.ai)
KimiModel string
AnthropicKey string
OpenAIKey string
GoogleKey string
ZaiKey string
KimiKey string
}
Config is the parsed file. Zero values mean "not set" — the caller falls through to the next precedence source.
func Load ¶
Load reads the config file. A missing file is an empty config, not an error; anything else wrong with it is.
func (Config) Insecure ¶
Insecure reports whether the file holds keys and is readable beyond its owner.