Variables & Expansions
December 3, 2025 ยท View on GitHub
Mudyla provides a unified syntax for accessing variables in Bash actions.
Expansion Syntax
The format is ${prefix.name}.
System Variables (sys)
${sys.project-root}: Absolute path to the project root (directory containing.git).${sys.platform}: Current OS platform (linux,darwin,windows).
Environment Variables (env)
${env.HOME}: Access environment variableHOME.- Validation: Using
${env.VAR}marksVARas required. Mudyla checks for its existence before execution.
Arguments (args)
${args.output-dir}: Access command-line argument.
Flags (flags)
${flags.verbose}: Returns1if flag is set,0otherwise.
Action Outputs (action)
${action.build.binary}: Access thebinaryoutput of thebuildaction. Implicitly adds a dependency.${action.weak.optional.file}: Weak dependency access (returns empty string ifoptionalis not in the graph).
Bash Compatibility
Standard Bash variables like ${HOME} or $VAR are not processed by Mudyla and are passed through to the shell. This allows mixing Mudyla expansions and standard shell logic.
echo "Project: ${sys.project-root}" # Mudyla expansion
echo "User: $USER" # Bash variable