Momentic resolves environment variables from three places, in order of precedence:Documentation Index
Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
- CLI flags (e.g.
--env-file,--env) - The enclosing shell when
inheritFromShell: trueis set on an environment momentic.config.yaml, either inline underenvVariablesor loaded from anenvFile/ JSON file
environments for the full
schema.
Reserved variables
These are set automatically at runtime and accessible in any step via{{ env.NAME }}:
| Variable | Description |
|---|---|
BASE_URL | Base URL of the current environment |
CURRENT_URL | URL of the page being tested |
ENV_NAME | Name of the current environment |
TEST_NAME | Name of the test being executed |
Accessing in tests
Use the templating syntax anywhere a step accepts a string:env.VARIABLE directly inside a JavaScript step.
Setting at runtime
UsesetVariable inside a JavaScript step to write a variable: