Skip to main content

Guide

Configuration

Complete reference for Land's multi-file environment variable system — file hierarchy, sourcing cascade, variable domains, tier-gating feature mapping, consumer mapping, and usage examples.

Land uses a multi-file .env system with 18 files across 6 domains. Environment variables control which implementation variants (tiers) are compiled into Mountain and activated at runtime by Cocoon, Wind, Sky, and Output.


Naming Convention

  • Single-word PascalCase verbs (e.g., ProductVersion, TierFileSystem, Capture)
  • No LAND_ prefix — variables are named for what they do, not where they come from
  • One variable per line, KEY=value format, shell-sourced by TierEnvironment.sh

File Hierarchy

There are 18 environment files across 6 domains:

Core (.env.Land)

FilePathPurpose
Dev.env.LandProduct identity, tier-gating defaults, network ports
Sample.env.Land.SampleClean template with all tier defaults
Production.env.Land.ProductionProduction product identity (e.g., ProductCommit set to git SHA)

Node (.env.Land.Node)

FilePathPurpose
Dev.env.Land.NodeNode.js runtime config
Sample.env.Land.Node.SampleTemplate
Production.env.Land.Production.NodeProduction overrides

Extensions (.env.Land.Extensions)

FilePathPurpose
Dev.env.Land.ExtensionsExtension directory roots, dev/dev-load behavior
Sample.env.Land.Extensions.SampleTemplate
Production.env.Land.Production.ExtensionsProduction extension layout overrides

PostHog (.env.Land.PostHog)

FilePathPurpose
Dev.env.Land.PostHogPostHog project key, endpoint, OTLP config
Sample.env.Land.PostHog.SampleTemplate
Production.env.Land.Production.PostHogProduction telemetry (keys redacted)

Diagnostics (.env.Land.Diagnostics)

FilePathPurpose
Dev.env.Land.DiagnosticsDebug knobs (DevTools, smoke tests, tracing)
Sample.env.Land.Diagnostics.SampleTemplate with all knobs disabled
Production.env.Land.Production.DiagnosticsProduction overrides

Bundled (.env.Land.Bundled)

FilePathPurpose
Dev.env.Land.BundledWorkbench bundle layout
Sample.env.Land.Bundled.SampleTemplate
Production.env.Land.Production.BundledProduction bundle layout overrides

Sourcing Cascade

The sourcing cascade is orchestrated by Maintain/Script/TierEnvironment.sh. Each file is source-ed in order, so later files override earlier ones for the same key.

Sourcing Order

Step  +------------------------------+
  1   | .env.Land                    |  Core dev defaults
      | +-- fallback: .env.Land.Sample|  (used if dev file absent)
  2   | .env.Land.Production         |  Core prod overlay (if NODE_ENV=production or Profile contains "release")
  3   | .env.Land.Node               |  Node runtime dev defaults
      | +-- fallback: .env.Land.Node.Sample
  4   | .env.Land.Production.Node    |  Node runtime prod overlay
  5   | .env.Land.Extensions         |  Extension dirs dev defaults
      | +-- fallback: .env.Land.Extensions.Sample
  6   | .env.Land.Production.Extensions| Extension dirs prod overlay
  7   | .env.Land.PostHog            |  PostHog/OTLP dev defaults
      | +-- fallback: .env.Land.PostHog.Sample
  8   | .env.Land.Production.PostHog |  PostHog/OTLP prod overlay
  9   | .env.Land.Diagnostics        |  Debug knobs dev defaults
      | +-- fallback: .env.Land.Diagnostics.Sample
 10   | .env.Land.Production.Diagnostics| Debug knobs prod overlay
 11   | .env.Land.Bundled            |  Bundle layout dev defaults
      | +-- fallback: .env.Land.Bundled.Sample
 12   | .env.Land.Production.Bundled |  Bundle layout prod overlay
      +------------------------------+

