config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPaths

func ConfigPaths() []string

ConfigPaths returns the paths to the configuration files.

func Dir

func Dir() string

CfgDir returns the configuration directory for gencmd.

func InitConfig

func InitConfig() ([]string, error)

InitConfig initializes the configuration for gencmd on a new system.

func SaveProviderEnv

func SaveProviderEnv(name string, env map[string]string) error

SaveProviderEnv saves the environment variables for the LLM provider to the .env file.

Types

type Config

type Config struct {
	LLM LLMConfig `yaml:"llm"`
}

Config represents the configuration structure for the application.

func Default

func Default() Config

Default returns a default configuration with sensible defaults.

func DefaultFromEnv

func DefaultFromEnv() Config

DefaultFromEnv returns a default configuration based on environment variables.

func Load

func Load() (Config, error)

Load reads the configuration from the default path "config.yaml" in the user's XDG data directory.

func LoadFrom

func LoadFrom(path string) (Config, error)

LoadFrom reads the configuration from the specified YAML file path.

type LLMConfig

type LLMConfig struct {
	Provider       string `yaml:"provider"`
	ModelName      string `yaml:"modelName"`
	PromptTemplate string `yaml:"promptTemplate"`
}

LLMConfig represents the configuration for the Language Model.

type ProviderDoc

type ProviderDoc struct {
	ID      string
	Name    string
	URL     string
	Options []ProviderOption
	// Fixed environment variables for the provider
	FixedEnv map[string]string
}

func ProvidersInitOptions

func ProvidersInitOptions() []ProviderDoc

ProvidersInitOptions returns the initialization options for each provider.

type ProviderOption

type ProviderOption struct {
	Name        string
	EnvVar      string
	Description string
}

Jump to

Keyboard shortcuts

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