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. For steady-state configuration (batch mode, turbo workers, HTTP port, license key, default test mode, coverage), use latdx config set instead of env vars. Env vars below are reserved for ephemeral overrides and debug escape hatches.

The latdx config CLI command currently exposes a single key (channel); see cli-reference.md. The env vars below are reserved for ephemeral overrides and debug escape hatches.


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 non-empty value disables spinners and live renderer; forces plain output.unset
LATDX_DEBUGEnable namespaced trace channels (stderr). Accepts true / 1 (legacy) or namespace patterns. See LATDX_DEBUG namespace patterns in cli-reference.md.unset
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_LATDBLegacy alias: 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 four 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 (default) is the read-disabled parity floor: writes happen, reads always miss. 1 enables the CLOSURE_EMPTY rule. 2 adds CLOSURE_INVARIANCE. 3 adds SCHEMA_REV. Out-of-range values clamp to 0.0n/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.unsetn/a
LATDX_CACHE_SHADOW_RATESampling rate in [0, 1] for shadow-run validation at Phase >= 1. A sampled hit also runs through the engine; mismatches land in <cacheHome>/cache/shadow-mismatches.ndjson and the engine outcome wins.0.01n/a

Salesforce integration

VariableDescriptionDefault
LATDX_SF_INSTALL_METHODHow latdx-sf installs into the org. Values: SOURCE, MANAGED_PKG. Defaults to MANAGED_PKG when a managed package id is available (release binaries bake __LATDX_SF_PACKAGE_ID__, or LATDX_SF_PACKAGE_ID is exported); otherwise defaults to SOURCE so dev checkouts run without ceremony. Legacy alias SF_PACKAGE_INSTALL_METHOD is honored with a deprecation warning.auto
LATDX_SF_SOURCE_PATHOverride path to the latdx-sf/src/main directory. Highest-priority resolution. Absolute path.auto-discovered
LATDX_SF_PACKAGE_IDManaged package version ID (04t...). Env var beats the compile-time define in release binaries.baked-in 04t...
LATDX_SF_PACKAGE_VERSIONMinimum managed-package version expected in the org. Semver string.baked-in
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.


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=true is not set. Values: true. Runtime install/upgrade is gated by the explicit --install flag and never reads this variable.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

The following env vars are no longer read. CLI flags cover per-run overrides; persistent equivalents live in the VS Code extension’s latdx.* settings (the CLI’s own latdx config exposes only channel).

VariableReplacement
LATDX_COVERAGE_ENABLED--no-coverage flag, or latdx.execution.enableCoverageAndDecoration (extension)
LATDX_TURBO_WORKERS--concurrency <n> flag, or latdx.execution.turboModeWorkers (extension)
LATDX_TEST_MODELATDX_LATDB=off for full mode, or latdx.execution.defaultTestMode (extension)
LATDX_HTTP_ENABLEDlatdx.httpServer.enabled (extension)
LATDX_HTTP_PORTlatdx.httpServer.port (extension)
LATDX_LICENSE_KEYlatdx.licenseKey (extension)
SF_PACKAGE_INSTALL_METHODLATDX_SF_INSTALL_METHOD (legacy alias still works with deprecation warning)

See also

Last updated on