config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName        = "copycat"
	ConfigFileName = "config.yaml"
)
View Source
const ConfigTemplate = `` /* 611-byte string literal not displayed */

ConfigTemplate is the default configuration template. Use fmt.Sprintf(ConfigTemplate, org) to fill in the organization.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the platform-appropriate config directory for copycat.

  • Linux: ~/.config/copycat
  • macOS: ~/Library/Application Support/copycat
  • Windows: %AppData%/copycat

func ConfigExists

func ConfigExists() (bool, string, error)

ConfigExists checks if a config file exists at the platform config path.

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the full path to the XDG config file.

func DefaultConfigContent

func DefaultConfigContent(org string) string

DefaultConfigContent returns the default config content with the given org.

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates the config directory if it doesn't exist.

Types

type AITool

type AITool struct {
	Name        string   `yaml:"name"`
	Command     string   `yaml:"command"`
	CodeArgs    []string `yaml:"code_args"`
	SummaryArgs []string `yaml:"summary_args"`
}

func (*AITool) BuildCommand

func (t *AITool) BuildCommand(prompt string, baseArgs []string) *exec.Cmd

type AIToolsConfig

type AIToolsConfig struct {
	Default string   `yaml:"default"`
	Tools   []AITool `yaml:"tools"`
}

func (*AIToolsConfig) ToolByName

func (c *AIToolsConfig) ToolByName(name string) (*AITool, bool)

type Config

type Config struct {
	GitHub        GitHubConfig `yaml:"github"`
	AIToolsConfig `yaml:",inline"`
	Projects      []Project `yaml:"projects,omitempty"`
}

func DefaultConfig

func DefaultConfig(org string) *Config

DefaultConfig returns a Config struct with default values.

func Load

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

func (*Config) Save

func (c *Config) Save(filename string) error

Save writes the configuration to a file with readable formatting.

type GitHubConfig

type GitHubConfig struct {
	Organization        string `yaml:"organization"`
	AutoDiscoveryTopic  string `yaml:"auto_discovery_topic"`
	RequiresTicketTopic string `yaml:"requires_ticket_topic"`
}

type Project

type Project struct {
	Repo           string   `yaml:"repo"`
	SlackRoom      string   `yaml:"slack_room"`
	RequiresTicket bool     `yaml:"requires_ticket"`
	Topics         []string `yaml:"topics,omitempty"`
}

Jump to

Keyboard shortcuts

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