config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Task box heights
	TaskBoxHeight         = 5 // Compact view mode
	TaskBoxHeightExpanded = 9 // Expanded view mode

	// Task box width padding
	TaskBoxPaddingCompact  = 12 // Width padding in compact mode
	TaskBoxPaddingExpanded = 4  // Width padding in expanded mode
	TaskBoxMinWidth        = 10 // Minimum width fallback

	// Search box dimensions
	SearchBoxHeight = 3
)

Variables

View Source
var (
	// Version is the semantic version or commit hash.
	Version = "dev"

	// GitCommit is the full git commit hash.
	GitCommit = "unknown"

	// BuildDate is the ISO 8601 build timestamp.
	BuildDate = "unknown"
)

Build information variables injected via ldflags at compile time. These are set by the build process (Makefile or GoReleaser) using: -ldflags "-X tiki/config.Version=... -X tiki/config.GitCommit=... -X tiki/config.BuildDate=..."

View Source
var (
	// ErrNoHome indicates that the user's home directory could not be determined
	ErrNoHome = errors.New("unable to determine home directory")

	// ErrPathManagerInit indicates that the PathManager failed to initialize
	ErrPathManagerInit = errors.New("failed to initialize path manager")
)

Functions

func BootstrapSystem

func BootstrapSystem() error

BootstrapSystem creates the task storage and seeds the initial tiki.

func EnsureDirs added in v0.0.7

func EnsureDirs() error

EnsureDirs creates all necessary directories with appropriate permissions

func EnsureProjectInitialized

func EnsureProjectInitialized(tikiSkillMdContent, dokiSkillMdContent string) (bool, error)

EnsureProjectInitialized bootstraps the project if .doc/tiki is missing. Returns (proceed, error). If proceed is false, the user canceled initialization.

func GenerateRandomID

func GenerateRandomID() string

GenerateRandomID generates a 6-character random alphanumeric ID (lowercase)

func GetArtTView

func GetArtTView() string

GetArtTView returns the art logo formatted for tview (with tview color codes) uses the current gradient colors

func GetBoardViewMode

func GetBoardViewMode() string

GetBoardViewMode loads the board view mode from config Priority: plugins array entry with name "Board", then default

func GetBool

func GetBool(key string) bool

GetBool is a convenience method to get a boolean value from config

func GetCacheDir added in v0.0.7

func GetCacheDir() string

GetCacheDir returns the user cache directory

func GetConfigDir added in v0.0.7

func GetConfigDir() string

GetConfigDir returns the user config directory

func GetConfigFile added in v0.0.7

func GetConfigFile() string

GetConfigFile returns the path to the user config file

func GetContentBackgroundColor

func GetContentBackgroundColor() tcell.Color

GetContentBackgroundColor returns the background color for markdown content areas Dark theme needs black background for light text; light theme uses terminal default

func GetContentTextColor

func GetContentTextColor() tcell.Color

GetContentTextColor returns the appropriate text color for content areas Dark theme uses white text; light theme uses black text

func GetDefaultNewTaskTemplate

func GetDefaultNewTaskTemplate() string

GetDefaultNewTaskTemplate returns the embedded new.md template

func GetDokiDir added in v0.0.7

func GetDokiDir() string

GetDokiDir returns the project-local documentation directory

func GetEffectiveTheme

func GetEffectiveTheme() string

GetEffectiveTheme resolves "auto" to actual theme based on terminal detection

func GetFireIcon

func GetFireIcon() string

GetFireIcon returns fire icon with tview color codes

func GetHeaderVisible

func GetHeaderVisible() bool

GetHeaderVisible returns the header visibility setting

func GetInt

func GetInt(key string) int

GetInt is a convenience method to get an integer value from config

func GetMaxPoints

func GetMaxPoints() int

GetMaxPoints returns the maximum points value for tasks

func GetPluginSearchPaths added in v0.0.7

func GetPluginSearchPaths() []string

