config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ProjectConfigDir = ".aimux"

ProjectConfigDir is the directory name for project-local config.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns the default config file path: ~/.aimux/config.yaml

func ShellRCPrefix

func ShellRCPrefix(shell string) string

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 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)
	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
	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
}

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.

func Load

func Load(path string) (Config, error)

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

func LoadProject(projectDir string, global Config) (Config, error)

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

func (c Config) ArchiveThreshold() time.Duration

ArchiveThreshold returns the parsed auto-archive duration. Returns 0 if the field is empty, unparseable, or explicitly set to "0".

func (Config) IsProviderEnabled

func (c Config) IsProviderEnabled(name string) bool

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

func (c Config) OTELEndpoint() string

OTELEndpoint returns the OTEL receiver endpoint URL, or "" if disabled.

func (Config) OTELReceiverPort

func (c Config) OTELReceiverPort() int

OTELReceiverPort returns the configured OTEL receiver port, defaulting to 4318.

func (Config) ResolveShell

func (c Config) ResolveShell() string

ResolveShell returns the shell to use for spawning agents in tmux sessions. Priority: config shell > $SHELL env var > /bin/sh (POSIX fallback).

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 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
}

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 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"` // "flash" (default), "haiku", "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.

Jump to

Keyboard shortcuts

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