Skip to Content
Environment Variables

Tune LATdx behavior without editing config files.

User-facing env vars consumed by the latdx CLI and core engine. CI/release-only vars (consumed by build and release tooling, not the latdx binary) are not documented here.

NOTE

Precedence: CLI flag > env var > user-global config (~/.latdx/config.json, written by latdx config set) > built-in default. Use latdx config set for persistent configuration; the env vars below are for ephemeral overrides and debug escape hatches.

The latdx config CLI command exposes a small set of keys (channel, autoUpdate, latdxBaseUrl); see cli-reference.md.


Logging and output

VariableDescriptionDefault
LATDX_LOG_LEVELCLI log verbosity. One of error, warn, warning, info, debug, trace, off, silent (warning aliases warn; silent aliases off). Overridden by -q / -v.warn
LATDX_LOG_FORMATOutput format (text, json). Overridden by --json.text
LATDX_RENDER_STYLELive test renderer style for latdx test run. One of compact, sf, flight. Overridden by --render-style <style>. Unrecognized values fall back to the default.compact
NO_COLORAny non-empty value disables ANSI color (per no-color.org ). Also honored via --no-color.unset
CIAny value except empty or an explicit opt-out (false, 0, off, no, any casing) marks the run as CI: disables spinners, the live renderer, and default progress snapshots; forces plain output; auto-confirms prompts.unset
LATDX_DEBUGEnable namespaced trace channels (stderr). Accepts true / 1 (legacy) or namespace patterns. See LATDX_DEBUG namespace patterns in cli-reference.md.unset
LATDX_AUTO_UPDATESet to 0, false, off, or no (case-insensitive) to disable the silent background self-update. Overrides the autoUpdate config key. See Automatic Background Updates in installation.md. CI runs are always skipped regardless.unset
LATDX_LOG_FILEPath override for the per-run CLI NDJSON log. Default writes to ~/.latdx/workspaces/<id>/logs/latdx-<runId>.ndjson. Set to off / disabled / false / 0 to disable the file sink entirely.unset
LATDX_DAEMON_LOG_FILEPath override for the daemon-side NDJSON log. Default writes to ~/.latdx/workspaces/<id>/logs/latdx-daemon-<runId>.ndjson. Set to off / disabled / false / 0 to disable.unset
LATDX_LOG_MAXMaximum number of NDJSON log files to keep per directory (CLI and daemon prune independently on startup). 0 disables pruning.10
NOTE

There is no --log-level flag by design: LATDX_LOG_LEVEL is env-only to keep the global flag surface compact. The --json flag is the canonical way to flip LATDX_LOG_FORMAT; the env var exists for callers that want NDJSON logs without flipping a per-command payload-shape switch.


Test execution

Defaults: --engine sf + --db normal. Anything else is experimental and gated behind LATDX_EXPERIMENTAL=1. Without the enabler, supplying any non-default value (flag or env var) errors with ExperimentalFeatureError.

VariableDescriptionDefaultExperimental
LATDX_EXPERIMENTALEnabler for experimental run-mode knobs and experimental subcommands (adapt, boost, clean, restore, uninstall). Truthy values: 1, true, yes, on (case-insensitive). Without the enabler the experimental subcommands are not registered (latdx --help omits them; invocation exits non-zero with “unknown command”).unsetn/a
LATDX_ENGINETest execution engine. sf (default) dispatches via @salesforce/apex-node’s TestService (class-granular coverage); latdx (experimental) uses the LATdx anon-apex runtime.sflatdx
LATDX_DBDatabase backing. normal (default) hits the org DB; mocked (experimental) uses LATdx in-memory simulation.normalmocked
LATDX_LATDBAlias: off/0/false maps to --db normal. Experimental in any non-default setting.unsetoff
LATDX_BATCH_MODEPacked-batch packing strategy. turbo (default) maximizes parallelism; eco (experimental) maximizes payload density.turboeco
LATDX_ANON_MODEAnon-Apex emission. named (default) invokes by name; inline (experimental) inlines the test body into the ExecuteAnonymous payload.namedinline

When any value diverges from the default, the run header echoes the active value (e.g. Engine: latdx, DB: mocked, Cache: off) so non-standard runs are obvious in the output.

Test result cache (ADR 0009)

The cache is on by default; safety comes from the phase gate, not from a flag (see test-caching.md). All of these switches are honoured by @latdx/core’s CachingTestRunner:

