Skip to Content
ScriptingScript Execution

Script Execution

By default, Miso runs all scripts with 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:

ExtensionInterpreterNotes
.sh, .bashshPOSIX shell (default)
.zshzshZ shell
.js, .mjsnodeNode.js
.tsts-nodeTypeScript (requires ts-node)
.pypython3Python 3
.rbrubyRuby
.plperlPerl
.lualuaLua
.phpphpPHP

2. Configure the Default Shell in miso.json

For scripts with no recognized extension, you can override the default sh in miso.json:

>miso.json
{ "shell": "bash" }

3. Use a Shebang

While you don’t need one, if the first line starts with #!, Miso uses the specified interpreter:

#!/usr/bin/env node console.log("Running with Node.js");

Interpreter Requirements

Make sure the required interpreter is installed and available in your PATH:

which node which python3 which ruby

Error 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 fi
Last updated on