package
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Jun 16, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package config 管理 seek 的命名配置档 (profiles)。
设计对照 ant 的 `profile` 命令: 配置存在 ~/.config/seek/config.json,
顶层 active_config 指向当前激活的 profile, profiles 里每个 key 是一个 profile。
Dir 返回配置目录, 遵循 XDG 约定, 默认 ~/.config/seek。
Save 把配置写回磁盘, 权限 0600 (含密钥)。
type Config struct {
ActiveConfig string `json:"active_config"`
Profiles map[string]Profile `json:"profiles"`
}
Config 是整个配置文件的结构。
Load 读取配置文件; 文件不存在时返回一个空的默认配置。
Get 返回指定 profile (不存在则返回空 Profile)。
Names 返回所有 profile 名称, 已排序。
Resolve 选出生效的 profile 名称: 优先显式传入, 否则用 active_config。
type Profile struct {
APIKey string `json:"api_key,omitempty"`
BaseURL string `json:"base_url,omitempty"`
}
Profile 是单个配置档。DeepSeek 没有 OAuth, 因此凭据就是一个 API key。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.