config

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config manages MAXAM configuration in ~/.maxam/

Index

Constants

View Source
const DefaultAnalysisMinMessages = 10

DefaultAnalysisMinMessages is the default minimum message count for analysis

View Source
const DefaultMaxInstances = 3

TODO: Move to config.yaml when multi-instance feature is stabilized DefaultMaxInstances is the default maximum number of instances per agent

View Source
const DefaultProjectClaudeMDTemplate = `` /* 303-byte string literal not displayed */

DefaultProjectClaudeMDTemplate is the default CLAUDE.md template for projects

View Source
const DefaultProjectConfigTemplate = `` /* 214-byte string literal not displayed */

DefaultProjectConfigTemplate is the default config.yaml template for projects

View Source
const DefaultWorkersPerAgent = 1

DefaultWorkersPerAgent is the default number of workers per agent

Variables

View Source
var DefaultAgents = []string{"mei", "yuki", "rin", "shiori", "priya", "amara"}

DefaultAgents is the list of default agents to install

View Source
var ErrNoAgentsConfigured = fmt.Errorf("no agents configured. Please run 'maxam team init' first")

ErrNoAgentsConfigured is returned when no agents are configured

Functions

func AgentsDir

func AgentsDir() (string, error)

AgentsDir returns the path to ~/.maxam/agents/

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the path to ~/.maxam/

func EnsureInitialized

func EnsureInitialized(embeddedAgents map[string]string) error

EnsureInitialized sets up ~/.maxam/ if not present and copies default agents from the embedded data

func EnsureProjectInitialized added in v0.7.0

func EnsureProjectInitialized(projectDir string) error

EnsureProjectInitialized sets up project/.maxam/ if not present Creates default config.yaml and CLAUDE.md templates Does not overwrite existing files

func GetAgentClaudeMD

func GetAgentClaudeMD(name string) (string, error)

GetAgentClaudeMD returns the path to an agent's CLAUDE.md

func GetAgentClaudeMDWithProject added in v0.5.4

func GetAgentClaudeMDWithProject(projectDir, name string) (string, error)

GetAgentClaudeMDWithProject returns agent's CLAUDE.md path with project priority Priority: project/.maxam/agents/{name}/ > ~/.maxam/agents/{name}/

func GetAgentDir

func GetAgentDir(name string) (string, error)

GetAgentDir returns the directory for an agent

func GetAgentDirWithProject added in v0.5.4

func GetAgentDirWithProject(projectDir, name string) (string, error)

GetAgentDirWithProject returns agent directory with project priority Priority: project/.maxam/agents/{name}/ > ~/.maxam/agents/{name}/

func GetEmbeddedAgents

func GetEmbeddedAgents() (map[string]string, error)

GetEmbeddedAgents returns a map of agent name to CLAUDE.md content

func IsProjectInitialized added in v0.7.0

func IsProjectInitialized(projectDir string) bool

IsProjectInitialized returns true if project/.maxam/ exists with config files

func ListAgents

func ListAgents() ([]string, error)

ListAgents returns agent names from ~/.maxam/agents/

func ListAgentsWithProject added in v0.5.4

func ListAgentsWithProject(projectDir string) ([]string, error)

ListAgentsWithProject returns agent names with project-local priority Priority: project/.maxam/agents/ > ~/.maxam/agents/

func ProjectAgentsDir added in v0.5.4

func ProjectAgentsDir(projectDir string) string

ProjectAgentsDir returns the path to project/.maxam/agents/

func ProjectClaudeMD added in v0.5.4

func ProjectClaudeMD(projectDir string) string

ProjectClaudeMD returns the path to project/.maxam/CLAUDE.md

func ProjectConfigDir added in v0.5.4

func ProjectConfigDir(projectDir string) string

ProjectConfigDir returns the path to project/.maxam/

func Save

func Save(cfg *Config) error

Save writes configuration to ~/.maxam/config.yaml

func SaveToProject added in v0.6.0

func SaveToProject(projectDir string, cfg *Config) error

SaveToProject writes configuration to project/.maxam/config.yaml

Types

type AgentConfig

type AgentConfig struct {
	Name       string `yaml:"name"`
	FullName   string `yaml:"full_name"`
	Role       string `yaml:"role"`
	Model      string `yaml:"model,omitempty"`       // opus, sonnet, haiku
	Color      string `yaml:"color,omitempty"`       // hex color code (e.g., "#FF9933")
	InstanceID string `yaml:"instance_id,omitempty"` // for multi-instance support (e.g., "1", "2")
}

