config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath retorna el path del archivo de configuración global. Sigue el estándar XDG Base Directory Specification. macOS: ~/.config/claude-init/config.yaml Linux: ~/.config/claude-init/config.yaml Windows: %APPDATA%\claude-init\config.yaml

Types

type GlobalConfig

type GlobalConfig struct {
	Provider  string                    `yaml:"provider"`
	Providers map[string]ProviderConfig `yaml:"providers"`
}

GlobalConfig representa la configuración global del CLI.

func EnsureConfigured

func EnsureConfigured() (*GlobalConfig, error)

EnsureConfigured verifica que el provider por defecto existe y está configurado. Si no hay provider configurado, retorna error.

func Load

func Load() (*GlobalConfig, error)

Load carga la configuración global desde disco.

func (*GlobalConfig) GetDefaultProvider

func (c *GlobalConfig) GetDefaultProvider() string

GetDefaultProvider retorna el provider por defecto, o "cli" si no está configurado.

func (*GlobalConfig) GetProviderConfig

func (c *GlobalConfig) GetProviderConfig(provider string) (ProviderConfig, bool)

GetProviderConfig retorna la configuración de un provider específico.

func (*GlobalConfig) HasAnyProviderConfigured

func (c *GlobalConfig) HasAnyProviderConfigured() bool

HasAnyProviderConfigured retorna true si al menos un provider tiene API key.

func (*GlobalConfig) IsProviderConfigured

func (c *GlobalConfig) IsProviderConfigured(provider string) bool

IsProviderConfigured retorna true si un provider tiene API key configurada.

func (*GlobalConfig) Save

func (c *GlobalConfig) Save() error

Save guarda la configuración global en disco.

func (*GlobalConfig) SetDefaultProvider

func (c *GlobalConfig) SetDefaultProvider(provider string)

SetDefaultProvider establece el provider por defecto.

func (*GlobalConfig) SetProviderConfig

func (c *GlobalConfig) SetProviderConfig(provider string, config ProviderConfig)

SetProviderConfig configura un provider específico.

type ProviderConfig

type ProviderConfig struct {
	APIKey    string `yaml:"api_key"`
	BaseURL   string `yaml:"base_url,omitempty"`
	Model     string `yaml:"model,omitempty"`
	MaxTokens int    `yaml:"max_tokens,omitempty"`
}

ProviderConfig contiene la configuración de un provider específico.

Jump to

Keyboard shortcuts

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