config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterServeFlags

func RegisterServeFlags(fs *flag.FlagSet)

RegisterServeFlags registers serve-command flags on fs. The caller must call fs.Parse before passing fs to Load.

func ResolveDataDir

func ResolveDataDir() (string, error)

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"`
	CopilotDir       string        `json:"copilot_dir"`
	GeminiDir        string        `json:"gemini_dir"`
	OpenCodeDir      string        `json:"opencode_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 Default

func Default() (Config, error)

Default returns a Config with default values.

func Load

func Load(fs *flag.FlagSet) (Config, error)

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

func LoadMinimal() (Config, error)

LoadMinimal builds a Config from defaults, env, and config file, without parsing CLI flags. Use this for subcommands that manage their own flag sets.

func (*Config) SaveGithubToken

func (c *Config) SaveGithubToken(token string) error

SaveGithubToken persists the GitHub token to the config file.

Jump to

Keyboard shortcuts

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