grokkit/config/config.go
Greg Gauthier f540f5fc24 refactor(cmd): remove unnecessary last modified comments and timestamps
- Eliminate header comments with timestamps and ownership from all source files
- Update agent and edit commands to clean such comments and simplify response handling
- Add helper to remove last modified lines in edit command
- Minor formatting and import cleanups across codebase
2026-02-28 22:59:16 +00:00

35 lines
651 B
Go

package config
import (
"os"
"path/filepath"
"github.com/spf13/viper"
)
func Load() {
home, _ := os.UserHomeDir()
configPath := filepath.Join(home, ".config", "grokkit")
viper.SetConfigName("config")
viper.SetConfigType("toml")
viper.AddConfigPath(configPath)
viper.AddConfigPath(".")
viper.AutomaticEnv()
viper.SetDefault("default_model", "grok-4")
viper.SetDefault("temperature", 0.7)
_ = viper.ReadInConfig()
}
func GetModel(flagModel string) string {
if flagModel != "" {
if alias := viper.GetString("aliases." + flagModel); alias != "" {
return alias
}
return flagModel
}
return viper.GetString("default_model")
}