Skip to main content

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 / flagDescription
morphStart the interactive REPL when stdin is a TTY (otherwise shows help).
morph --languageShow current diagnostic language and how to change it.
morph --language <code>Persist a diagnostic language (e.g. en, tr, ja).
morph --language autoFollow OS language when available, else English.
morph --trace-errorsPrint source-context traces for diagnostics (also MORPH_TRACE_ERRORS=1).
morph --bypass-rulesDisable .morphsettings rule enforcement for this run.
MORPH_COLOR=0|1Disable/enable diagnostic colors (NO_COLOR respected).
MORPH_TOOLCHAIN_BIN=...Override directory for bundled gcc/binutils resolution.

Project and package commands

CommandDescription
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 installInstall 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 publishProduce a package artifact.
morph packagesList 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

CommandDescription
morph buildBuild the current project.
morph build --target=webBuild web artifacts under build/web.
morph runBuild and run the current project.
morph run --target=webServe build/web with the embedded COOP/COEP dev server.
morph releaseBuild/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

CommandDescription
morph vcon <command>Build, run, inspect, or configure VCON containers (subcommands follow vcon).

Debug and compiler inspection

CommandDescription
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 helpShow full help (banner + commands + REPL keybindings).

Repository builds vs morph

  • morph drives Morph projects (packages with morph.toml).
  • This compiler repository is built with morphc from the repo root.

Next Steps