config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config handles application configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

ConfigPath returns the default config file path

Types

type APIConfig

type APIConfig struct {
	Enabled bool   `yaml:"enabled"`
	Address string `yaml:"address"`
}

APIConfig holds HTTP API settings

type AlertsConfig

type AlertsConfig struct {
	ContextLimitWarning  int           `yaml:"context_limit_warning"` // percentage
	LongRunningThreshold time.Duration `yaml:"long_running_threshold"`
	SoundEnabled         bool          `yaml:"sound_enabled"`
	DesktopNotifications bool          `yaml:"desktop_notifications"`
	SlackEnabled         bool          `yaml:"slack_enabled"`
	SlackWebhookURL      string        `yaml:"slack_webhook_url"`
	SlackChannel         string        `yaml:"slack_channel"`
	DiscordEnabled       bool          `yaml:"discord_enabled"`
	DiscordWebhookURL    string        `yaml:"discord_webhook_url"`
}

AlertsConfig holds alert settings

type ColorsConfig

type ColorsConfig struct {
	Primary       string `yaml:"primary"`
	Secondary     string `yaml:"secondary"`
	Accent        string `yaml:"accent"`
	Background    string `yaml:"background"`
	Foreground    string `yaml:"foreground"`
	Border        string `yaml:"border"`
	BorderFocused string `yaml:"border_focused"`
	StatusRunning string `yaml:"status_running"`
	StatusIdle    string `yaml:"status_idle"`
	StatusError   string `yaml:"status_error"`
	StatusDone    string `yaml:"status_done"`
}

ColorsConfig holds color customizations

type Config

type Config struct {
	General   GeneralConfig   `yaml:"general"`
	Providers ProvidersConfig `yaml:"providers"`
	Alerts    AlertsConfig    `yaml:"alerts"`
	UI        UIConfig        `yaml:"ui"`
	Theme     ThemeConfig     `yaml:"theme"`
	Keys      KeysConfig      `yaml:"keys"`
	Storage   StorageConfig   `yaml:"storage"`
	Metrics   MetricsConfig   `yaml:"metrics"`
	Plugins   PluginsConfig   `yaml:"plugins"`
	API       APIConfig       `yaml:"api"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

func Load

func Load(path string) (*Config, error)

Load loads configuration from a file

func (*Config) Save

func (c *Config) Save(path string) error

Save saves configuration to a file

type GeneralConfig

type GeneralConfig struct {
	RefreshInterval time.Duration `yaml:"refresh_interval"`
	LogLevel        string        `yaml:"log_level"`
	LogFile         string        `yaml:"log_file"`
}

GeneralConfig holds general settings

type KeysConfig

type KeysConfig struct {
	Quit           string `yaml:"quit"`
	Help           string `yaml:"help"`
	Search         string `yaml:"search"`
	Command        string `yaml:"command"`
	NextAgent      string `yaml:"next_agent"`
	PrevAgent      string `yaml:"prev_agent"`
	FocusAgent     string `yaml:"focus_agent"`
	TerminateAgent string `yaml:"terminate_agent"`
	PauseAgent     string `yaml:"pause_agent"`
	SendInput      string `yaml:"send_input"`
	ToggleGrouping string `yaml:"toggle_grouping"`
	SwitchPane     string `yaml:"switch_pane"`
}

KeysConfig holds keybinding customizations

type MetricsConfig

type MetricsConfig struct {
	TokenCostInput  float64 `yaml:"token_cost_input"`  // cost per 1k input tokens
	TokenCostOutput float64 `yaml:"token_cost_output"` // cost per 1k output tokens
}

MetricsConfig holds metrics settings

type OpenCodeConfig

type OpenCodeConfig struct {
	Enabled       bool          `yaml:"enabled"`
	StoragePath   string        `yaml:"storage_path"`
	WatchInterval time.Duration `yaml:"watch_interval"`
	MaxAge        time.Duration `yaml:"max_age"` // Max age of sessions to load (0 = no limit)
}

OpenCodeConfig holds opencode provider settings

type PluginsConfig

type PluginsConfig struct {
	Dir     string   `yaml:"dir"`
	Enabled []string `yaml:"enabled"`
}

PluginsConfig holds plugin settings

type ProvidersConfig

type ProvidersConfig struct {
	OpenCode OpenCodeConfig `yaml:"opencode"`
}

ProvidersConfig holds provider-specific settings

type StorageConfig

type StorageConfig struct {
	DatabasePath string `yaml:"database_path"`
	MaxHistory   int    `yaml:"max_history"` // days to keep
}

StorageConfig holds storage settings

type ThemeConfig

type ThemeConfig struct {
	Mode   string       `yaml:"mode"` // "dark", "light"
	Colors ColorsConfig `yaml:"colors"`
}

ThemeConfig holds theme settings

type UIConfig

type UIConfig struct {
	ShowHeader      bool   `yaml:"show_header"`
	ShowFooter      bool   `yaml:"show_footer"`
	AgentListWidth  int    `yaml:"agent_list_width"`
	DefaultGrouping string `yaml:"default_grouping"` // "flat", "type", "project"
	ShowMetrics     bool   `yaml:"show_metrics"`
}

UIConfig holds UI settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL