config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(s string, vars TemplateVars) (string, error)

func ExpandSlice

func ExpandSlice(ss []string, vars TemplateVars) ([]string, error)

func ParseDurationWithDays added in v0.3.0

func ParseDurationWithDays(s string) time.Duration

Types

type Agent

type Agent struct {
	Command     string            `toml:"command"`
	Args        []string          `toml:"args"`
	ResumeArgs  []string          `toml:"resume_args"`
	Env         map[string]string `toml:"env"`
	IdleTimeout string            `toml:"idle_timeout"`
}

func (Agent) IdleTimeoutDuration

func (a Agent) IdleTimeoutDuration() time.Duration

type Config

type Config struct {
	DefaultAgent   string           `toml:"default_agent"`
	GitHubUsername string           `toml:"github_username"`
	BranchPrefix   string           `toml:"branch_prefix"`
	FetchOnCreate  bool             `toml:"fetch_on_create"`
	StatusBar      StatusBar        `toml:"status_bar"`
	Keybindings    Keybindings      `toml:"keybindings"`
	Notifications  Notifications    `toml:"notifications"`
	Messages       Messages         `toml:"messages"`
	Agents         map[string]Agent `toml:"agents"`
}

func Default

func Default() *Config

func Load

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

func LoadOrDefault

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

type Keybindings

type Keybindings struct {
	Prefix        string `toml:"prefix"`
	NewSession    string `toml:"new_session"`
	DeleteSession string `toml:"delete_session"`
	Detach        string `toml:"detach"`
	SessionList   string `toml:"session_list"`
	NextSession   string `toml:"next_session"`
	PrevSession   string `toml:"prev_session"`
	ResumeSession string `toml:"resume_session"`
	RenameSession string `toml:"rename_session"`
	Search        string `toml:"search"`
	ScrollMode    string `toml:"scroll_mode"`
	Shell         string `toml:"shell"`
}

type Messages added in v0.3.0

type Messages struct {
	MaxAge       string `toml:"max_age"`
	MaxPerStream int    `toml:"max_per_stream"`
}

func (Messages) MaxAgeDuration added in v0.3.0

func (m Messages) MaxAgeDuration() time.Duration

type Notifications added in v0.2.0

type Notifications struct {
	Enabled    bool   `toml:"enabled"`
	OnApproval bool   `toml:"on_approval"`
	OnStopped  bool   `toml:"on_stopped"`
	Command    string `toml:"command"`
}

type Paths

type Paths struct {
	ConfigFile string
	DataDir    string
	RuntimeDir string
	SocketPath string
	PIDFile    string
	StateFile  string
	LogDir     string
	DaemonLog  string
	MessagesDB string
}

func ResolvePaths

func ResolvePaths() Paths

func (Paths) EnsureDirs

func (p Paths) EnsureDirs() error

type StatusBar added in v0.3.0

type StatusBar struct {
	Enabled  bool   `toml:"enabled"`
	Position string `toml:"position"`
}

type TemplateVars

type TemplateVars struct {
	Username       string
	AgentSessionID string
	SessionName    string
	SessionID      string
	WorktreePath   string
}

type Watcher added in v0.3.0

type Watcher struct {
	// contains filtered or unexported fields
}

func NewWatcher added in v0.3.0

func NewWatcher(path string, onChange func(*Config), log *slog.Logger) *Watcher

func (*Watcher) Run added in v0.3.0

func (w *Watcher) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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