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

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

(Future commands will be documented here)

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

(Future: Configuration file format and options will be documented here)

Troubleshooting

See the Troubleshooting Guide for solutions to common issues.


morphir ir verify

Validate Morphir IR JSON files against official schemas

Troubleshooting

Solutions to common issues with Morphir .NET CLI