config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 14 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 (
	TaskDir = ".doc/tiki"
	DokiDir = ".doc/doki"
)

Hardcoded task storage configuration

Functions

func BootstrapSystem

func BootstrapSystem() error

BootstrapSystem creates the task storage and seeds the initial tiki.

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 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 GetDokiRoot

func GetDokiRoot() string

GetDokiRoot returns the absolute path to the doki 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 GetString

func GetString(key string) string

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

func GetTheme

func GetTheme() string

GetTheme returns the appearance theme setting

func PromptForProjectInit

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

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

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 in the binary's directory 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

Jump to

Keyboard shortcuts

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