config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config handles loading and validating katazuke configuration from files, environment variables, and CLI flag overrides.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandHome added in v0.5.0

func ExpandHome(path string) string

ExpandHome replaces a leading ~/ in path with the user's home directory.

Types

type Config

type Config struct {
	ProjectsDir        string     `yaml:"projects_dir"`
	StaleThresholdDays int        `yaml:"stale_threshold_days"`
	GithubToken        string     `yaml:"github_token"`
	ExcludePatterns    []string   `yaml:"exclude_patterns"`
	Workers            int        `yaml:"workers"` // parallel worker count for all commands
	Sync               SyncConfig `yaml:"sync"`
}

Config holds all katazuke configuration.

func Defaults

func Defaults() Config

Defaults returns a Config with default values.

func Load

func Load() (Config, error)

Load reads configuration from the config file and environment variables. Values are layered: defaults < config file < environment variables.

type SyncConfig added in v0.2.0

type SyncConfig struct {
	Strategy           string `yaml:"strategy"`             // "rebase", "merge", or "ff-only"
	SkipDirty          bool   `yaml:"skip_dirty"`           // skip dirty repos without merge-tree check
	AutoStash          bool   `yaml:"auto_stash"`           // attempt stash/pop for dirty repos
	SwitchMergedBranch bool   `yaml:"switch_merged_branch"` // auto-switch repos on merged branches to default
	// Deprecated: Use the top-level Workers field in Config instead.
	Workers int `yaml:"workers"`
}

SyncConfig holds configuration for the sync command.

Jump to

Keyboard shortcuts

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