GetPluginSearchPaths returns directories to search for plugin files

func GetProjectConfigFile added in v0.0.7

func GetProjectConfigFile() string

GetProjectConfigFile returns the path to the project-local config file

func GetString

func GetString(key string) string

GetString is a convenience method to get a string value from config

func GetTaskDir added in v0.0.7

func GetTaskDir() string

GetTaskDir returns the project-local task directory

func GetTemplateFile added in v0.0.7

func GetTemplateFile() string

GetTemplateFile returns the path to the user's custom new.md template

func GetTheme

func GetTheme() string

GetTheme returns the appearance theme setting

func InitPaths added in v0.0.7

func InitPaths() error

InitPaths initializes the path manager. Must be called early in application startup. Returns an error if path initialization fails (e.g., cannot determine home directory).

func PromptForProjectInit

func PromptForProjectInit() ([]string, bool, error)

PromptForProjectInit presents a Huh form for project initialization. Returns (selectedAITools, proceed, error)

func ResetPathManager added in v0.0.7

func ResetPathManager()

ResetPathManager resets the path manager singleton for testing purposes. This allows tests to reinitialize paths with different environment variables.

func SaveBoardViewMode

func SaveBoardViewMode(viewMode string) error

SaveBoardViewMode saves the board view mode to config.yaml Deprecated: Use SavePluginViewMode("Board", -1, viewMode) instead

func SaveHeaderVisible

func SaveHeaderVisible(visible bool) error

SaveHeaderVisible saves the header visibility setting to config.yaml

func SavePluginViewMode

func SavePluginViewMode(pluginName string, configIndex int, viewMode string) error

SavePluginViewMode saves a plugin's view mode to config.yaml This function updates or creates the plugin entry in the plugins array configIndex: index in config array (-1 to create new entry by name)

func SetColors

func SetColors(colors *ColorConfig)

SetColors sets a custom color configuration

Types

type ColorConfig

type ColorConfig struct {
	// Board view colors
	BoardColumnTitleBackground tcell.Color
	BoardColumnTitleText       tcell.Color
	BoardColumnBorder          tcell.Color
	BoardColumnTitleGradient   Gradient
	BoardPaneTitleBackground   tcell.Color
	BoardPaneTitleText         tcell.Color
	BoardPaneBorder            tcell.Color
	BoardPaneTitleGradient     Gradient

	// Task box colors
	TaskBoxSelectedBackground   tcell.Color
	TaskBoxSelectedText         tcell.Color
	TaskBoxSelectedBorder       tcell.Color
	TaskBoxUnselectedBorder     tcell.Color
	TaskBoxUnselectedBackground tcell.Color
	TaskBoxIDColor              Gradient
	TaskBoxTitleColor           string // tview color string like "[#b8b8b8]"
	TaskBoxLabelColor           string // tview color string like "[#767676]"
	TaskBoxDescriptionColor     string // tview color string like "[#767676]"
	TaskBoxTagValueColor        string // tview color string like "[#5a6f8f]"

	// Task detail view colors
	TaskDetailIDColor           Gradient
	TaskDetailTitleText         string // tview color string like "[yellow]"
	TaskDetailLabelText         string // tview color string like "[green]"
	TaskDetailValueText         string // tview color string like "[white]"
	TaskDetailCommentAuthor     string // tview color string like "[yellow]"
	TaskDetailEditDimTextColor  string // tview color string like "[#808080]"
	TaskDetailEditDimLabelColor string // tview color string like "[#606060]"
	TaskDetailEditDimValueColor string // tview color string like "[#909090]"
	TaskDetailEditFocusMarker   string // tview color string like "[yellow]"
	TaskDetailEditFocusText     string // tview color string like "[white]"

	// Search box colors
	SearchBoxLabelColor      tcell.Color
	SearchBoxBackgroundColor tcell.Color
	SearchBoxTextColor       tcell.Color

	// Input field colors (used in task detail edit mode)
	InputFieldBackgroundColor tcell.Color
	InputFieldTextColor       tcell.Color

	// Burndown chart colors
	BurndownChartAxisColor     tcell.Color
	BurndownChartLabelColor    tcell.Color
	BurndownChartValueColor    tcell.Color
	BurndownChartBarColor      tcell.Color
	BurndownChartGradientFrom  Gradient
	BurndownChartGradientTo    Gradient
	BurndownHeaderGradientFrom Gradient // Header-specific chart gradient
	BurndownHeaderGradientTo   Gradient

	// Header view colors
	HeaderInfoLabel  string // tview color string like "[orange]"
	HeaderInfoValue  string // tview color string like "[white]"
	HeaderKeyBinding string // tview color string like "[yellow]"
	HeaderKeyText    string // tview color string like "[white]"
}