AgentConfig represents an agent configuration

func (*AgentConfig) GetInstanceKey added in v0.7.0

func (a *AgentConfig) GetInstanceKey() string

GetInstanceKey returns the unique key for this agent instance Format: "name" (no instance) or "name-instanceID" (with instance)

type Config

type Config struct {
	Version               string        `yaml:"version"`
	TeamName              string        `yaml:"team_name,omitempty"`
	DefaultAgent          string        `yaml:"default_agent,omitempty"`
	Agents                []AgentConfig `yaml:"agents"`
	AnalysisMinMessages   int           `yaml:"analysis_min_messages,omitempty"`
	ContextMode           ContextMode   `yaml:"context_mode,omitempty"`
	YOLOMode              bool          `yaml:"yolo_mode,omitempty"`
	WorkersPerAgent       int           `yaml:"workers_per_agent,omitempty"`
	MentionCheckerEnabled *bool         `yaml:"mention_checker_enabled,omitempty"`
}

Config represents the MAXAM configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration with no agents Use "maxam team init" to set up team members

func Load

func Load() (*Config, error)

Load reads configuration from ~/.maxam/config.yaml

func LoadProjectConfig added in v0.6.0

func LoadProjectConfig(projectDir string) (*Config, error)

LoadProjectConfig loads only the project-local config (not merged)

func LoadWithProject added in v0.5.4

func LoadWithProject(projectDir string) (*Config, error)

LoadWithProject loads configuration with project-local overrides Priority: project/.maxam/config.yaml > ~/.maxam/config.yaml > default

func (*Config) GetAgentByInstanceKey added in v0.7.0

func (c *Config) GetAgentByInstanceKey(key string) *AgentConfig

GetAgentByInstanceKey returns the agent with the specified instance key Supports both "name" and "name-instanceID" formats

func (*Config) GetAgentByRole added in v0.7.0

func (c *Config) GetAgentByRole(role string) *AgentConfig

GetAgentByRole returns the first agent with the specified role Returns nil if no agent with the role is found

func (*Config) GetAgentColor added in v0.6.0

func (c *Config) GetAgentColor(name string) string

GetAgentColor returns the color for the specified agent Returns empty string if not found or not set

func (*Config) GetAgentInstances added in v0.7.0

func (c *Config) GetAgentInstances(name string) []AgentConfig

GetAgentInstances returns all instances of the specified agent name

func (*Config) GetAgentsByRole added in v0.7.0

func (c *Config) GetAgentsByRole(role string) []AgentConfig

GetAgentsByRole returns all agents with the specified role

func (*Config) GetAllInstanceKeys added in v0.7.0

func (c *Config) GetAllInstanceKeys() []string

GetAllInstanceKeys returns all unique instance keys for agents

func (*Config) GetAnalysisMinMessages added in v0.3.0

func (c *Config) GetAnalysisMinMessages() int

GetAnalysisMinMessages returns the analysis minimum messages with default fallback

func (*Config) GetContextMode added in v0.3.0

func (c *Config) GetContextMode() ContextMode

GetContextMode returns the context mode with default fallback

func (*Config) GetTeamName added in v0.7.0

func (c *Config) GetTeamName() string

GetTeamName returns the team name with default fallback

func (*Config) GetUniqueAgentNames added in v0.7.0

func (c *Config) GetUniqueAgentNames() []string

GetUniqueAgentNames returns unique agent names (without instance IDs)

func (*Config) GetWorkersPerAgent added in v0.5.3

func (c *Config) GetWorkersPerAgent() int

GetWorkersPerAgent returns workers per agent with default fallback

func (*Config) HasAgents added in v0.6.0

func (c *Config) HasAgents() bool

HasAgents returns true if at least one agent is configured

func (*Config) IsMentionCheckerEnabled added in v0.7.0

func (c *Config) IsMentionCheckerEnabled() bool

IsMentionCheckerEnabled returns whether mention checker is enabled (default: true)

func (*Config) IsSummaryMode added in v0.3.0

func (c *Config) IsSummaryMode() bool

IsSummaryMode returns true if context mode is summary

func (*Config) SetMentionCheckerEnabled added in v0.7.0

func (c *Config) SetMentionCheckerEnabled(enabled bool)

SetMentionCheckerEnabled sets the mention checker enabled state

type ContextMode added in v0.3.0

type ContextMode string

ContextMode represents the context mode for system prompts

const (
	ContextModeFull    ContextMode = "full"
	ContextModeSummary ContextMode = "summary"
)

Jump to

Keyboard shortcuts

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