Script Execution
By default, Miso runs all scripts with sh.
# scripts/deploy.sh
echo "Deploying..."
pnpm run buildScripts with a .sh or .bash extension run with sh. Scripts with no recognized extension (e.g. scripts/deploy with no extension) also default to sh.
Changing the Interpreter
You can run scripts with a different interpreter in three ways:
1. Use a Different File Extension
Miso selects the interpreter based on the file extension when no shebang is present:
| Extension | Interpreter | Notes |
|---|---|---|
.sh, .bash | sh | POSIX shell (default) |
.zsh | zsh | Z shell |
.js, .mjs | node | Node.js |
.ts | ts-node | TypeScript (requires ts-node) |
.py | python3 | Python 3 |
.rb | ruby | Ruby |
.pl | perl | Perl |
.lua | lua | Lua |
.php | php | PHP |
2. Configure the Default Shell in miso.json
For scripts with no recognized extension, you can override the default sh in miso.json:
{
"shell": "bash"
}The shell field applies when neither shebang nor extension specifies an interpreter. Leave it unset to use sh.
3. Use a Shebang
If the first line starts with #!, Miso uses the specified interpreter. The shebang takes precedence over extension-based detection:
#!/usr/bin/env node
// Your JavaScript code here
console.log("Running with Node.js");#!/usr/bin/env python3
# Your Python code here
print("Running with Python")Interpreter Requirements
Make sure the required interpreter is installed and available in your PATH:
which node
which python3
which rubyError Handling
If a script exits with a non-zero status code, Miso will display the error and exit with the same code:
if [ -z "$1" ]; then
echo "Error: Environment required"
exit 1
fiThis ensures proper error propagation in CI/CD pipelines and build tools.