ColorConfig holds all color and style definitions per view

func DefaultColors

func DefaultColors() *ColorConfig

DefaultColors returns the default color configuration

func GetColors

func GetColors() *ColorConfig

GetColors returns the global color configuration with theme-aware overrides

type Config

type Config struct {
	// Logging configuration
	Logging struct {
		Level string `mapstructure:"level"` // "debug", "info", "warn", "error"
	} `mapstructure:"logging"`

	// Board view configuration
	Board struct {
		View string `mapstructure:"view"` // "compact" or "expanded"
	} `mapstructure:"board"`

	// Header configuration
	Header struct {
		Visible bool `mapstructure:"visible"`
	} `mapstructure:"header"`

	// Tiki configuration
	Tiki struct {
		MaxPoints int `mapstructure:"maxPoints"`
	} `mapstructure:"tiki"`

	// Appearance configuration
	Appearance struct {
		Theme string `mapstructure:"theme"` // "dark", "light", "auto"
	} `mapstructure:"appearance"`
}

Config holds all application configuration loaded from config.yaml

func GetConfig

func GetConfig() *Config

GetConfig returns the loaded configuration If config hasn't been loaded yet, it loads it first

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from config.yaml Priority order (first found wins): project config → user config → current directory (dev) If config.yaml doesn't exist, it uses default values

type Gradient

type Gradient struct {
	Start [3]int // R, G, B (0-255)
	End   [3]int // R, G, B (0-255)
}

Gradient defines a start and end RGB color for a gradient transition

type PathManager added in v0.0.7

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

PathManager manages all file system paths for tiki

func (*PathManager) CacheDir added in v0.0.7

func (pm *PathManager) CacheDir() string

CacheDir returns the user cache directory

func (*PathManager) ConfigDir added in v0.0.7

func (pm *PathManager) ConfigDir() string

ConfigDir returns the user config directory

func (*PathManager) ConfigFile added in v0.0.7

func (pm *PathManager) ConfigFile() string

ConfigFile returns the path to the user config file

func (*PathManager) DokiDir added in v0.0.7

func (pm *PathManager) DokiDir() string

DokiDir returns the project-local documentation directory

func (*PathManager) EnsureDirs added in v0.0.7

func (pm *PathManager) EnsureDirs() error

EnsureDirs creates all necessary directories with appropriate permissions

func (*PathManager) PluginSearchPaths added in v0.0.7

func (pm *PathManager) PluginSearchPaths() []string

PluginSearchPaths returns directories to search for plugin files Search order: project config dir → user config dir

func (*PathManager) ProjectConfigFile added in v0.0.7

func (pm *PathManager) ProjectConfigFile() string

ProjectConfigFile returns the path to the project-local config file

func (*PathManager) TaskDir added in v0.0.7

func (pm *PathManager) TaskDir() string

TaskDir returns the project-local task directory

func (*PathManager) TemplateFile added in v0.0.7

func (pm *PathManager) TemplateFile() string

TemplateFile returns the path to the user's custom new.md template

Jump to

Keyboard shortcuts

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