Environment Variables
FZ can be configured using several environment variables to customize its behavior.
Core Configuration
FZ_LOG_LEVEL
Description: Controls the verbosity of FZ logging output.
Values: DEBUG, INFO, WARNING, ERROR, CRITICAL
Default: INFO
Example:
FZ_INTERPRETER
Description: Default formula interpreter for evaluating expressions.
Values: python, R
Default: python
Example:
Execution Configuration
FZ_EXECUTION_TIMEOUT
Description: Default timeout in seconds for calculator execution. Can be overridden by model configuration or calculator URI parameters.
Values: Positive integer (seconds)
Default: None (no timeout)
Example:
FZ_MAX_RETRIES
Description: Maximum number of retry attempts when a calculator fails.
Values: Non-negative integer
Default: 3
Example:
FZ_MAX_WORKERS
Description: Maximum number of parallel workers for concurrent execution.
Values: Positive integer
Default: Number of CPU cores
Example:
Shell Configuration
FZ_SHELL_PATH (New in 0.9.1)
Description: Custom search path for shell commands and executables. Overrides system PATH for binary resolution. Essential for Windows users with MSYS2, Git Bash, or custom tool locations.
Format: - Windows: Semicolon-separated paths - Unix/Linux: Colon-separated paths
Default: System PATH
Example:
# Windows
SET FZ_SHELL_PATH=C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Python39
# Linux/macOS
export FZ_SHELL_PATH=/opt/tools/bin:/usr/local/bin
Features:
- Automatic .exe extension handling on Windows
- Binary path caching for performance
- Overrides system PATH priority
SSH Configuration
FZ_SSH_KEEPALIVE
Description: Interval in seconds for SSH keepalive packets to prevent connection timeout.
Values: Positive integer (seconds)
Default: 60
Example:
Cache Configuration
FZ_CACHE_DIR
Description: Directory for storing cached results.
Values: Valid directory path
Default: .fz/cache in working directory
Example:
Discovery Configuration
FZ_UDP_DISCOVERY_PORT
Description: UDP port for Funz calculator auto-discovery.
Values: Valid port number
Default: 21001
Example:
Configuration Files
Model and Calculator Aliases
FZ looks for configuration files in:
- Models:
~/.fz/models/and./.fz/models/ - Calculators:
~/.fz/calculators/and./.fz/calculators/
Configuration files use JSON format:
Model Example (~/.fz/models/perfectgas.json):
{
"varprefix": "$",
"interpreter": "python",
"output": {
"pressure": "grep 'P =' output.txt | awk '{print $3}'"
}
}
Calculator Example (~/.fz/calculators/compute.json):
Platform-Specific Notes
Windows
- Use
SETinstead ofexportfor environment variables - Path separators are semicolons (
;) inFZ_SHELL_PATH - Consider setting
FZ_SHELL_PATHfor Git Bash or MSYS2 tools
Linux/macOS
- Use
exportfor environment variables - Path separators are colons (
:) inFZ_SHELL_PATH - Environment variables can be set in
~/.bashrcor~/.zshrc
See Also
- Configuration Guide - Model and calculator configuration
- Shell Calculator - Shell execution details
- Troubleshooting - Common issues and solutions