Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateFromLegacy ¶
func MigrateFromLegacy(dataDir string)
MigrateFromLegacy copies data from ~/.agent-session-viewer to the current data directory if it doesn't exist yet. Call this once during startup, before opening the database.
func RegisterServeFlags ¶
RegisterServeFlags registers serve-command flags on fs. The caller must call fs.Parse before passing fs to Load.
func ResolveDataDir ¶
ResolveDataDir returns the effective data directory by applying defaults and environment overrides, without reading any files. Use this to determine where migration should target before calling Load or LoadMinimal.
Types ¶
type Config ¶
type Config struct {
Host string `json:"host"`
Port int `json:"port"`
NoBrowser bool `json:"no_browser"`
ClaudeProjectDir string `json:"claude_project_dir"`
CodexSessionsDir string `json:"codex_sessions_dir"`
GeminiDir string `json:"gemini_dir"`
DataDir string `json:"data_dir"`
DBPath string `json:"-"`
CursorSecret string `json:"cursor_secret"`
GithubToken string `json:"github_token,omitempty"`
WriteTimeout time.Duration `json:"-"`
}
Config holds all application configuration.
func Load ¶
Load builds a Config by layering: defaults < config file < env < flags. The provided FlagSet must already be parsed by the caller. Only flags that were explicitly set override the lower layers.
func LoadMinimal ¶
LoadMinimal builds a Config from defaults, env, and config file, without parsing CLI flags. Use this for subcommands that manage their own flag sets. Call MigrateFromLegacy before this if legacy data migration is needed.
func (*Config) SaveGithubToken ¶
SaveGithubToken persists the GitHub token to the config file.