Getting Started
This guide will help you get up and running with Morphir Rust.
Prerequisites
- A terminal (bash, zsh, PowerShell)
- Internet connection (for downloading binaries)
- Optional: Rust if building from source
Installation
The quickest way to install morphir:
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/finos/morphir-rust/main/scripts/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/finos/morphir-rust/main/scripts/install.ps1 | iex
For more installation options, see the Installation Guide.
Your First Command
After installation, verify morphir is working:
morphir --version
Basic Usage
Migrating Morphir IR
The most common use case is migrating Morphir IR between format versions. Morphir IR has evolved through several versions:
- Classic (V1-V3): Original format used by morphir-elm
- V4: New format with improved structure
Convert a local file to V4 format:
morphir ir migrate --input ./morphir-ir.json --output ./morphir-ir-v4.json
Convert from a remote URL:
morphir ir migrate \
--input https://lcr-interactive.finos.org/server/morphir-ir.json \
--output ./lcr-v4.json
Convert from GitHub:
morphir ir migrate \
--input github:finos/morphir-examples@main/examples/basic/morphir-ir.json \
--output ./example-v4.json
Generating JSON Schema
Generate a JSON Schema for validating Morphir IR files:
# Output to stdout
morphir schema
# Output to file
morphir schema --output ./morphir-ir-schema.json
Getting Help
# Show help
morphir --help
# Show help including experimental commands
morphir --help-all
# Get help for a specific command
morphir ir migrate --help
Version Management
The morphir launcher supports automatic version management, similar to tools like rustup or nvm.
Using a Specific Version
Override the version for a single command:
morphir +0.1.0 ir migrate --input ./ir.json --output ./v4.json
Pinning Version for a Project
Create a .morphir-version file in your project root:
echo "0.1.0" > .morphir-version
Or add to your morphir.toml:
version = "0.1.0"
Managing Versions
# Upgrade to latest version
morphir self upgrade
# List installed versions
morphir self list
# Show which version will be used
morphir self which
Dev Mode
For developing and testing morphir itself, you can run from a local source checkout:
# One-time dev mode
morphir --dev ir migrate --input ./ir.json
# Check dev mode status
morphir self dev
See the Installation Guide for more details.
Next Steps
- Installation Guide - Detailed installation options
- CLI Reference - Complete command documentation
- IR Migrate - Detailed migration documentation