Documentation
¶
Index ¶
- type Manager
- func (cm *Manager) Add(config models.APIConfig) error
- func (cm *Manager) Disable() error
- func (cm *Manager) GenerateActiveScript() error
- func (cm *Manager) Get(alias string) (*models.APIConfig, error)
- func (cm *Manager) GetActive() (*models.APIConfig, error)
- func (cm *Manager) GetActiveName() (string, error)
- func (cm *Manager) GetConfigPath() string
- func (cm *Manager) GetGlobalActive() (*models.APIConfig, error)
- func (cm *Manager) GetModels(alias string) ([]string, error)
- func (cm *Manager) List() ([]models.APIConfig, error)
- func (cm *Manager) Load() ([]models.APIConfig, error)
- func (cm *Manager) Remove(alias string) error
- func (cm *Manager) RenameAlias(oldAlias, newAlias string) error
- func (cm *Manager) RestoreClaudeToGlobal() error
- func (cm *Manager) Save(configs []models.APIConfig) error
- func (cm *Manager) SetActive(alias string) error
- func (cm *Manager) SetModels(alias string, modelNames []string) error
- func (cm *Manager) SwitchModel(alias string, model string) error
- func (cm *Manager) SyncClaudeSettingsOnly(cfg *models.APIConfig) error
- func (cm *Manager) UpdatePartial(alias string, updates map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages API configurations
func NewConfigManager ¶
NewConfigManager creates a new Manager with unified config path
func NewConfigManagerWithPath ¶
NewConfigManagerWithPath creates a Manager with a custom config file path. This is useful for testing or when the config location needs to be overridden.
func (*Manager) GenerateActiveScript ¶
GenerateActiveScript generates the activation script for active configuration
func (*Manager) GetActiveName ¶
GetActiveName returns the active configuration name
func (*Manager) GetConfigPath ¶
GetConfigPath returns the path to the config file
func (*Manager) GetGlobalActive ¶
GetGlobalActive returns the persisted global active configuration. Unlike GetActive, it ignores the APIMGR_ACTIVE environment override.
func (*Manager) RenameAlias ¶
RenameAlias renames a configuration alias
func (*Manager) RestoreClaudeToGlobal ¶
RestoreClaudeToGlobal restores Claude Code settings to match the global active configuration. If no global active configuration exists, it clears the ANTHROPIC_* env vars from Claude Code settings.
func (*Manager) SetModels ¶
SetModels updates the supported models list for a configuration. It validates the models list and handles active model fallback when the current active model is removed.
func (*Manager) SwitchModel ¶
SwitchModel switches the active model for a configuration. It validates that the model is in the supported models list before switching.
func (*Manager) SyncClaudeSettingsOnly ¶
SyncClaudeSettingsOnly syncs configuration to Claude Code settings files without updating global active field or generating active.env file. This is used for local mode to update Claude Code immediately.