Key Rules

  1. Overlay conditional — Production overlays are only sourced when NODE_ENV=production or the Profile variable contains the substring release. For all development profiles, only the dev files (steps 1, 3, 5, 7, 9, 11) are loaded.

  2. Fallback chain — If a dev file (e.g., .env.Land) is absent or empty, the corresponding .Sample file is sourced as a fallback.

  3. Last-write-wins — Since all files are shell-sourced into the same environment, identical keys in later files silently override earlier values. For example, Trace=all in .env.Land.PostHog is overridden by Trace= (empty) in .env.Land.Production.PostHog.

  4. Absent files skipped — Files that do not exist on disk are silently skipped. No error is raised.

  5. Build-time vs runtime — Variables set during the sourcing cascade are available at:

    • Build time — Read by Mountain/build.rs for cargo:rustc-env, cargo:rustc-cfg, and esbuild/Vite define substitutions.
    • Runtime — Read by Mountain (Rust std::env::var), Cocoon (esbuild constants), Wind (import.meta.env), and Sky (__LandTiers/__LandProduct).

Variables by Domain

Core

VariableDefaultProduction OverrideDomainDescriptionRead By
ProductVersion1.118.0Set by release pipelineCoreProduct version string; must satisfy every built-in extension’s engines.vscode rangeMountain build.rs, Sky product.json
ProductCommitdevActual git SHA at tag timeCoreSet by release pipeline to the commit SHA at tag timeMountain build.rs
ProductQualitydevelopmentstableCoreFlips Wind’s productService into release-channel mode; gates inline NLS source-map probeMountain build.rs, Wind productService
ProductNameShortLand(same)CoreShort product nameMountain build.rs, Cocoon, Sky
ProductNameLongLand Editor(same)CoreLong/full product nameMountain build.rs, Cocoon, Sky
ProductApplicationNameland(same)CoreApplication executable nameMountain build.rs, Cocoon
ProductDataFolderName.land(same)CoreUser data folder name (e.g., ~/.land)Mountain build.rs
ProductUrlProtocolland(same)CoreCustom URL protocol scheme (land://...)Mountain build.rs
ProductServerApplicationNameland-server(same)CoreServer application nameMountain build.rs
ProductEmbedderIdentifierfiddee-desktop(same)CoreEmbedder identifier for TauriMountain build.rs
ProductFlavorIWTNMMMMMMPer-flavor overlayCore10-char build flavor code appended to identifiers (e.g. fiddee-IWTNMMMMMM). Each flavor gets isolated data/config. Set ProductFlavorLong=true for human-readable names (fiddee-F8).Maintain/ResolveProductConfig.sh, Sky product.json
ProductFlavorLongfalse(same)CoreWhen true, uses short human-readable flavor names (F8, FR, FN, FC) instead of 10-char encodingMaintain/ResolveProductConfig.sh
NetworkMountainPort50051(same)CoregRPC port for Mountain RPC serviceMountain build.rs, Cocoon, Vine (stub generation)
NetworkCocoonPort50052(same)CoregRPC port for Cocoon RPC serviceMountain build.rs, Cocoon, Vine (stub generation)
TierRemoteProcedureCallgRPC(same)CoreRPC transport: gRPC or SharedMemoryMountain build.rs (feature gate), Cocoon
TierHTTPProxyHandRolled(same)CoreHTTP proxy: HandRolled or HyperMountain build.rs (feature gate), Cocoon
TierLoggerStandard(same)CoreLogger backend: Standard or RingMountain build.rs (feature gate), Cocoon
TierFileSystemLayer2(same)CoreFile system implementation: Layer2, Layer3, or Layer4Mountain build.rs (feature gate), Cocoon
TierFindFilesLayer3(same)CoreFile search: Layer3 or Layer4Mountain build.rs (feature gate), Cocoon
TierGlobJavaScript(same)CoreGlob matching: JavaScript or NativeMountain build.rs (feature gate), Cocoon
TierFileWatcherLayer4(same)CoreFile watcher: Layer4 (native notify) or Stub (drops all registrations)Mountain build.rs (feature gate), Cocoon
TierSchemeAssetsEmbedded(same)CoreAsset scheme handler: Embedded, Hybrid, or FileSystemMountain build.rs (feature gate), Cocoon
TierConfigurationCache(same)CoreConfiguration service: Cache or EagerMountain build.rs (feature gate), Cocoon
TierDiagnosticsFull(same)CoreDiagnostics propagation: Full or DeltaMountain build.rs (feature gate), Cocoon
TierClipboardLayer3(same)CoreClipboard: Layer3, Layer4, or Layer5Mountain build.rs (feature gate), Cocoon
TierOpenExternalLayer3(same)CoreOpen external links: Layer3 or Layer4Mountain build.rs (feature gate), Cocoon
TierDocumentMirrorFull(same)CoreDocument mirror mode: Full or LazyMountain build.rs, Cocoon
TierExtensionActivationParallel8(same)CoreExtension activation concurrency: Sequential, Parallel4, Parallel8, or Parallel16Mountain build.rs, Cocoon
TierExtensionScanSequential(same)CoreExtension scan: Sequential or ParallelMountain build.rs (feature gate), Cocoon
TierModuleCacheSimple(same)CoreModule caching: Simple, Off, or SharedMountain build.rs, Cocoon
TierTelemetrySynchronous(same)CoreTelemetry transport: Synchronous, Batched, or OffMountain build.rs, Cocoon
TierIPCMountain(same)CoreIPC routing tier: Mountain (all calls to native backend), NodeDeferred (Mountain first, Cocoon fallback on miss), Node (all calls to Cocoon Node.js). Runtime switch — no rebuild required.Wind TauriMainProcessService.ts, Output Service.ts

Node

VariableDefaultProduction OverrideDomainDescriptionRead By
Pick(empty)(empty)NodeAbsolute path to a Node.js binary override. If set and the file exists, it is used unconditionally. Example: /opt/homebrew/opt/node@22/bin/nodeCocoon spawn
Require20(same)NodeMinimum Node.js major version required by Cocoon. Cocoon needs >= 20 for AbortSignal and structuredClone.Cocoon version check

Extensions

VariableDefaultProduction OverrideDomainDescriptionRead By
Ship(empty)Auto-resolves to Tauri bundle’s Resources directoryExtensionsBuilt-in extension source directory. In dev, resolves to Element/Sky/Target/Static/Application/extensions.Mountain runtime (std::env::var)
Lodge(empty)Auto-resolves to $HOME/.land/extensions (Unix) / %APPDATA%\Land\extensions (Windows)ExtensionsUser extension install root. VS Code equivalent: ~/.vscode/extensionsMountain runtime (std::env::var)
Extend(empty)(empty)ExtensionsAdditional extension paths. Colon-separated on macOS/Linux, semicolon-separated on Windows. Matches --extensions-dir.Mountain runtime (std::env::var)
Probe(empty)(empty)ExtensionsDevelopment extensions root. Matches --extensionDevelopmentPath. Extensions here always load regardless of enablement state.Mountain runtime (std::env::var)
Skipfalse(same)ExtensionsSkip built-in extensions (--disable-extensions). When true, only user and dev extensions load.Output pipeline
Mutefalse(same)ExtensionsMute all extensions (built-in, user, dev). For kernel-only debugging with no extension host.Output pipeline
WiretruefalseExtensionsAuto-install built-in extensions’ runtime dependencies (npm install --production at copy time). Off in prod because built-ins are pre-bundled.Cocoon, Output
InstalltruetrueExtensionsAuto-install runtime dependencies for user-installed extensions (same as Wire, applied to user tree).Cocoon

PostHog (Telemetry)

VariableDefaultProduction OverrideDomainDescriptionRead By
Authorizephc_mvbuxcLutfZctCVwnC4TTksmtNPPVgcx7gX96tTuCKk4(empty)PostHogPostHog project key (phc_ prefix = public client-side key)Sky telemetry service
Beamhttps://eu.i.posthog.com(same)PostHogPostHog region endpoint. Use https://us.i.posthog.com for US Cloud.Sky telemetry service
ReporttruefalsePostHogMaster switch for telemetry across all tiersSky telemetry service
Throttle5(same)PostHogSky-side rate limit (max bursts)Sky telemetry service
Buffer3000(same)PostHogBuffer size in milliseconds for batching eventsSky telemetry service
Batch20(same)PostHogBatch size for PostHog event submissionSky telemetry service
Cap7(same)PostHogGlobal cap on Sky $exception captures per 10-second windowSky telemetry service
Replayfalse(same)PostHogSession recording toggleSky telemetry service
Askfalse(same)PostHogPostHog surveys toggleSky telemetry service
Brandnikola(empty)PostHogDistinct-ID seed (e.g., GitHub username). Empty = auto-generated per-process.Sky telemetry service
CapturetruefalsePostHogMaster telemetry kill switch. false short-circuits BOTH PostHog and OTLP everywhere.Sky telemetry service
Traceall(empty)PostHogSpan filter. Comma-separated list of element/tag names, or all. Examples: all, mountain,cocoon,ipc,extension-host.Mountain runtime, Sky

OTLP (OpenTelemetry)

VariableDefaultProduction OverrideDomainDescriptionRead By
OTLPEndpointhttp://127.0.0.1:4318(same)OTLPOTLP collector endpoint (Jaeger all-in-one HTTP receiver)OTLP exporter
OTLPEnabledtruefalseOTLPOTLP exporter toggleOTLP exporter
Record00OTLPMirror PostHog batches + OTLP payloads to per-session NDJSON log file. Set to 1 to enable.OTLP exporter, Sky telemetry

Diagnostics

VariableDefaultProduction OverrideDomainDescriptionRead By
Inspect(unset)(unset)DiagnosticsAuto-open Mountain’s WKWebView DevTools at boot. macOS steals first-responder focus. Commonly set to 1 to enable.Mountain runtime
Smoke(unset)(unset)DiagnosticsRun boot-time smoke harness against Wind’s CommandCatalog. Three gates OR’d: build-time Smoke=1, URL ?Smoke=1, or localStorage.setItem("Smoke","1").Mountain runtime, Wind
Trace(unset)(unset)DiagnosticsDev-log tag selection. Comma-separated or all. Common tags: lifecycle, ipc, extensions, tree-view, terminal, grpc, cocoon, scheme-assets, window, sky-emit, dual-track. Unset = tag-free output.Mountain runtime
Record00DiagnosticsPersist Mountain dev log to disk at <app-data>/logs/<timestamp>/Mountain.dev.log. Set to 1 to enable.Mountain runtime
DisablefalsefalseDiagnosticsMaster kill switch. Skips every Land shim/polyfill/connection. Output transforms dropped, Cocoon/Air spawn skipped, CloseRequested intercept disabled, SkyBridge not installed. Also controllable via localStorage.setItem("Disable","1").Output, Mountain, Cocoon
DisableUIFixes(unset)(unset)DiagnosticsWhen set to true, skips only UI/rendering/CSS/animation transforms. All wire patches, IPC, extensions, rewrites, and overlays remain active. Narrower than Disable=true.Output, Sky
DebugServer(unset)(unset)DiagnosticsStart Mountain’s HTTP debug server. 1 = Mountain only on 127.0.0.1:9933. both = Mountain :9933 + Cocoon :9934.Mountain runtime
DebugServerPort9933(unset)DiagnosticsPort for Mountain’s HTTP debug server (default 9933).Mountain runtime
HotReload(unset)(unset)DiagnosticsEnable hot reload in dev mode. Set to true to activate. Used by Maintain/Debug/Run.sh.Debug/Run.sh
Watch(unset)(unset)DiagnosticsEnable file watching in dev mode. Set to true to activate file-change-triggered rebuilds.Debug/Run.sh
LiveReloadPort3001(unset)DiagnosticsPort for the live-reload server started by Debug/Run.sh (default 3001).Debug/Run.sh

Bundled

VariableDefaultProduction OverrideDomainDescriptionRead By
Pack(empty)electron browser sessions workbenchBundledSpace-separated list of workbench variants for bundled Vite/Astro tree. Valid: electron, browser, sessions, workbench. Empty = no bundled tree (dynamic-import path used). Profile-level overrides in Build.sh: debug-electron-bundled -> Pack="electron", debug-browser-bundled -> Pack="browser", etc.Sky, Vite builder
BootfalsetrueBundledWhen true, index.astro renders bundled Layout for active workbench. When false, dynamic-import path is used.Sky, Astro build

Build-Shim

These variables are not stored in .env files. They are exported by Build.sh during the build process and consumed by various consumers.

VariableDefaultProduction OverrideDomainDescriptionRead By
ProfileBuild profile name (e.g., debug-electron-bundled)VariesBuild-ShimBuild profile name. Passed to TierEnvironment.sh to determine production overlay sourcing.TierEnvironment.sh, Build scripts
PackSet by profile case statementsSet by profile case statementsBuild-ShimWorkbench pack. Overridden per-profile in Build.sh case statements.Build scripts
BootSet by profile case statementsSet by profile case statementsBuild-ShimBoot mode. Overridden per-profile in Build.sh case statements.Build scripts
Browsertrue for browser profilestrue for browser profilesBuild-Shim"true" when building a browser profile.Build scripts
Mountaintrue for mountain profilestrue for mountain profilesBuild-Shim"true" when building a Mountain profile.Build scripts
Electrontrue for electron profilestrue for electron profilesBuild-Shim"true" when building an Electron profile.Build scripts
BundleBundle info stringVariesBuild-ShimBundle metadata for the current build.Build scripts
Compilerrest or esbuildVariesBuild-ShimCompiler label for the current build pipeline.Output, Build scripts
LandIsProductionAuto-set by TierEnvironment.shtrueBuild-Shim"true" or "false". Auto-set by TierEnvironment.sh based on NODE_ENV and Profile.Build scripts
NODE_ENV(unset)productionBuild-ShimTriggers production overlay chain when set to production.TierEnvironment.sh, Node.js
BundleLeveldebugreleaseBuild-ShimPassed to Maintain/Script/SignBundle.sh to select the Tauri build output directory (Target/debug/ or Target/release/). Set to debug for debug builds, release for production builds.SignBundle.sh
CopyToDesktop(unset)(unset)Build-ShimWhen set to any non-empty value, copies the signed .app bundle to ~/Desktop after signing. Convenience shortcut for quick launch from Finder.SignBundle.sh
MountainDirElement/Mountain(same)Build-ShimOverride the Mountain element root directory. Default is Element/Mountain. Used by SignBundle.sh to locate Entitlements.plist and the Tauri bundle output.SignBundle.sh

Tier-Gating Feature Mapping

Tier values from .env.Land are translated by TierEnvironment.sh into Cargo feature flags passed to Mountain’s build.rs. The mapping is as follows:

Environment VariableValueCargo Feature Activated
TierRemoteProcedureCallSharedMemoryTierRemoteProcedureCallSharedMemory
TierHTTPProxyHyperTierHTTPProxyHyper
TierLoggerRingTierLoggerRing
TierFileSystemLayer4TierFileSystemLayer4
TierFindFilesLayer4TierFindFilesLayer4
TierGlobNativeTierGlobNative
TierFileWatcherLayer4TierFileWatcherLayer4
TierSchemeAssetsHybridTierSchemeAssetsHybrid
TierConfigurationEagerTierConfigurationEager
TierDiagnosticsDeltaTierDiagnosticsDelta
TierClipboardLayer4TierClipboardLayer4
TierOpenExternalLayer4TierOpenExternalLayer4
TierExtensionScanParallelTierExtensionScanParallel

Notes

  • Default values do not activate features. The Cargo features listed above are only enabled when the variable is explicitly set to the non-default value. For example, TierFileSystem=Layer2 (the default) does not activate any feature; only TierFileSystem=Layer4 activates TierFileSystemLayer4.
  • Layer3 and Layer5 values (e.g., TierClipboard=Layer3, TierFileSystem=Layer3) are implementation choices embedded in Mountain’s code paths but do not correspond to Cargo features in the current mapping.
  • Tier values without feature mappings (TierDocumentMirror, TierExtensionActivation, TierModuleCache, TierTelemetry) are read at runtime via std::env::var and influence behavior without requiring a compile-time feature gate.

Consumer Mapping

This table shows which Elements read which variables and through what mechanism.

VariableMountain build.rsMountain Runtime (Rust)Cocoon (Node.js)Wind (TypeScript/Vite)Sky (Astro)Output (ESBuild)Build Scripts
ProductVersionrustc-env-esbuild defineVite define__LandProduct-Build.sh
ProductCommitrustc-env-esbuild defineVite define__LandProduct-Build.sh
ProductQualityrustc-env-esbuild defineVite define__LandProduct-Build.sh
ProductNameShortrustc-env-esbuild defineVite define__LandProduct-Build.sh
ProductNameLongrustc-env-esbuild defineVite define__LandProduct-Build.sh
ProductApplicationNamerustc-env-esbuild defineVite define--Build.sh
ProductDataFolderNamerustc-env-esbuild define---Build.sh
ProductUrlProtocolrustc-env-----Build.sh
ProductServerApplicationNamerustc-env-----Build.sh
ProductEmbedderIdentifierrustc-env-----Build.sh
NetworkMountainPortrustc-env-esbuild define----
NetworkCocoonPortrustc-env-esbuild define----
TierRemoteProcedureCallrustc-cfg-esbuild define----
TierHTTPProxyrustc-cfg-esbuild define----
TierLoggerrustc-cfg-esbuild define----
TierFileSystemrustc-cfg-esbuild define----
TierFindFilesrustc-cfg-esbuild define----
TierGlobrustc-cfg-esbuild define----
TierFileWatcherrustc-cfg-esbuild define----
TierSchemeAssetsrustc-cfg-esbuild define----
TierConfigurationrustc-cfg-esbuild define----
TierDiagnosticsrustc-cfg-esbuild define----
TierClipboardrustc-cfg-esbuild define----
TierOpenExternalrustc-cfg-esbuild define----
TierDocumentMirrorrustc-env-esbuild define----
TierExtensionActivationrustc-env-esbuild define----
TierExtensionScanrustc-cfg-esbuild define----
TierModuleCacherustc-env-esbuild define----
TierTelemetryrustc-env-esbuild define----
TierIPC-std::env::var-IPC routing selection---
Pick--Spawn binary selection---Build.sh
Require--Version check---Build.sh
Ship-std::env::var----Build.sh
Lodge-std::env::var----Build.sh
Extend-std::env::var----Build.sh
Probe-std::env::var----Build.sh
Skip-----Transform drop-
Mute-----Transform drop-
Wire--Dependency install--Install skip-
Install--Dependency install----
Authorize----Telemetry init--
Beam----Telemetry init--
Report----Telemetry toggle--
Throttle----Rate limit--
Buffer----Batch config--
Batch----Batch config--
Cap----Exception cap--
Replay----Session recording--
Ask----Survey toggle--
Brand----Distinct ID--
Capture----Kill switch--
Trace (PostHog)-std::env::var--Span filter--
OTLPEndpoint----Exporter config--
OTLPEnabled----Exporter toggle--
Record (OTLP)----NDJSON log--
Inspect-std::env::var-----
Smoke-std::env::var-Smoke harness---
Trace (Diagnostics)-std::env::var-----
Record (Diagnostics)-std::env::var-----
Disable-localStorage---Transform drop-
DisableUIFixes-----Transform drop-
DebugServer-std::env::var-----
DebugServerPort-std::env::var-----
HotReload------Debug/Run.sh
Watch------Debug/Run.sh
LiveReloadPort------Debug/Run.sh
BundleLevel------SignBundle.sh
CopyToDesktop------SignBundle.sh
MountainDir-std::env::var----SignBundle.sh
Pack (Bundled)----Workbench render-Build.sh
Boot (Bundled)----Layout toggle-Build.sh

How Each Element Consumes Variables

ElementMechanismDetails
Mountain build.rscargo:rustc-envVariables embedded as rustc-env are available as compile-time constants via env!("VAR_NAME") in Rust code.
Mountain build.rscargo:rustc-cfgTier feature flags are emitted via cargo:rustc-cfg=feature="TierFileSystemLayer4", enabling #[cfg(feature = "...")] conditional compilation.
Mountain runtime (Rust)std::env::varVariables read at runtime via std::env::var("VAR_NAME"). These reflect the final sourced values and can differ between processes.
Cocoon (Node.js)esbuild defineTierEnvironment.sh generates an esbuild --define block via CocoonEsbuildDefine. Substitution looks like: --define:process.env.TierFileSystem="'Layer2'".
Wind (TypeScript)Vite defineVite’s define config injects import.meta.env.TierFileSystem into the Wind TypeScript bundle at build time.
Sky (Astro)Global + product.json__LandTiers (tier values) and __LandProduct (product identity) are injected as Astro globals and used for product.json generation.
Air (Rust)std::env::varReads ProductVersion for update channel selection. Other variables may be consumed at runtime as Air services initialize.
Vine (Rust)build.rs codegenNetworkMountainPort and NetworkCocoonPort are encoded into the generated gRPC stub constants during prost-build codegen via build.rs.
Output (ESBuild)Transform pipelineVariables like Skip, Mute, Disable control which transforms are applied to the ESBuild output pipeline.
localStorageRuntime overridelocalStorage.setItem("Disable", "1") and localStorage.setItem("Smoke", "1") in DevTools can flip gates at runtime without restarting.

localStorage Runtime Overrides

The following variables can be toggled at runtime via the browser DevTools console:

// Disable all Land shims/polyfills/connections
localStorage.setItem("Disable", "1");

// Enable boot-time smoke harness
localStorage.setItem("Smoke", "1");

Changes take effect on the next application cycle. A restart may be required for some gates.


Usage Examples

Overriding for Parallel Development Sessions

If you need to run multiple Land instances side-by-side with different tier configurations, edit the .Sample file and point specific sessions at it:

# Session 1: Default dev (reads .env.Land)
cd /Volumes/CORSAIR/Developer/macOS/Application/CodeEditorLand
cargo build -p mountain

# Session 2: Experimental layers
# Temporarily swap .env.Land with a custom file
cp .env.Land .env.Land.backup
cat > .env.Land << 'EOF'
TierFileSystem=Layer4
TierFindFiles=Layer4
TierFileWatcher=Layer4
EOF
cargo build -p mountain

# Restore original
mv .env.Land.backup .env.Land

Alternatively, use the .Sample file as a clean baseline for experiments:

# Keep your main .env.Land unchanged, experiment with Sample
cp .env.Land.Sample .env.Land.Experimental
# Edit .env.Land.Experimental with your changes
# The sourcing cascade will fall through to .Sample if no dev file exists

Enabling Telemetry Debugging

# In .env.Land.PostHog:
Authorize=phc_your_key_here
Beam=https://eu.i.posthog.com
Report=true
Capture=true
Trace=all
OTLPEndpoint=http://127.0.0.1:4318
OTLPEnabled=true
Record=1

Then run a local Jaeger instance:

docker run -d --name jaeger \
  -p 16686:16686 \
  -p 4318:4318 \
  jaegertracing/all-in-one:latest
  • Record=1 mirrors PostHog batches and OTLP payloads to NDJSON files at <app-data>/logs/<timestamp>/. Useful for offline inspection.
  • Trace=all captures spans for all elements. Narrow it down with Trace=mountain,cocoon to reduce noise.

Using localStorage to Flip Gates at Runtime

No restart required for these gates — toggle them in the DevTools console:

// Enable boot-time smoke test harness
localStorage.setItem("Smoke", "1");

// Disable all Land customizations (shims, polyfills, connections)
localStorage.setItem("Disable", "1");

To revert:

// Clear the override (or set to "0"/"false")
localStorage.removeItem("Smoke");
localStorage.removeItem("Disable");

Disabling All Land Customizations for Bisecting

When bisecting a regression, you may need to run with all Land-specific shims, polyfills, and connections disabled:

Method 1: .env.Land.Diagnostics file

# In .env.Land.Diagnostics or .env.Land.Diagnostics.Sample:
Disable=true

Method 2: localStorage (runtime only)

localStorage.setItem("Disable", "1");

When Disable=true:

  • All Output transforms are dropped
  • Cocoon and Air spawn are skipped
  • CloseRequested intercept is disabled
  • SkyBridge is not installed
  • The application falls back to vanilla VS Code behavior

This is ideal for git bisect to determine whether a regression originates in Land’s customization layer or upstream VS Code.

Switching Extension Loading Modes

# Load only user extensions, skip all built-ins
Skip=true

# Completely mute all extensions (no extension host)
Mute=true

# Load development extensions from a custom path
Probe=/path/to/my-extension

# Add additional extension directories (colon-separated)
Extend=/opt/custom-extensions:/home/user/more-extensions

Building for Production

The production overlay chain is triggered automatically:

export NODE_ENV=production
# or
export Profile=release-electron-bundled

This causes TierEnvironment.sh to source all .env.Land.Production.* overlays after their dev counterparts. Key differences:

VariableDevProduction
ProductQualitydevelopmentstable
ProductCommitdevActual git SHA
Wiretruefalse
Capturetruefalse
Authorize(dev key)(empty)
Reporttruefalse
OTLPEnabledtruefalse
Bootfalsetrue
Pack(empty)electron browser sessions workbench

Debugging Cocoon’s Node.js Version

# Force a specific Node.js binary
Pick=/opt/homebrew/opt/node@22/bin/node

# Check your current Node.js version (must be >= Require value)
node --version

# Change the minimum required version
Require=22

If Cocoon detects a version below Require, it will fail to spawn with a version mismatch error.

Enabling Persistent Mountain Logging

# In .env.Land.Diagnostics:
Record=1

Mountain’s dev log will be written to:

<app-data>/logs/<timestamp>/Mountain.dev.log

This is separate from the standard application log and includes all tagged output (if Trace is also set).


Appendices

A. Common Trace Tags

When Trace is set (in either PostHog or Diagnostics domain), these are the most common tag values:

TagCovers
allEvery tag (verbose)
lifecycleApplication startup, shutdown, window lifecycle
ipcInter-process communication messages
extensionsExtension loading, activation, deactivation
tree-viewExplorer tree view operations
terminalTerminal pane operations
grpcgRPC request/response tracing
cocoonCocoon (Node.js) process lifecycle and IPC
scheme-assetsCustom asset scheme handler operations
windowWindow management and rendering
sky-emitSky framework event emissions
dual-trackDual-track rendering pipeline
mountainMountain-specific operations

Combine tags: Trace=lifecycle,ipc,extensions,grpc

B. File Paths Summary

FileRelative Path (from repo root)
Core dev.env.Land
Core sample.env.Land.Sample
Core production.env.Land.Production
Node dev.env.Land.Node
Node sample.env.Land.Node.Sample
Node production.env.Land.Production.Node
Extensions dev.env.Land.Extensions
Extensions sample.env.Land.Extensions.Sample
Extensions production.env.Land.Production.Extensions
PostHog dev.env.Land.PostHog
PostHog sample.env.Land.PostHog.Sample
PostHog production.env.Land.Production.PostHog
Diagnostics dev.env.Land.Diagnostics
Diagnostics sample.env.Land.Diagnostics.Sample
Diagnostics production.env.Land.Production.Diagnostics
Bundled dev.env.Land.Bundled
Bundled sample.env.Land.Bundled.Sample
Bundled production.env.Land.Production.Bundled
Sourcing scriptMaintain/Script/TierEnvironment.sh