Configuration reference
Generated by scripts/docgen/config-ref. Do not edit by hand — run make docs-regen after changing internal/config/config.go or adding/removing a // docgen:env comment.
TOML config
Config file is loaded from $IBKR_CONFIG, else $XDG_CONFIG_HOME/ibkr/config.toml, else $HOME/.config/ibkr/config.toml. Every field is optional; absent fields take their documented default.
| Section | Field | Type | Description |
|---|---|---|---|
[daemon] | idle_timeout | duration | IdleTimeout is how long the auto-spawned daemon stays alive between CLI calls (default 15m, accepts any Go duration string like "1h" or "0s"); set "0s" to disable idle-shutdown when running long cold-start jobs such as the first breadth fan-out under ibkr daemon --foreground. |
[daemon] | log_level | string | LogLevel is the daemon's log verbosity — one of "debug", "info" (default), "warn", or "error". |
[gateway] | account | string | Account pins the IBKR account ID like "U1234567"; empty (default) defers to the gateway's managedAccounts list — fine for single-account logins, required disambiguator when the login carries multiple accounts. |
[gateway] | breadth_client_id | *int | BreadthClientID is the IBKR clientID used by the dedicated historical-bar connector that backs the SPX breadth refresh. |
[gateway] | client_id | *int | ClientID pins the IBKR API clientID for the primary connection (default 15); collisions with another running ibkr process auto-walk to the next free ID via the SDK's retry path. |
[gateway] | host | string | Host pins the IB Gateway / TWS host; empty (the default) defers to auto-discovery on loopback (127.0.0.1), any non-empty value skips probing. |
[gateway] | port | *int | Port pins the IB Gateway / TWS API port (typically 4001/4002 for IB Gateway live/paper, 7496/7497 for TWS live/paper); absent (nil) defers to port-probing during discovery. |
[gateway] | tls | *bool | TLS pins TLS mode for the API socket: absent (nil) auto-tries plain first then TLS, true forces TLS-only with no plain fallback, false forces plain — setting the field disables fallback in either direction. |
[spx] | members_auto_refresh | *bool | MembersAutoRefresh controls whether the daemon refreshes the S&P 500 constituent list from Wikipedia daily at 02:30 ET (default true; set false to pin the embedded baseline) — overridden symmetrically by the IBKR_SPX_MEMBERS_AUTO_REFRESH env var (1 force-on, 0 force-off). |
Environment variables
Read at process startup. Override TOML config where applicable; see the per-var description for precedence rules.
| Variable | Description |
|---|---|
IBKR_COLOR | Force terminal colour on (always), off (never); any other value defers to NO_COLOR + TTY detection. |
IBKR_CONFIG | Override the config.toml path. Defaults to $XDG_CONFIG_HOME/ibkr/config.toml or $HOME/.config/ibkr/config.toml. |
IBKR_INSTALL_DIR | Override the install directory for ibkr update. Defaults to $HOME/.local/bin. Phase-2 release pipeline uses this to sandbox dog-food installs to a tmp dir. |
IBKR_LOG | Override the daemon log file path. Defaults to $HOME/.local/state/ibkr/ibkr-daemon.log. |
IBKR_PACKET_LOG_TEMPLATE | Template path for raw IBKR wire-packet logs. Trailing / treats as directory; %d placeholder gets the gateway client ID. Unset disables wire logging. |
IBKR_SOCKET | Override the daemon IPC socket path. Defaults to $XDG_RUNTIME_DIR/ibkr/ibkr.sock or $HOME/.cache/ibkr/ibkr.sock. |
IBKR_SPX_MEMBERS_AUTO_REFRESH | Symmetric override of [spx] members_auto_refresh. 1 force-enables, 0 force-disables, unset / other defers to TOML. |
NO_COLOR | Standard https://no-color.org/ override. Any non-empty value disables colour regardless of IBKR_COLOR (unless IBKR_COLOR=always). |