config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultClaudeDesktopConfigPath added in v0.0.5

func GetDefaultClaudeDesktopConfigPath() (string, error)

GetDefaultClaudeDesktopConfigPath returns the default path for the Claude desktop configuration file

func GetDefaultProfilesPath added in v0.0.4

func GetDefaultProfilesPath() (string, error)

GetDefaultProfilesPath returns the default path for the profiles configuration file

func GetProfilesPath added in v0.0.4

func GetProfilesPath(configFile string) (string, error)

GetProfilesPath returns the profiles path from either the provided path or the default location

Types

type ClaudeDesktopConfig added in v0.0.5

type ClaudeDesktopConfig struct {
	MCPServers         map[string]MCPServer `json:"mcpServers"`
	DisabledMCPServers []string             `json:"disabledMCPServers,omitempty"`
	DisabledServers    map[string]MCPServer `json:"disabledServersConfig,omitempty"`
}

ClaudeDesktopConfig represents the configuration for the Claude desktop application

type ClaudeDesktopEditor added in v0.0.5

type ClaudeDesktopEditor struct {
	// contains filtered or unexported fields
}

ClaudeDesktopEditor manages the Claude desktop configuration

func NewClaudeDesktopEditor added in v0.0.5

func NewClaudeDesktopEditor(path string) (*ClaudeDesktopEditor, error)

NewClaudeDesktopEditor creates a new editor for the Claude desktop configuration

func (*ClaudeDesktopEditor) AddMCPServer added in v0.0.5

func (e *ClaudeDesktopEditor) AddMCPServer(name string, command string, args []string, env map[string]string, overwrite bool) error

AddMCPServer adds or updates an MCP server configuration

func (*ClaudeDesktopEditor) DisableMCPServer added in v0.0.5

func (e *ClaudeDesktopEditor) DisableMCPServer(name string) error

DisableMCPServer disables an MCP server without removing its configuration

func (*ClaudeDesktopEditor) EnableMCPServer added in v0.0.5

func (e *ClaudeDesktopEditor) EnableMCPServer(name string) error

EnableMCPServer enables a previously disabled MCP server

func (*ClaudeDesktopEditor) GetConfigPath added in v0.0.5

func (e *ClaudeDesktopEditor) GetConfigPath() string

GetConfigPath returns the path to the configuration file

func (*ClaudeDesktopEditor) IsServerDisabled added in v0.0.5

func (e *ClaudeDesktopEditor) IsServerDisabled(name string) bool

IsServerDisabled checks if a server is disabled

func (*ClaudeDesktopEditor) ListDisabledServers added in v0.0.5

func (e *ClaudeDesktopEditor) ListDisabledServers() []string

ListDisabledServers returns a list of disabled server names

func (*ClaudeDesktopEditor) ListServers added in v0.0.5

func (e *ClaudeDesktopEditor) ListServers() map[string]MCPServer

ListServers returns a list of configured MCP servers

func (*ClaudeDesktopEditor) RemoveMCPServer added in v0.0.5

func (e *ClaudeDesktopEditor) RemoveMCPServer(name string) error

RemoveMCPServer removes an MCP server configuration

func (*ClaudeDesktopEditor) Save added in v0.0.5

func (e *ClaudeDesktopEditor) Save() error

Save writes the configuration to disk

type Config

type Config struct {
	Version        string              `yaml:"version"`
	DefaultProfile string              `yaml:"defaultProfile"`
	Profiles       map[string]*Profile `yaml:"profiles"`
}

Config represents the root configuration

func LoadFromFile

func LoadFromFile(path string) (*Config, error)

LoadFromFile loads a configuration from a YAML file

type ConfigEditor added in v0.0.4

type ConfigEditor struct {
	// contains filtered or unexported fields
}

func NewConfigEditor added in v0.0.4

func NewConfigEditor(path string) (*ConfigEditor, error)

func (*ConfigEditor) AddProfile added in v0.0.4

func (c *ConfigEditor) AddProfile(name, description string) error

func (*ConfigEditor) AddToolDirectory added in v0.0.4

func (c *ConfigEditor) AddToolDirectory(profile, path string, defaults map[string]interface{}) error

func (*ConfigEditor) AddToolFile added in v0.0.4

func (c *ConfigEditor) AddToolFile(profile, path string) error

func (*ConfigEditor) DuplicateProfile added in v0.0.4

func (c *ConfigEditor) DuplicateProfile(source, target, description string) error

func (*ConfigEditor) GetDefaultProfile added in v0.0.4

func (c *ConfigEditor) GetDefaultProfile() (string, error)

func (*ConfigEditor) GetProfile added in v0.0.4

func (c *ConfigEditor) GetProfile(name string) (*yaml.Node, error)

func (*ConfigEditor) GetProfiles added in v0.0.4

func (c *ConfigEditor) GetProfiles() (map[string]string, error)

func (*ConfigEditor) Save added in v0.0.4

func (c *ConfigEditor) Save() error

func (*ConfigEditor) SetDefaultProfile added in v0.0.4

func (c *ConfigEditor) SetDefaultProfile(profile string) error

type LayerParameters

type LayerParameters map[string]map[string]interface{}

LayerParameters maps layer names to their parameter settings

type MCPServer added in v0.0.5

type MCPServer struct {
	Command string            `json:"command"`
	Args    []string          `json:"args"`
	Env     map[string]string `json:"env,omitempty"`
}

MCPServer represents a server configuration

type ParameterFilter

type ParameterFilter map[string][]string

ParameterFilter maps layer names to lists of parameter names

type Profile

type Profile struct {
	Description string         `yaml:"description"`
	Tools       *ToolSources   `yaml:"tools"`
	Prompts     *PromptSources `yaml:"prompts"`
}

Profile represents a named configuration profile

type PromptSources

type PromptSources struct {
	Directories []SourceConfig `yaml:"directories,omitempty"`
	Files       []SourceConfig `yaml:"files,omitempty"`
	Pinocchio   *struct {
		Command      string   `yaml:"command"`
		Args         []string `yaml:"args,omitempty"`
		SourceConfig `yaml:",inline"`
	} `yaml:"pinocchio,omitempty"`
}

PromptSources configures where prompts are loaded from

type SourceConfig

type SourceConfig struct {
	Path      string          `yaml:"path"`
	Defaults  LayerParameters `yaml:"defaults,omitempty"`
	Overrides LayerParameters `yaml:"overrides,omitempty"`
	Blacklist ParameterFilter `yaml:"blacklist,omitempty"`
	Whitelist ParameterFilter `yaml:"whitelist,omitempty"`
}

Common source configuration for both tools and prompts

type ToolSources

type ToolSources struct {
	Directories      []SourceConfig `yaml:"directories,omitempty"`
	Files            []SourceConfig `yaml:"files,omitempty"`
	ExternalCommands []struct {
		Command      string   `yaml:"command"`
		Args         []string `yaml:"args,omitempty"`
		SourceConfig `yaml:",inline"`
	} `yaml:"external_commands,omitempty"`
}

ToolSources configures where tools are loaded from

Jump to

Keyboard shortcuts

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