Skip to content

Configuration

mbx loads environment variables over ~/.config/mbx/config.toml, then falls back to defaults. Unknown TOML keys are rejected so misspelled settings do not silently do nothing.

Example

toml
# ~/.config/mbx/config.toml
cache_dir = "/var/cache/mbx"
incremental = false
share_out_dir = false

[gc]
auto = true
max_size = "20GiB"
interval = "1h"

[target]
views = true

[remote]
url = "https://cache.example.com"
namespace = "acme/backend"
mode = "read-write"

[http]
timeout = "30s"
download_timeout = "10m"
retries = 3

Settings

EnvironmentTOML keyDefaultPurpose
MBX_CACHE_DIRcache_dirplatform cache directoryCache root
MBX_STATS_REPORTstats_reportunsetWrite a JSON build report
MBX_INCREMENTALincrementalfalseLet local workspace members compile incrementally
MBX_SHARE_OUT_DIRshare_out_dirfalseShare eligible compilations that read OUT_DIR
MBX_GC_AUTOgc.autotrueSweep after a build when due
MBX_GC_MAX_SIZEgc.max_size20GiBAction-store budget
MBX_GC_INTERVALgc.interval1hMinimum interval between automatic sweeps
MBX_TARGET_VIEWStarget.viewstrueLet mbx place eligible target directories
MBX_TARGET_ROOTtarget.root<cache>/targetsManaged target root
MBX_REMOTE_URLremote.urlunsetRemote cache URL
MBX_REMOTE_NAMESPACEremote.namespaceunsetRemote namespace; required with a URL
MBX_REMOTE_TOKENremote.tokenunsetBearer token
MBX_REMOTE_TOKEN_FILEremote.token_fileunsetFile containing a bearer token
MBX_REMOTE_OIDC_AUDIENCEremote.oidc_audienceunsetCI OIDC audience
MBX_REMOTE_MODEremote.moderead-writeread-write, read-only, or write-only
MBX_HTTP_TIMEOUThttp.timeout30sConnect and request timeout
MBX_HTTP_DOWNLOAD_TIMEOUThttp.download_timeout10mBlob download timeout
MBX_HTTP_RETRIEShttp.retries3Request retries

Diagnostic environment variables

These are environment-only:

EnvironmentPurpose
MBX_VERIFYCompile and consult the cache, then compare outputs
MBX_BYPASS_LOGAppend the full reason for every bypassed compilation

MBX_VERIFY=1 is deliberately slower. It qualifies correctness; it is not a normal build mode.

Incremental builds

MBX_INCREMENTAL=1 stops mbx from forcing CARGO_INCREMENTAL=0 locally. This can help an edit/rebuild loop, but an incremental workspace artifact changes the inputs of crates above it and reduces reuse across worktrees. CI always disables it because a fresh runner has no incremental state to reuse.

Sizes and durations

Sizes accept SI and IEC units. 20GB and 20GiB are different values. Durations accept values such as 30s, 15m, and 1h.

MIT LicenseCopyright © 2026jdx.dev