Skip to main content

Environment Variables

This document specifies all environment variables recognized by Morphir.

Configuration Override Variables

Environment variables can override any configuration value using the naming convention:

MORPHIR__<SECTION>__<KEY>

See Merge Rules for details on how environment overrides work.

Core Environment Variables

MORPHIR_HOME

The Morphir home directory for user-level data.

AspectValue
Default (Linux/macOS)$XDG_DATA_HOME/morphir or ~/.local/share/morphir
Default (Windows)%LOCALAPPDATA%\morphir
ContainsUser extensions, cache, global config
export MORPHIR_HOME="/opt/morphir"

MORPHIR_CONFIG_HOME

The Morphir configuration directory.

AspectValue
Default (Linux/macOS)$XDG_CONFIG_HOME/morphir or ~/.config/morphir
Default (Windows)%APPDATA%\morphir
Containsconfig.toml, credentials
export MORPHIR_CONFIG_HOME="/etc/morphir"

MORPHIR_CACHE_HOME

The Morphir cache directory.

AspectValue
Default (Linux/macOS)$XDG_CACHE_HOME/morphir or ~/.cache/morphir
Default (Windows)%LOCALAPPDATA%\morphir\cache
ContainsDownloaded dependencies, build cache
export MORPHIR_CACHE_HOME="/var/cache/morphir"

Daemon Variables

MORPHIR_DAEMON_URL

URL of a running Morphir daemon to connect to.

AspectValue
DefaultNone (start embedded daemon)
Formathttp://host:port or unix:///path/to/socket
# Connect to local daemon
export MORPHIR_DAEMON_URL="http://localhost:3000"

# Connect to Unix socket
export MORPHIR_DAEMON_URL="unix:///tmp/morphir.sock"

# Connect to remote daemon
export MORPHIR_DAEMON_URL="http://build-server:3000"

MORPHIR_DAEMON_AUTO_START

Whether to automatically start a daemon if none is running.

AspectValue
Defaulttrue
Valuestrue, false, 1, 0
export MORPHIR_DAEMON_AUTO_START="false"

MORPHIR_DAEMON_TIMEOUT

Timeout for daemon connections in milliseconds.

AspectValue
Default30000 (30 seconds)
FormatInteger (milliseconds)
export MORPHIR_DAEMON_TIMEOUT="60000"

MORPHIR_DAEMON_SHUTDOWN_TIMEOUT

How long the daemon waits before shutting down when idle.

AspectValue
Default3600000 (1 hour)
FormatInteger (milliseconds)
# Keep daemon running for 8 hours
export MORPHIR_DAEMON_SHUTDOWN_TIMEOUT="28800000"

# Never auto-shutdown
export MORPHIR_DAEMON_SHUTDOWN_TIMEOUT="0"

Build Variables

MORPHIR_PARALLEL

Enable parallel builds.

AspectValue
Defaulttrue
Valuestrue, false
export MORPHIR_PARALLEL="false"

MORPHIR_MAX_JOBS

Maximum number of parallel build jobs.

AspectValue
DefaultNumber of CPU cores
FormatInteger
export MORPHIR_MAX_JOBS="4"

MORPHIR_INCREMENTAL

Enable incremental builds.

AspectValue
Defaulttrue
Valuestrue, false
export MORPHIR_INCREMENTAL="false"

Output Variables

MORPHIR_COLOR

Control colored output.

AspectValue
Defaultauto
Valuesauto, always, never
export MORPHIR_COLOR="never"

MORPHIR_LOG_LEVEL

Logging verbosity level.

AspectValue
Defaultinfo
Valueserror, warn, info, debug, trace
export MORPHIR_LOG_LEVEL="debug"

MORPHIR_LOG_FORMAT

Log output format.

AspectValue
Defaulttext
Valuestext, json
export MORPHIR_LOG_FORMAT="json"

MORPHIR_QUIET

Suppress non-essential output.

AspectValue
Defaultfalse
Valuestrue, false
export MORPHIR_QUIET="true"

Registry Variables

MORPHIR_REGISTRY

Default package registry URL.

AspectValue
Defaulthttps://registry.morphir.dev
FormatURL
export MORPHIR_REGISTRY="https://internal-registry.company.com"

MORPHIR_REGISTRY_TOKEN

Authentication token for the registry.

AspectValue
DefaultNone
FormatString (token)
export MORPHIR_REGISTRY_TOKEN="ghp_xxxxxxxxxxxx"

MORPHIR_REGISTRY_USERNAME

Username for registry authentication.

AspectValue
DefaultNone
FormatString
export MORPHIR_REGISTRY_USERNAME="myuser"

MORPHIR_REGISTRY_PASSWORD

Password for registry authentication.

AspectValue
DefaultNone
FormatString
export MORPHIR_REGISTRY_PASSWORD="mypassword"

Extension Variables

