Documentation
¶
Index ¶
- Constants
- Variables
- func AgentConfigNames(agents []AgentConfig) []string
- func DefaultPath() string
- func ModeFlags(mode string) []string
- func ShellRCPrefix(shell string) string
- type AgentConfig
- type BadgeRule
- type Config
- type CoordinationConfig
- type EnvironmentConfig
- type ExportConfig
- type K8sMCPConfig
- type K8sProviderConfig
- type MLflowConfig
- type NotificationsConfig
- type OTELReceiverConfig
- type ProviderConfig
- type QuickLaunchConfig
- type ROIConfig
- type RemoteConfig
- type ResumeConfig
- type RuntimeConfig
- type SessionsConfig
- type TasksConfig
Constants ¶
const ProjectConfigDir = ".aimux"
ProjectConfigDir is the directory name for project-local config.
Variables ¶
var SupportedProviders = []string{"claude", "codex"}
SupportedProviders is the canonical list of provider names aimux recognises. Add a new entry here when onboarding a new provider — tests and validation derive from this list automatically.
Functions ¶
func AgentConfigNames ¶ added in v0.13.0
func AgentConfigNames(agents []AgentConfig) []string
AgentConfigNames returns sorted names from a list of agent configs.
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the default config file path: ~/.aimux/config.yaml
func ModeFlags ¶ added in v0.13.0
ModeFlags returns the CLI flags for a given permission mode. Used by provider.SpawnCommand, controller.ResumeCommand, and CLI spawn.
func ShellRCPrefix ¶
ShellRCPrefix returns a shell command prefix that sources the user's RC file. This ensures shell functions and env vars are available when running commands via login shell (zsh -lc alone doesn't source .zshrc for non-interactive shells).
Types ¶
type AgentConfig ¶ added in v0.13.0
type AgentConfig struct {
Name string `yaml:"name"`
Runtime string `yaml:"runtime"`
Inference string `yaml:"inference,omitempty"`
Model string `yaml:"model,omitempty"`
Prompt string `yaml:"prompt,omitempty"`
MCP []string `yaml:"mcp,omitempty"`
Skills []string `yaml:"skills,omitempty"`
Policy string `yaml:"policy,omitempty"`
}
AgentConfig defines a named agent configuration loaded from agents.yaml.
func LoadAgents ¶ added in v0.13.0
func LoadAgents(path string) ([]AgentConfig, error)
LoadAgents reads agent configs from a YAML file. Returns nil, nil if the file does not exist.
func LoadAgentsMerged ¶ added in v0.13.0
func LoadAgentsMerged(globalPath, projectPath string) []AgentConfig
LoadAgentsMerged loads agents from global and project-local files, merging them with project-local configs overriding global ones by name.
type BadgeRule ¶ added in v0.11.0
type BadgeRule struct {
Path string `yaml:"path"`
JSONPath string `yaml:"json_path"`
Label string `yaml:"label"`
Color string `yaml:"color"`
}
BadgeRule maps a project file path to a badge display.
type Config ¶
type Config struct {
Providers map[string]ProviderConfig `yaml:"providers"`
RefreshInterval string `yaml:"refresh_interval"`
Runtime string `yaml:"runtime"` // WHERE: "local" or "container" (default: local)
Execution string `yaml:"execution"` // WHERE tools run: "local" or "hybrid" (default: local)
Shell string `yaml:"shell"` // WHICH shell: e.g. "/bin/zsh" (default: $SHELL)
SessionManager string `yaml:"session_manager"` // SESSION: "tmux" or "direct" (default: tmux)
DefaultMode string `yaml:"default_mode"` // PERMISSIONS: "default", "bypass", "plan", "acceptEdits", "dontAsk"
Export ExportConfig `yaml:"export"` // OTEL export settings
OTELReceiver OTELReceiverConfig `yaml:"otel"` // OTEL receiver settings
Resume ResumeConfig `yaml:"resume"` // resume defaults
Sessions SessionsConfig `yaml:"sessions"` // session history settings
Notifications NotificationsConfig `yaml:"notifications"` // macOS notification settings
Kubernetes K8sProviderConfig `yaml:"kubernetes"` // Kubernetes provider settings
Remote RemoteConfig `yaml:"remote"` // Remote backend (OpenShell or K8s)
QuickLaunch QuickLaunchConfig `yaml:"quick_launch"` // quick launch directories
Tasks TasksConfig `yaml:"tasks"` // Google Tasks integration
AutoArchiveAfter string `yaml:"auto_archive_after"` // idle duration before auto-archiving (e.g. "1h", "30m")
Badges []BadgeRule `yaml:"badges"` // project file badge rules
Runtimes map[string]RuntimeConfig `yaml:"runtimes"` // named runtime environments
ROI ROIConfig `yaml:"roi"` // per-session ROI settings
Coordination CoordinationConfig `yaml:"coordination"` // coordination backend settings
Environments map[string]EnvironmentConfig `yaml:"environments"` // named environments for agent execution
AgentConfigs []AgentConfig `yaml:"-"` // loaded from agents.yaml, not config.yaml
}
Config holds the aimux configuration.
func Default ¶
func Default() Config
Default returns the configuration used when no config file is present. All known providers are enabled. The Kubernetes provider is disabled by default because it requires a Redis URL and team ID to be useful. A default "local" environment is always created.
func Load ¶
Load reads a YAML config file and merges it with the defaults. If the file does not exist, Default() is returned with no error.
func LoadProject ¶ added in v0.11.0
LoadProject reads project-local config from dir/.aimux/config.yaml and merges it over the global config. Project values override global values. If no project config exists, the global config is returned unchanged.
func (Config) ArchiveThreshold ¶ added in v0.11.0
ArchiveThreshold returns the parsed auto-archive duration. Returns 0 if the field is empty, unparseable, or explicitly set to "0".
func (Config) IsProviderEnabled ¶
IsProviderEnabled returns true if the named provider is enabled in the config. Unknown providers (not in the map) are enabled by default.
func (Config) OTELEndpoint ¶
OTELEndpoint returns the OTEL receiver endpoint URL, or "" if disabled.
func (Config) OTELReceiverPort ¶
OTELReceiverPort returns the configured OTEL receiver port, defaulting to 4318.
func (Config) ResolveShell ¶
ResolveShell returns the shell to use for spawning agents in tmux sessions. Priority: config shell > $SHELL env var > /bin/sh (POSIX fallback).
type CoordinationConfig ¶ added in v0.13.0
type CoordinationConfig struct {
RedisURL string `yaml:"redis_url"`
TeamID string `yaml:"team_id"`
}
CoordinationConfig holds settings for the multi-agent coordination backend.
type EnvironmentConfig ¶ added in v0.13.0
type EnvironmentConfig struct {
Type string `yaml:"type"` // "local", "openshell", "k8s"
Gateway string `yaml:"gateway"` // OpenShell gateway URL
Insecure bool `yaml:"insecure"`
Image string `yaml:"image"`
RedisURL string `yaml:"redis_url"` // K8s only
Namespace string `yaml:"namespace"`
Kubeconfig string `yaml:"kubeconfig"`
}
EnvironmentConfig holds settings for a named environment where agents can execute.
type ExportConfig ¶
type ExportConfig struct {
Endpoint string `yaml:"endpoint"` // OTLP/HTTP endpoint, e.g., "localhost:5001"
Insecure bool `yaml:"insecure"` // true for HTTP (no TLS), default true
Headers map[string]string `yaml:"headers,omitempty"` // extra HTTP headers for the export endpoint
// Backend-specific settings
MLflow MLflowConfig `yaml:"mlflow,omitempty"` // MLflow-specific config
}
ExportConfig holds settings for exporting traces via OTLP/HTTP.
type K8sMCPConfig ¶ added in v0.13.0
type K8sMCPConfig struct {
AutoRegister bool `yaml:"auto_register"`
}
K8sMCPConfig holds settings for auto-registering the MCP server.
type K8sProviderConfig ¶ added in v0.7.0
type K8sProviderConfig struct {
Enabled bool `yaml:"enabled"`
RedisURL string `yaml:"redis_url"` // e.g. "redis://:pass@localhost:6380"
TeamID string `yaml:"team_id"` // Redis team key prefix, e.g. "my-team"
Namespace string `yaml:"namespace"` // K8s namespace, e.g. "agents"
Kubeconfig string `yaml:"kubeconfig"` // path to kubeconfig; empty = KUBECONFIG env or in-cluster
OTELEndpoint string `yaml:"otel_endpoint"` // e.g. "http://<elb>:4318" — OTel Collector for remote agent traces
MaxAgents int `yaml:"max_agents"`
MaxCostUSD float64 `yaml:"max_cost_usd"`
MCP K8sMCPConfig `yaml:"mcp"`
}
K8sProviderConfig holds connection settings for the Kubernetes agent provider. Agents are discovered via Redis heartbeats rather than local process scanning.
K8s is considered enabled when RedisURL is set (Enabled field is kept for backward compatibility but RedisURL is the real gate).
func (K8sProviderConfig) IsActive ¶ added in v0.7.0
func (c K8sProviderConfig) IsActive() bool
IsActive returns true when K8s is configured and usable. Requires both enabled flag and a Redis URL.
type MLflowConfig ¶
type MLflowConfig struct {
ExperimentID string `yaml:"experiment_id"` // MLflow experiment ID
}
MLflowConfig holds MLflow-specific export settings.
type NotificationsConfig ¶ added in v0.8.0
type NotificationsConfig struct {
Enabled bool `yaml:"enabled"` // master switch (default: true)
OnWaiting bool `yaml:"on_waiting"` // agent needs permission (default: true)
OnError bool `yaml:"on_error"` // agent crashed (default: true)
OnIdle bool `yaml:"on_idle"` // agent finished turn (default: false)
OnDone bool `yaml:"on_done"` // agent finished (default: true)
Sound bool `yaml:"sound"` // play macOS sound (default: false)
Bell bool `yaml:"bell"` // terminal bell on attention events (default: true)
Desktop bool `yaml:"desktop"` // macOS notification center (default: true)
}
NotificationsConfig controls macOS notification behavior.
type OTELReceiverConfig ¶
type OTELReceiverConfig struct {
Enabled bool `yaml:"enabled"` // false by default
Port int `yaml:"port"` // default 4318
}
OTELReceiverConfig holds settings for the embedded OTLP/HTTP receiver.
type ProviderConfig ¶
type ProviderConfig struct {
Enabled bool `yaml:"enabled"`
Binary string `yaml:"binary,omitempty"`
}
ProviderConfig controls a single provider's behaviour.
type QuickLaunchConfig ¶ added in v0.9.0
type QuickLaunchConfig struct {
Directories []string `yaml:"directories"`
}
QuickLaunchConfig holds directories for quick agent launch.
type ROIConfig ¶ added in v0.12.0
type ROIConfig struct {
HourlyRate float64 `yaml:"hourly_rate"` // developer hourly rate in USD (default: 150)
}
ROIConfig holds settings for per-session ROI calculation.
type RemoteConfig ¶ added in v0.13.0
type RemoteConfig struct {
Backend string `yaml:"backend"` // "openshell" or "k8s"
Gateway string `yaml:"gateway"` // OpenShell gateway URL
Image string `yaml:"image"` // default sandbox image
WarmPool int `yaml:"warm_pool"` // number of pre-created sandboxes
}
RemoteConfig holds settings for the remote agent backend.
type ResumeConfig ¶ added in v0.10.0
type ResumeConfig struct {
SkipPermissions bool `yaml:"skip_permissions"` // always pass --dangerously-skip-permissions
}
ResumeConfig holds defaults for the resume command.
type RuntimeConfig ¶ added in v0.11.0
type RuntimeConfig struct {
Type string `yaml:"type"` // "local", "container", "openshell"
Engine string `yaml:"engine,omitempty"` // container engine: "podman" or "docker"
Image string `yaml:"image,omitempty"` // container image
Sandbox bool `yaml:"sandbox,omitempty"` // enable sandbox policy (openshell)
}
RuntimeConfig holds settings for a named runtime environment.
type SessionsConfig ¶ added in v0.5.0
type SessionsConfig struct {
AutoTitle bool `yaml:"auto_title"` // generate titles via LLM on discovery
TitleModel string `yaml:"title_model"` // "haiku" (default), "sonnet", "opus"
APIKey string `yaml:"api_key"` // API key for title generation (overrides env vars)
}
SessionsConfig holds settings for the session history feature.
type TasksConfig ¶ added in v0.9.0
type TasksConfig struct {
Backend string `yaml:"backend"` // "auto", "mcp", or "api"
MCPEndpoint string `yaml:"mcp_endpoint"` // MCP server endpoint URL
DefaultList string `yaml:"default_list"` // default task list ID
PromptTemplate string `yaml:"prompt_template"` // template for agent prompts
}
TasksConfig holds settings for Google Tasks integration.