Documentation
¶
Overview ¶
Package config handles loading, saving, and validating user configuration from JSON files, including project settings, plugin options, keymaps, and UI preferences.
Index ¶
- func ConfigPath() string
- func ExpandPath(path string) string
- func ResetTestConfigPath()
- func Save(cfg *Config) error
- func SaveCommunityTheme(communityName string, userOverrides map[string]interface{}) error
- func SaveGlobalTheme(tc ThemeConfig) error
- func SaveProjectTheme(projectPath string, theme *ThemeConfig) error
- func SaveTheme(themeName string) error
- func SaveThemeWithOverrides(themeName string, overrides map[string]interface{}) error
- func SetTestConfigPath(path string)
- type Config
- type ConversationsPluginConfig
- type FeaturesConfig
- type GitStatusPluginConfig
- type KeymapConfig
- type NotesPluginConfig
- type PluginsConfig
- type ProjectConfig
- type ProjectsConfig
- type TDMonitorPluginConfig
- type ThemeConfig
- type UIConfig
- type WorkspacePluginConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetTestConfigPath ¶
func ResetTestConfigPath()
ResetTestConfigPath clears the test config path override.
func Save ¶
Save writes the config to ~/.config/sidecar/config.json, preserving any keys it doesn't manage (e.g. "prompts").
func SaveCommunityTheme ¶
SaveCommunityTheme saves a community theme reference with optional user overrides. Only the scheme name is stored — the full palette is computed at runtime.
func SaveGlobalTheme ¶
func SaveGlobalTheme(tc ThemeConfig) error
SaveGlobalTheme saves a ThemeConfig as the global UI theme.
func SaveProjectTheme ¶
func SaveProjectTheme(projectPath string, theme *ThemeConfig) error
SaveProjectTheme updates a specific project's theme in config and saves.
func SaveThemeWithOverrides ¶
SaveThemeWithOverrides saves a theme name and full overrides map to config.
func SetTestConfigPath ¶
func SetTestConfigPath(path string)
SetTestConfigPath sets a custom config path for testing. Call ResetTestConfigPath() in test cleanup to restore default behavior.
Types ¶
type Config ¶
type Config struct {
Projects ProjectsConfig `json:"projects"`
Plugins PluginsConfig `json:"plugins"`
Keymap KeymapConfig `json:"keymap"`
UI UIConfig `json:"ui"`
Features FeaturesConfig `json:"features"`
}
Config is the root configuration structure.
type ConversationsPluginConfig ¶
type ConversationsPluginConfig struct {
Enabled bool `json:"enabled"`
ClaudeDataDir string `json:"claudeDataDir"`
// DefaultCategoryFilter sets the default session category filter on startup.
// Example: ["interactive"] hides cron/system sessions by default.
// Empty or omitted means show all sessions (no filter).
DefaultCategoryFilter []string `json:"defaultCategoryFilter,omitempty"`
}
ConversationsPluginConfig configures the conversations plugin.
type FeaturesConfig ¶
FeaturesConfig holds feature flag settings.
type GitStatusPluginConfig ¶
type GitStatusPluginConfig struct {
Enabled bool `json:"enabled"`
RefreshInterval time.Duration `json:"refreshInterval"`
}
GitStatusPluginConfig configures the git status plugin.
type KeymapConfig ¶
KeymapConfig holds key binding overrides.
type NotesPluginConfig ¶
type NotesPluginConfig struct {
// DefaultEditor sets the default editor mode when pressing Enter on a note.
// Values: "builtin" (default), "vim", "nvim", or any $EDITOR value.
// When set to "vim"/"nvim", Enter opens the note in inline vim instead of built-in editor.
DefaultEditor string `json:"defaultEditor,omitempty"`
}
NotesPluginConfig configures the notes plugin.
type PluginsConfig ¶
type PluginsConfig struct {
GitStatus GitStatusPluginConfig `json:"git-status"`
TDMonitor TDMonitorPluginConfig `json:"td-monitor"`
Conversations ConversationsPluginConfig `json:"conversations"`
Workspace WorkspacePluginConfig `json:"workspace"`
Notes NotesPluginConfig `json:"notes"`
}
PluginsConfig holds per-plugin configuration.
type ProjectConfig ¶
type ProjectConfig struct {
Name string `json:"name"` // display name for the project
Path string `json:"path"` // absolute path to project root (supports ~ expansion)
Theme *ThemeConfig `json:"theme,omitempty"` // per-project theme (nil = use global)
}
ProjectConfig represents a single project in the project switcher.
type ProjectsConfig ¶
type ProjectsConfig struct {
Mode string `json:"mode"` // "single" for now
Root string `json:"root"` // "." default
List []ProjectConfig `json:"list"` // list of configured projects for switcher
}
ProjectsConfig configures project detection and layout.
type TDMonitorPluginConfig ¶
type TDMonitorPluginConfig struct {
Enabled bool `json:"enabled"`
RefreshInterval time.Duration `json:"refreshInterval"`
DBPath string `json:"dbPath"`
}
TDMonitorPluginConfig configures the TD monitor plugin.
type ThemeConfig ¶
type ThemeConfig struct {
Name string `json:"name"`
Community string `json:"community,omitempty"` // community scheme name (resolved at runtime)
Overrides map[string]interface{} `json:"overrides,omitempty"` // user customizations on top
}
ThemeConfig configures the color theme.
type UIConfig ¶
type UIConfig struct {
ShowClock bool `json:"showClock"`
Theme ThemeConfig `json:"theme"`
NerdFontsEnabled bool `json:"nerdFontsEnabled"` // enables Nerd Font glyphs (pill tabs, icons, etc.)
}
UIConfig configures UI appearance.
type WorkspacePluginConfig ¶
type WorkspacePluginConfig struct {
// DirPrefix prefixes workspace directory names with the repo name (e.g., 'myrepo-feature-auth')
// This helps associate conversations with the repo after workspace deletion. Default: true.
DirPrefix bool `json:"dirPrefix"`
// TmuxCaptureMaxBytes caps tmux pane capture size for the preview pane. Default: 2MB.
TmuxCaptureMaxBytes int `json:"tmuxCaptureMaxBytes"`
// InteractiveExitKey is the keybinding to exit interactive mode. Default: "ctrl+\".
// Examples: "ctrl+]", "ctrl+\\", "ctrl+x"
InteractiveExitKey string `json:"interactiveExitKey,omitempty"`
// InteractiveAttachKey is the keybinding to attach from interactive mode. Default: "ctrl+]".
// When pressed in interactive mode, exits interactive and attaches to the tmux session.
InteractiveAttachKey string `json:"interactiveAttachKey,omitempty"`
// InteractiveCopyKey is the keybinding to copy selection in interactive mode. Default: "alt+c".
InteractiveCopyKey string `json:"interactiveCopyKey,omitempty"`
// InteractivePasteKey is the keybinding to paste clipboard in interactive mode. Default: "alt+v".
InteractivePasteKey string `json:"interactivePasteKey,omitempty"`
}
WorkspacePluginConfig configures the workspace plugin.