CLI Reference

Command-line interface reference for Morphir .NET tooling

Morphir .NET CLI Reference

The Morphir .NET CLI provides powerful command-line tools for working with Morphir IR files, validating schemas, and managing Morphir projects.

Available Commands

Toolchain manager

  • morphirup - The standalone toolchain manager. This build makes plan-only setups and checks a project’s request and lock; it acquires and installs nothing yet

IR Management

  • morphir ir verify - Validate Morphir IR JSON files against official schemas
  • morphir ir detect-version (coming in Phase 2) - Detect the schema version of an IR file

Project Management

These migration commands are not yet implemented.

Installation

The Morphir .NET CLI is distributed as a .NET tool. Install it globally with:

dotnet tool install -g Morphir.CLI

Or locally in a project:

dotnet tool install Morphir.CLI

Getting Help

For help with any command, use the --help flag:

morphir --help
morphir ir --help
morphir ir verify --help

Common Workflows

Validating IR Files

The most common workflow is validating Morphir IR JSON files to ensure they conform to the expected schema:

# Validate a single file with auto-detection
morphir ir verify path/to/morphir-ir.json

# Validate with explicit schema version
morphir ir verify --schema-version 3 path/to/morphir-ir.json

# Get JSON output for CI/CD
morphir ir verify --json path/to/morphir-ir.json

# Quiet mode (only errors)
morphir ir verify --quiet path/to/morphir-ir.json

See the morphir ir verify documentation for complete details.

Exit Codes

All Morphir CLI commands use consistent exit codes:

  • 0: Success - operation completed successfully
  • 1: Validation failure - IR file failed schema validation
  • 2: Operational error - file not found, invalid JSON, missing dependencies, etc.

These exit codes are designed for CI/CD integration and scripting.

Configuration

The configuration guide distinguishes the compatibility TOML cache loader from the additive shared configuration and project system.

The morphir config read commands inspect effective/scoped values, source reports and redacted explanations. JSON output follows the published schema; success, missing keys and usage/loading failures use exit codes 0/1/2. Shared config set/unset editing, project migrate and bounded workspace migrate are available. Start with the workspace configuration walkthrough.

Troubleshooting

See the Troubleshooting Guide for solutions to common issues.


morphir ir verify

Validate Morphir IR JSON files against official schemas

Management Commands

Commands for managing Morphir distributions, tools, and extensions.

Config commands

Inspect and edit Morphir configuration through shared services

Project migration

Migration of one classic morphir-elm project to the newer Morphir project system

project migrate

Preview and apply a loss-checked migration from classic morphir.json to TOML

Workspace migration

Bounded adoption of classic projects into a Morphir workspace

workspace migrate command

Preview and apply bounded workspace adoption with per-project loss checks and recoverable writes

mck

Run the separately installed Morphir Compatibility Kit, morphir-mck

morphir extension runtimes

Report whether this host can run WASM extensions, with its engine, profiles and bounds, or the reason it cannot

morphir mck wasm-host (experimental)

Experimental and internal: run the crafted WASM host cases against a host’s worker mode, and check the report

morphirup

Set up the Morphir toolchain with morphirup and run it, then the command reference

morphir extension worker (experimental)

Experimental and internal: serve one WASM extension module over stdio for a conformance runner

Troubleshooting

Solutions to common issues with Morphir .NET CLI

Compile

Compile source code to Morphir IR

Extension installation status

What the extension installer currently implements and what remains

Generate

Generate target artifacts from a Morphir model

Validate

Check a Morphir model with the built-in analyzers