Skip to main content

Environment variables and command line

Environment variables​

VariableWhere it is usedWhat it doesDefault
NOPAL_PORTinstall.shPort of the service the installer creates8420
NOPAL_KLIPPER_PORTSThe serverAdditional Moonraker ports, comma-separated. An invalid or out-of-range value is ignored with a warning in the logNone (7125 to 7127 are searched)
NOPAL_PLUGIN_DATA_DIRThe serverFolder where plugin data and installed.json are storeddata/plugins
NOPAL_CORE_ROOTPlugin testsPath to the core checkout, needed to run a plugin's tests with the real loaderRequired in tests

NOPAL Intelligence​

These variables override what is saved in ai_config.json. An invalid value is ignored with a warning in the log.

VariableSettingDefault
NOPAL_AI_ENABLEDEnables the AI layerfalse
NOPAL_AI_PROVIDERProvider typeopenai-compatible
NOPAL_AI_BASE_URLServer address, ending in /v1Empty
NOPAL_AI_MODELModelEmpty
NOPAL_AI_API_KEYAPI keyEmpty
NOPAL_AI_TIMEOUTMaximum wait time, in seconds60
NOPAL_AI_MAX_TOKENSMaximum response length512
NOPAL_AI_TEMPERATURESampling temperature0.2
NOPAL_AI_TOOL_MODEnative, context or auto: how tools are given to the modelauto
NOPAL_AI_TOOL_PROFILETool profilefull
NOPAL_AI_MODEL_MODEfixed (one model) or auto (chooses by the question)fixed
NOPAL_AI_ACTIONS_ENABLEDLets the AI actfalse
NOPAL_AI_MAX_TOOL_ITERATIONSCap on tool calls per question4
NOPAL_AI_ALLOW_PUBLIC_ENDPOINTAllows a public serverfalse

NOPAL_AI_MODEL_MODE=fixed is useful on headless installs to force a single model. See NOPAL Intelligence.

Commands​

Install, update and remove​

CommandWhat it does
./install.shInstalls NOPAL as a service. See Installation
./uninstall.shRemoves the service and the virtual environment and keeps your data
./uninstall.sh --purgarAlso deletes the library, registries and credentials
./uninstall.sh --dry-runOnly shows what it would do
./uninstall.sh --siDoes not ask. Requires --purgar separately to delete data

See Update and uninstall.

Start by hand​

.venv/bin/uvicorn backend.main:app --host 0.0.0.0 --port 8420

Scripts in scripts/​

ScriptWhat it is for
migrate_machine_identity.pyOne-time migration to stable machine identity. Dry run by default; --apply writes and --esp420 queries the Chip ID. See Machine identity
generate_i18n.pyGenerates the Portuguese (Brazil), French and German languages from the English catalog. It is a development tool: NOPAL does not translate at runtime
check_plugins_compat.pyChecks that the catalog's plugins work with the Python version running it. Used by continuous integration

Tests​

pytest

Runs the core's tests. For a plugin: NOPAL_CORE_ROOT=/path/to/core pytest plugins/<id>/tests. See Environment and tests.