Documentation
¶
Index ¶
- func Exists() bool
- func GetConfigDir() (string, error)
- func GetConfigPath() (string, error)
- func NeedsSetup() bool
- func Save(cfg *Config) error
- type AnthropicConfig
- type AskConfig
- type Config
- type ExecConfig
- type GeminiConfig
- type ImageConfig
- type ImageFluxConfig
- type ImageGeminiConfig
- type ImageOpenAIConfig
- type OpenAIConfig
- type ThemeConfig
- type ZenConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigDir ¶
GetConfigDir returns the XDG config directory for term-llm. Uses $XDG_CONFIG_HOME if set, otherwise ~/.config
func GetConfigPath ¶
GetConfigPath returns the path where the config file should be located
Types ¶
type AnthropicConfig ¶
type AskConfig ¶
type AskConfig struct {
Instructions string `mapstructure:"instructions"` // Custom system prompt for ask
}
type Config ¶
type Config struct {
Provider string `mapstructure:"provider"`
Exec ExecConfig `mapstructure:"exec"`
Ask AskConfig `mapstructure:"ask"`
Image ImageConfig `mapstructure:"image"`
Theme ThemeConfig `mapstructure:"theme"`
Anthropic AnthropicConfig `mapstructure:"anthropic"`
OpenAI OpenAIConfig `mapstructure:"openai"`
Gemini GeminiConfig `mapstructure:"gemini"`
Zen ZenConfig `mapstructure:"zen"`
}
type ExecConfig ¶
type GeminiConfig ¶
type GeminiConfig struct {
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"`
Credentials string `mapstructure:"credentials"` // "api_key" (default) or "gemini-cli"
// OAuth credentials populated at runtime when using gemini-cli
OAuthCreds *credentials.GeminiOAuthCredentials
}
type ImageConfig ¶ added in v0.0.3
type ImageConfig struct {
Provider string `mapstructure:"provider"` // default image provider: gemini, openai, flux
OutputDir string `mapstructure:"output_dir"` // default save directory
Gemini ImageGeminiConfig `mapstructure:"gemini"`
OpenAI ImageOpenAIConfig `mapstructure:"openai"`
Flux ImageFluxConfig `mapstructure:"flux"`
}
ImageConfig configures image generation settings
type ImageFluxConfig ¶ added in v0.0.3
type ImageFluxConfig struct {
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"` // flux-2-pro for generation, flux-kontext-pro for editing
}
ImageFluxConfig configures Flux (Black Forest Labs) image generation
type ImageGeminiConfig ¶ added in v0.0.3
type ImageGeminiConfig struct {
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"`
}
ImageGeminiConfig configures Gemini image generation
type ImageOpenAIConfig ¶ added in v0.0.3
type ImageOpenAIConfig struct {
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"`
}
ImageOpenAIConfig configures OpenAI image generation
type OpenAIConfig ¶
type ThemeConfig ¶
type ThemeConfig struct {
Primary string `mapstructure:"primary"` // main accent (commands, highlights)
Secondary string `mapstructure:"secondary"` // secondary accent (headers, borders)
Success string `mapstructure:"success"` // success states
Error string `mapstructure:"error"` // error states
Warning string `mapstructure:"warning"` // warnings
Muted string `mapstructure:"muted"` // dimmed text
Text string `mapstructure:"text"` // primary text
Spinner string `mapstructure:"spinner"` // loading spinner
}
ThemeConfig allows customization of UI colors Colors can be ANSI color numbers (0-255) or hex codes (#RRGGBB)
type ZenConfig ¶ added in v0.0.2
type ZenConfig struct {
APIKey string `mapstructure:"api_key"` // Optional: leave empty for free tier
Model string `mapstructure:"model"`
}
ZenConfig configures the OpenCode Zen provider Zen provides free access to models like GLM 4.7 via opencode.ai API key is optional - leave empty for free tier access