VariableDescriptionDefaultExperimental
LATDX_CACHE_DISABLEHard kill switch. Truthy values (1, true, on, yes, case-insensitive) skip every cache code path; the engine runs every method regardless of phase.unsetn/a
LATDX_CACHE_PHASEActive phase. 0 is the safe baseline: every test runs (results are cached but never reused). 1 enables CLOSURE_EMPTY. 2 adds CLOSURE_INVARIANCE. 3 adds SCHEMA_REV. 4 (default) adds per-method body, dynamic-pessimism, and schema-closure rules (requires Java 11+ on PATH or JAVA_HOME). Out-of-range or unparseable values clamp to 4.4n/a
LATDX_CACHE_RULE_<NAME>Per-rule disable. 0, false, off, no (case-insensitive) disables the named rule even when the active phase would otherwise include it. Known rules: CLOSURE_EMPTY, CLOSURE_INVARIANCE, SCHEMA_REV, METHOD_BODY_INVARIANCE, SCHEMA_CLOSURE, DYNAMIC_PESSIMISM.unsetn/a
LATDX_CACHE_SHADOW_RATEShadow-validation sample rate in [0, 1]. On runs that already execute some tests, this fraction of cache hits is re-run on the org and compared against the cached result; a disagreement is reported and the fresh result wins. Never fires on a full cache hit (no extra org round-trip). 0 disables it. Out-of-range or unparseable values fall back to the default.0.01n/a

Salesforce integration

VariableDescriptionDefault
LATDX_SKIP_TEST_RUNNER_ACCESSSkip auto-deploy/assign of the latdx_TestRunnerAccess permset. Values: 1, true.unset
NOTE

LATDX_SKIP_TEST_RUNNER_ACCESS is read when the daemon starts. If the daemon is already running, stop it (latdx daemon stop) and re-launch with the env var set so the daemon child inherits it.


Licensing

VariableDescriptionDefault
LATDX_BASE_URLLATdx site base URL for browser auth and live license/access checks. Overrides latdxBaseUrl in ~/.latdx/config.json; useful for local dev and staging smoke tests.unset
LATDX_LICENSE_BASE_URLLegacy alias for LATDX_BASE_URL. Prefer LATDX_BASE_URL for new scripts.unset
LATDX_LICENSE_KEYCLI identity token. Read before ~/.latdx/license.key and forwarded to the daemon for the current run. Useful on headless boxes and CI where the browser sign-in flow (latdx auth login) is not available. Plan/access is resolved live by the site; unlicensed/free runs cap at 100.unset
LATDX_LICENSE_GRACE_SECONDSOffline access grace window after a successful live resolve. If the license site is unreachable, the same token and same license host may reuse the last signed access proof for this many seconds before dropping to Free.86400

Diagnostics

VariableDescriptionDefault
LATDX_KEEP_TEMP_FILESKeep temp working directories on disk after a run. Useful for support tickets. Values: true.unset
LATDX_KEEP_SF_LOGSSkip deletion of Apex debug logs after a run. Values: true.unset

Interactive behavior

VariableDescriptionDefault
LATDX_AUTO_CONFIRMAuto-confirm interactive prompts (currently only the debug-log-storage cleanup prompt). Useful for non-interactive shells where CI is not set. Values: true.unset

Internal (set automatically; do not configure manually)

VariableDescriptionSet by
LATDX_DAEMONSignals the child process is running in daemon mode.DaemonSpawner
LATDX_DAEMON_LOGDaemon log file path.DaemonSpawner
LATDX_DAEMON_IPC_ENDPOINTIPC socket / named-pipe path used by the daemon.CLI / DaemonSpawner
LATDX_WORKSPACE_IDWorkspace identity passed to daemon child.DaemonSpawner
LATDX_WORKSPACE_ROOTWorktree root passed to daemon child.DaemonSpawner
SFDX_DISABLE_LOG_FILE, SF_DISABLE_LOG_FILEDisable SFDX file logging in Bun-compiled binaries.CLI entrypoint
WARNING

The internal variables above are set automatically by the CLI and daemon spawner. Setting them manually can corrupt daemon state or break IPC; treat them as read-only diagnostic signals.


Removed / deprecated

These environment variables are not read by the CLI. Where a user-facing equivalent exists, use it instead:

VariableReplacement
LATDX_COVERAGE_ENABLED--coverage flag (opt-in)
LATDX_TURBO_WORKERS--concurrency <n> flag
LATDX_TEST_MODELATDX_LATDB=off for full mode
LATDX_HTTP_ENABLEDInternal config (httpServer.enabled); not user-configurable
LATDX_HTTP_PORTInternal config (httpServer.port); not user-configurable
Last updated on