config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package config resolves runtime paths and default locations used by the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppConfigPath

func AppConfigPath() (string, error)

AppConfigPath resolves the effective config path.

func DefaultLogFile

func DefaultLogFile() (string, error)

DefaultLogFile returns the default action log path.

func DefaultSessionsRoot

func DefaultSessionsRoot() (string, error)

DefaultSessionsRoot returns the default Codex sessions directory.

func DefaultTrashRoot

func DefaultTrashRoot() (string, error)

DefaultTrashRoot returns the default trash directory for soft-deleted sessions.

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir ensures config parent directory exists.

func EnsureDirForFile

func EnsureDirForFile(filePath string) error

EnsureDirForFile creates parent directories for the given file path.

func ResolveConfigPath

func ResolveConfigPath(v string) (string, error)

ResolveConfigPath resolves path-like fields and preserves empty values.

func ResolvePath

func ResolvePath(path string) (string, error)

ResolvePath expands "~" prefixes and returns the normalized path string.

Types

type AppConfig

type AppConfig struct {
	SessionsRoot string    `json:"sessions_root"`
	TrashRoot    string    `json:"trash_root"`
	LogFile      string    `json:"log_file"`
	TUI          TUIConfig `json:"tui"`
}

AppConfig is the user-level runtime configuration for codexsm.

func LoadAppConfig

func LoadAppConfig() (AppConfig, error)

LoadAppConfig reads and parses user config. Missing config file is treated as zero-value config.

type TUIConfig

type TUIConfig struct {
	GroupBy string            `json:"group_by"`
	Theme   string            `json:"theme"`
	Colors  map[string]string `json:"colors"`
	Source  string            `json:"source"`
}

TUIConfig contains defaults and visual options for TUI mode.

Jump to

Keyboard shortcuts

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