config

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides application configuration from database.

Package config provides application configuration including keybindings.

Index

Constants

View Source
const (
	SettingProjectsDir           = "projects_dir"
	SettingTheme                 = "theme"
	SettingDetailPaneHeight      = "detail_pane_height"
	SettingShellPaneWidth        = "shell_pane_width"
	SettingShellPaneHidden       = "shell_pane_hidden"
	SettingIdleSuspendTimeout    = "idle_suspend_timeout"
	SettingServerURL             = "server_url"
	SettingWorktreeCleanupMaxAge = "worktree_cleanup_max_age"
)

Setting keys

View Source
const DefaultServerURL = "http://localhost"

DefaultServerURL is the default base URL for opening tasks in the browser.

Variables

This section is empty.

Functions

func DefaultKeybindingsConfigPath

func DefaultKeybindingsConfigPath() string

DefaultKeybindingsConfigPath returns the default path for the keybindings config file.

func GenerateDefaultKeybindingsYAML

func GenerateDefaultKeybindingsYAML() string

GenerateDefaultKeybindingsYAML generates a YAML string with all default keybindings. This can be used to create an example config file.

Types

type Config

type Config struct {
	ProjectsDir string
	// contains filtered or unexported fields
}

Config holds application configuration loaded from database.

func New

func New(database *db.DB) *Config

New creates a config from database.

func (*Config) GetProjectDir

func (c *Config) GetProjectDir(project string) string

GetProjectDir returns the directory for a project name.

func (*Config) ProjectUsesWorktrees

func (c *Config) ProjectUsesWorktrees(project string) bool

ProjectUsesWorktrees returns whether a project uses git worktrees for task isolation. Returns true by default (for backward compatibility and unknown projects).

func (*Config) SetProjectsDir

func (c *Config) SetProjectsDir(dir string) error

SetProjectsDir sets the default projects directory.

type KeybindingConfig

type KeybindingConfig struct {
	Keys []string `yaml:"keys"` // Key(s) that trigger the action
	Help string   `yaml:"help"` // Help text displayed in the UI
}

KeybindingConfig represents a single keybinding configuration.

type KeybindingsConfig

type KeybindingsConfig struct {
	Left               *KeybindingConfig `yaml:"left,omitempty"`
	Right              *KeybindingConfig `yaml:"right,omitempty"`
	Up                 *KeybindingConfig `yaml:"up,omitempty"`
	Down               *KeybindingConfig `yaml:"down,omitempty"`
	Enter              *KeybindingConfig `yaml:"enter,omitempty"`
	Back               *KeybindingConfig `yaml:"back,omitempty"`
	New                *KeybindingConfig `yaml:"new,omitempty"`
	Edit               *KeybindingConfig `yaml:"edit,omitempty"`
	Queue              *KeybindingConfig `yaml:"queue,omitempty"`
	Retry              *KeybindingConfig `yaml:"retry,omitempty"`
	Close              *KeybindingConfig `yaml:"close,omitempty"`
	Archive            *KeybindingConfig `yaml:"archive,omitempty"`
	Delete             *KeybindingConfig `yaml:"delete,omitempty"`
	Refresh            *KeybindingConfig `yaml:"refresh,omitempty"`
	Settings           *KeybindingConfig `yaml:"settings,omitempty"`
	Help               *KeybindingConfig `yaml:"help,omitempty"`
	Quit               *KeybindingConfig `yaml:"quit,omitempty"`
	ChangeStatus       *KeybindingConfig `yaml:"change_status,omitempty"`
	CommandPalette     *KeybindingConfig `yaml:"command_palette,omitempty"`
	ToggleDangerous    *KeybindingConfig `yaml:"toggle_dangerous,omitempty"`
	TogglePin          *KeybindingConfig `yaml:"toggle_pin,omitempty"`
	Filter             *KeybindingConfig `yaml:"filter,omitempty"`
	OpenWorktree       *KeybindingConfig `yaml:"open_worktree,omitempty"`
	ToggleShellPane    *KeybindingConfig `yaml:"toggle_shell_pane,omitempty"`
	JumpToNotification *KeybindingConfig `yaml:"jump_to_notification,omitempty"`
	FocusBacklog       *KeybindingConfig `yaml:"focus_backlog,omitempty"`
	FocusInProgress    *KeybindingConfig `yaml:"focus_in_progress,omitempty"`
	FocusBlocked       *KeybindingConfig `yaml:"focus_blocked,omitempty"`
	FocusDone          *KeybindingConfig `yaml:"focus_done,omitempty"`
	JumpToPinned       *KeybindingConfig `yaml:"jump_to_pinned,omitempty"`
	JumpToUnpinned     *KeybindingConfig `yaml:"jump_to_unpinned,omitempty"`
	CollapseBacklog    *KeybindingConfig `yaml:"collapse_backlog,omitempty"`
	CollapseDone       *KeybindingConfig `yaml:"collapse_done,omitempty"`
	OpenBrowser        *KeybindingConfig `yaml:"open_browser,omitempty"`
	ApprovePrompt      *KeybindingConfig `yaml:"approve_prompt,omitempty"`
	DenyPrompt         *KeybindingConfig `yaml:"deny_prompt,omitempty"`
	Spotlight          *KeybindingConfig `yaml:"spotlight,omitempty"`
	SpotlightSync      *KeybindingConfig `yaml:"spotlight_sync,omitempty"`
	QuickInput         *KeybindingConfig `yaml:"quick_input,omitempty"`
}

KeybindingsConfig holds all customizable keybindings.

func LoadKeybindings

func LoadKeybindings() (*KeybindingsConfig, error)

LoadKeybindings loads keybindings from the default config path. Returns nil if the file doesn't exist (not an error - just use defaults).

func LoadKeybindingsFromPath

func LoadKeybindingsFromPath(path string) (*KeybindingsConfig, error)

LoadKeybindingsFromPath loads keybindings from a specific path. Returns nil if the file doesn't exist (not an error - just use defaults).

Jump to

Keyboard shortcuts

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