CLI Reference
Reference for the morph command-line tool. The authoritative, always-current list is what prints from:
morph help
That text is maintained in the compiler sources (src/main/UsageText.h). This page summarizes the same surface for browsing in the docs.
REPL and global options
| Command / flag | Description |
|---|---|
morph | Start the interactive REPL when stdin is a TTY (otherwise shows help). |
morph --language | Show current diagnostic language and how to change it. |
morph --language <code> | Persist a diagnostic language (e.g. en, tr, ja). |
morph --language auto | Follow OS language when available, else English. |
morph --trace-errors | Print source-context traces for diagnostics (also MORPH_TRACE_ERRORS=1). |
morph --bypass-rules | Disable .morphsettings rule enforcement for this run. |
MORPH_COLOR=0|1 | Disable/enable diagnostic colors (NO_COLOR respected). |
MORPH_TOOLCHAIN_BIN=... | Override directory for bundled gcc/binutils resolution. |
Project and package commands
| Command | Description |
|---|---|
morph new <name> [--lib] | Create a new application or library project. |
morph init <name> [--lib] | Same as new (alias). |
morph add <owner/repo|url> [--version …] [--tag …] [--commit …] [--global] | Add a dependency or install a package globally. |
morph install | Install local dependencies from morph.toml / morph.lock. |
morph remove <package> [--global] | Remove a dependency or global package. |
morph update [package] | Update one or all dependencies. |
morph publish | Produce a package artifact. |
morph packages | List installed local/global packages. |
morph settings-of <builtin-module|package…> | Print effective .modulesettings for a module/package. |
morph dependencies-of <builtin-module|package…> | Print dependency metadata for a module/package. |
Build, run, release
| Command | Description |
|---|---|
morph build | Build the current project. |
morph build --target=web | Build web artifacts under build/web. |
morph run | Build and run the current project. |
morph run --target=web | Serve build/web with the embedded COOP/COEP dev server. |
morph release | Build/test/package a release bundle. |
morph build-nucleus --platform <Windows|Linux|Mac> [--compiler …] [--output …] [--verbose] | Build a single-file nucleus runtime for .vcon execution. |
morph build-product --platform <target> [--compiler <path>] [--no-installer] [--no-updater] [--verbose] | Produce installers / product output using .productsettings in the current project (requires host platform support). |
Note: shipped morph help text (UsageText.h) may lag slightly; if a flag exists in your build but not in the banner, treat the executable’s usage line as final.
VCON
| Command | Description |
|---|---|
morph vcon <command> | Build, run, inspect, or configure VCON containers (subcommands follow vcon). |
Debug and compiler inspection
| Command | Description |
|---|---|
morph lex <file> [--trace-errors] [--bypass-rules] | Tokenize a source file. |
morph parse <file> [--trace-errors] [--bypass-rules] | Parse a source file (AST-oriented debug). |
morph nir <file> [--trace-errors] [--bypass-rules] | Build and print NIR for a source file. |
morph lex-dump <file> | Canonical lexer dump (structural tests). |
morph parse-dump <file> | Canonical parser dump (structural tests). |
morph nir-dump <file> | Canonical NIR dump (structural tests). |
morph mir-dump <file> | Canonical MIR dump (structural tests). |
morph compile <file> [--trace-errors] [--bypass-rules] | Compile a single file to a native executable. |
morph help | Show full help (banner + commands + REPL keybindings). |
Repository builds vs morph
morphdrives Morph projects (packages withmorph.toml).- This compiler repository is built with
morphcfrom the repo root.
Next Steps
- morph.toml — Project configuration
- Product builds — Production / installer-oriented builds