Installation and the Command Line
MushScript programs are compiled and run by the mush command-line tool; confirm it is on your PATH and you are ready to start.
Checking Availability
$ mush --version
mush 0.5.2If the command prints a version number, the environment is usable. How to obtain mush, and which versions ship through which release channels, is outside the scope of this manual.
Command Summary
| Command | Effect |
|---|---|
mush | Interactive REPL |
mush <file.ms> | Run a script (equivalent to mush run <file.ms>) |
mush run [file.ms] | Compile and run; with the file omitted, runs the entry declared in package.msd |
mush - | Read a script from stdin and run it |
mush -e "<code>" | One-shot evaluation; the expression result is echoed |
mush check [path...] | Compile and report diagnostics only; nothing executes |
mush fmt [path...] [--check] | Format; --check only reports differences without touching files |
mush test [paths...] | Run .ms tests |
mush --version / --help | Version and help |
Target Resolution for run and check
run and check resolve their target in three forms:
- Target omitted: discover
package.msdupward from the current directory; if none is found, treat the current directory as the package root and collect every.msfile. - A
.msfile: compile the package that file belongs to. - A directory: treat the directory as a package root and collect it.
On success check prints a one-line summary: the name in the summary is the package name (the file name in the single-file case), followed by the number of source files checked. When there are warnings the line becomes “N warnings”, and the full warning text is printed above the summary.
$ mush check helloworld.ms
Checked helloworld (1 source file): no errors
$ mush run helloworld.ms
Hello, worldUse check when changing code to hunt down a problem, and run to confirm behavior.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Compilation or run failure |
| 2 | Usage error |
| 130 | Interrupted by Ctrl+C |
Notes
- A program that fails to compile never executes; runtime output always comes from a program that passed the full compilation.
.msfiles must be UTF-8 encoded.- In command-line examples,
$is the shell prompt, not part of the input. - For the full rules on script arguments (including the
--separator), see the main and exit codes page.
Last updated on October 11, 2026
