Skip to Content
Environment Variables

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.


CLI updates

VariableDescriptionDefault
GITHUB_TOKENGitHub token that authenticates the GitHub API requests made by latdx upgrade, latdx upgrade check, and the background update check (the latest channel’s release listing, and the stable fallback when github.com’s release page gives no answer). Set it on a shared CI runner or behind NAT, where the 60 anonymous requests per hour per IP address run out. When GitHub rejects the token (for example an expired CI job token), the request is retried once without it.unset
GH_TOKENUsed the same way as GITHUB_TOKEN when GITHUB_TOKEN is unset.unset

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

The run header does not show engine, db, batch or anon mode. Its only additions are a cache off chip when the cache is off for the run (cache off (LATDX_CACHE_DISABLE=1) for the kill switch, cache off (--no-cache) for the flag) and auto-confirm when the run is non-interactive without --yes.

Test result cache

The cache is on by default. Turn it off for one command with --no-cache, or for every run with LATDX_CACHE_DISABLE=1; --force refreshes it (see test caching):

VariableDescriptionDefaultExperimental
LATDX_CACHE_DISABLEHard kill switch. Truthy values (1, true, on, yes, case-insensitive) stop cached results from being reused or stored, so the engine runs every selected method. It also turns off the --affected step that leaves out unchanged tests, so every test --affected selects runs.unsetn/a
LATDX_CACHE_PHASEDeprecated and ignored. Setting it has no effect except a warning from latdx test run and latdx validate asking you to remove it. Use --no-cache / LATDX_CACHE_DISABLE=1 to turn the cache off.unsetn/a
LATDX_CACHE_RULE_<NAME>Accepted for compatibility. Disabling a rule does not stop a matching cache key from being served, because the remaining rules still authorize the hit. Use --no-cache or LATDX_CACHE_DISABLE=1 to force tests to run.unsetn/a
LATDX_CACHE_RULE_POSITION_IDENTICAL_SAVENot a skip rule: it controls what the daemon does when you save a class. On by default, a .cls save that changes no Apex code and moves no code (for example rewording a comment) keeps cached test results, with the exceptions listed in Invalidation. 0, false, off, no (case-insensitive) turns this off, so the first save after a test run with the cache on clears cached results whatever it changed. The daemon reads it once, when it starts, from the environment of the command that starts it (usually your first latdx test run). Setting it for one command does not change a running daemon; run latdx daemon restart and start your next test run with the new value.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. On a disagreement, that run uses the fresh result and counts it in --json (cacheReport.shadowMismatches); no terminal warning is shown and the stored result is kept, so refresh it with --force. 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 or answers without a verdict (a 5xx, a 429, or an HTML error page), the same token and same license host may reuse the last signed access proof for this many seconds before dropping to Free. Only an explicit rejection of the token asks you to sign in again.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