config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 Config

type Config struct {
	Providers       map[string]ProviderConfig `yaml:"providers"`
	RefreshInterval string                    `yaml:"refresh_interval"`
	DefaultRuntime  string                    `yaml:"default_runtime"`
	Shell           string                    `yaml:"shell"`         // login shell for spawning agents
	Export          ExportConfig              `yaml:"export"`        // OTEL export settings
	OTELReceiver    OTELReceiverConfig        `yaml:"otel"`          // OTEL receiver settings
	Sessions        SessionsConfig            `yaml:"sessions"`      // session history settings
	Notifications   NotificationsConfig       `yaml:"notifications"` // macOS notification settings
	Kubernetes      K8sProviderConfig         `yaml:"kubernetes"`    // Kubernetes provider 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 (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)
	Sound     bool `yaml:"sound"`      // play macOS sound (default: false)
}

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

Jump to

Keyboard shortcuts

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