MORPHIR_EXTENSIONS_PATH

Additional paths to search for extensions.

AspectValue
DefaultNone
FormatColon-separated paths (Unix) or semicolon-separated (Windows)
export MORPHIR_EXTENSIONS_PATH="/opt/morphir/extensions:/home/user/my-extensions"

MORPHIR_EXTENSION_TIMEOUT

Timeout for extension operations in milliseconds.

AspectValue
Default30000 (30 seconds)
FormatInteger (milliseconds)
export MORPHIR_EXTENSION_TIMEOUT="60000"

CI/CD Variables

CI

Standard CI environment indicator.

AspectValue
DefaultNone
EffectDisables interactive prompts, enables CI-friendly output
export CI="true"

MORPHIR_CI

Morphir-specific CI mode.

AspectValue
DefaultValue of CI
EffectSame as CI

MORPHIR_NO_INTERACTIVE

Disable interactive prompts.

AspectValue
Defaultfalse (or true if CI is set)
Valuestrue, false
export MORPHIR_NO_INTERACTIVE="true"

Debugging Variables

MORPHIR_DEBUG

Enable debug mode.

AspectValue
Defaultfalse
EffectVerbose logging, stack traces, debug endpoints
export MORPHIR_DEBUG="true"

MORPHIR_TRACE

Enable trace-level debugging.

AspectValue
Defaultfalse
EffectExtremely verbose output, performance logging
export MORPHIR_TRACE="true"

MORPHIR_PROFILE

Enable performance profiling.

AspectValue
Defaultfalse
EffectOutputs timing information, generates profiles
export MORPHIR_PROFILE="true"

Platform-Specific Variables

Linux/macOS

# XDG Base Directory Specification
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"

Morphir respects XDG variables when MORPHIR_* equivalents are not set.

Windows

REM Standard Windows locations
set LOCALAPPDATA=%USERPROFILE%\AppData\Local
set APPDATA=%USERPROFILE%\AppData\Roaming

Configuration Override Examples

Override [codegen] Settings

# Override targets array
export MORPHIR__CODEGEN__TARGETS='["typescript","spark"]'

# Override output format
export MORPHIR__CODEGEN__OUTPUT_FORMAT="compact"

# Override nested TypeScript setting
export MORPHIR__CODEGEN__TYPESCRIPT__STRICT="false"

Override [ir] Settings

export MORPHIR__IR__FORMAT_VERSION="4"
export MORPHIR__IR__STRICT_MODE="true"
export MORPHIR__IR__MODE="vfs"

Override [frontend] Settings

export MORPHIR__FRONTEND__LANGUAGE="morphir-dsl"

Environment File

Morphir supports .env files in the project root:

# .env file in project root
MORPHIR_LOG_LEVEL=debug
MORPHIR_PARALLEL=false
MORPHIR__CODEGEN__OUTPUT_FORMAT=compact

.env File Loading Order

  1. .env (always loaded)
  2. .env.local (local overrides, gitignored)
  3. .env.{environment} (e.g., .env.production)
  4. .env.{environment}.local (local overrides for environment)

The environment is determined by MORPHIR_ENV or defaults to development.

export MORPHIR_ENV="production"

Variable Reference Table

VariableTypeDefaultDescription
MORPHIR_HOMEpathXDG defaultMorphir data directory
MORPHIR_CONFIG_HOMEpathXDG defaultConfiguration directory
MORPHIR_CACHE_HOMEpathXDG defaultCache directory
MORPHIR_DAEMON_URLurlNoneDaemon connection URL
MORPHIR_DAEMON_AUTO_STARTbooltrueAuto-start daemon
MORPHIR_DAEMON_TIMEOUTint30000Connection timeout (ms)
MORPHIR_DAEMON_SHUTDOWN_TIMEOUTint3600000Idle shutdown timeout (ms)
MORPHIR_PARALLELbooltrueEnable parallel builds
MORPHIR_MAX_JOBSintCPU countMax parallel jobs
MORPHIR_INCREMENTALbooltrueEnable incremental builds
MORPHIR_COLORenumautoColor output mode
MORPHIR_LOG_LEVELenuminfoLog verbosity
MORPHIR_LOG_FORMATenumtextLog format
MORPHIR_QUIETboolfalseSuppress output
MORPHIR_REGISTRYurlDefaultRegistry URL
MORPHIR_REGISTRY_TOKENstringNoneRegistry auth token
MORPHIR_EXTENSIONS_PATHpathsNoneExtension search paths
MORPHIR_EXTENSION_TIMEOUTint30000Extension timeout (ms)
CIboolNoneCI environment
MORPHIR_DEBUGboolfalseDebug mode
MORPHIR_TRACEboolfalseTrace mode
MORPHIR_PROFILEboolfalseProfiling mode
MORPHIR_ENVstringdevelopmentEnvironment name