config

package
v0.0.0-...-a0986ef Latest Latest
Warning

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

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

Documentation

Overview

Copyright © 2025 dinoDanic dino.danic@gmail.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLocalProjectConfigIfNeeded

func CreateLocalProjectConfigIfNeeded() error

func CreateVersionedProjectConfigIfNeeded

func CreateVersionedProjectConfigIfNeeded() error

func GetConfigPath

func GetConfigPath() string

func GetLocalProjectConfigPath

func GetLocalProjectConfigPath() string

func GetVersionedProjectConfigPath

func GetVersionedProjectConfigPath() string

Types

type AIConfig

type AIConfig struct {
	Mode     AIMode `yaml:"mode" json:"Mode"`
	LocalURL string `yaml:"local_url" json:"LocalURL"`
	APIURL   string `yaml:"api_url" json:"APIURL"`
	APIKey   string `yaml:"api_key" json:"APIKey"`
	Command  string `yaml:"command" json:"Command"`
	Model    string `yaml:"model" json:"Model"`
}

type AIMode

type AIMode string
const (
	AIRemote    AIMode = "remote"
	AILocal     AIMode = "local"
	AICustom    AIMode = "custom"
	AIAnthropic AIMode = "anthropic"
	AICLI       AIMode = "cli"
)

type CommitConfig

type CommitConfig struct {
	Conventional       bool              `yaml:"conventional" json:"Conventional"`
	ConventionalFormat []string          `yaml:"conventional_format" json:"ConventionalFormat"`
	Emoji              bool              `yaml:"emoji" json:"Emoji"`
	EmojiMap           map[string]string `yaml:"emoji_map" json:"EmojiMap"`
	Tone               Tone              `yaml:"tone" json:"Tone"`
	Length             Length            `yaml:"length" json:"Length"`
	CustomInstructions string            `yaml:"custom_instructions" json:"CustomInstructions"`
	HashAfterCommit    bool              `yaml:"hash_after_commit" json:"HashAfterCommit"`
}

type Config

type Config struct {
	Theme        string            `yaml:"theme" json:"Theme"`
	CustomThemes map[string]string `yaml:"custom_themes,omitempty" json:"CustomThemes,omitempty"`
	AI           AIConfig          `yaml:"ai" json:"AI"`
	Commit       CommitConfig      `yaml:"commit" json:"Commit"`
}

func Load

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

func LoadWithProjectOverride

func LoadWithProjectOverride(globalCfgFile string) (*Config, string, error)

func (*Config) EffectiveAIMode

func (c *Config) EffectiveAIMode() AIMode

EffectiveAIMode returns the AI mode, defaulting to AIRemote if empty.

func (*Config) Validate

func (c *Config) Validate() error

type Length

type Length string
const (
	Short  Length = "short"
	Normal Length = "normal"
	Long   Length = "long"
)

type LoadResult

type LoadResult struct {
	Config        *Config
	RecoveryMsg   string
	ValidationErr string
}

func LoadOrRecover

func LoadOrRecover(cfgFile string) (*LoadResult, error)

func LoadOrRecoverWithProject

func LoadOrRecoverWithProject(cfgFile string) (*LoadResult, error)

type LocalAIConfig

type LocalAIConfig struct {
	Mode     *AIMode `yaml:"mode,omitempty"`
	LocalURL string  `yaml:"local_url,omitempty"`
	APIURL   string  `yaml:"api_url,omitempty"`
	APIKey   string  `yaml:"api_key,omitempty"`
	Model    string  `yaml:"model,omitempty"`
	Command  string  `yaml:"command,omitempty"`
}

type LocalCommitConfig

type LocalCommitConfig struct {
	Conventional       *bool             `yaml:"conventional,omitempty"`
	ConventionalFormat []string          `yaml:"conventional_format,omitempty"`
	Emoji              *bool             `yaml:"emoji,omitempty"`
	EmojiMap           map[string]string `yaml:"emoji_map,omitempty"`
	Tone               Tone              `yaml:"tone,omitempty"`
	Length             Length            `yaml:"length,omitempty"`
	CustomInstructions string            `yaml:"custom_instructions,omitempty"`
	HashAfterCommit    *bool             `yaml:"hash_after_commit,omitempty"`
}

type LocalConfig

type LocalConfig struct {
	Theme        string            `yaml:"theme,omitempty"`
	CustomThemes map[string]string `yaml:"custom_themes,omitempty"`
	AI           LocalAIConfig     `yaml:"ai,omitempty"`
	Commit       LocalCommitConfig `yaml:"commit,omitempty"`
}

type Tone

type Tone string
const (
	Professional Tone = "professional"
	Casual       Tone = "casual"
	Friendly     Tone = "friendly"
)

Jump to

Keyboard shortcuts

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