xa.config

TOML config loader for xa.

Resolves a host registry and settings from ~/.config/xa/config.toml (respecting $XDG_CONFIG_HOME). Override the path via $XA_CONFIG.

Example

[settings]
cache_dir = "~/.cache/xa/remotes"
stale_threshold_sec = 3600

[hosts.local]
kind = "local"

[hosts.devbox]
kind = "ssh"
host = "devbox"

[hosts.phone_mirror]
kind = "http"
base_url = "https://apps.example.com/api/xa"
auth = "basic"
username = "me"
password_env = "XA_PHONE_PASSWORD"   # value read from env, not stored in TOML

The registry exposed by load_hosts() is {name: Host} and can be passed directly to xa.sessions.list_sessions().

Functions

default_config_path()

load([path])

Return (settings, hosts_registry) from a config file.

load_hosts([path])

Shortcut: just the host registry.

Classes

Settings(cache_dir[, stale_threshold_sec, ...])

class xa.config.Settings(cache_dir, stale_threshold_sec=3600, claude_bin='claude', tmux_bin='tmux')[source]

Bases: object

xa.config.load(path=None)[source]

Return (settings, hosts_registry) from a config file.

Missing file → (defaults, {"local": LocalHost()}).

Return type:

tuple[Settings, dict]

xa.config.load_hosts(path=None)[source]

Shortcut: just the host registry.

Return type:

dict