config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 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
}

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.

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 MLflowConfig

type MLflowConfig struct {
	ExperimentID string `yaml:"experiment_id"` // MLflow experiment ID
}

MLflowConfig holds MLflow-specific export settings.

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.

Jump to

Keyboard shortcuts

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