Skip to main content

CLI Reference

The modal command-line tool is your interface to Modality.

Installation

# First-contract onboarding wrapper
cd rust
cargo build --release -p modal --no-default-features --features contract-onboarding

# Language/model CLI used by the first-contract guide
cargo build --release -p modality

The lean onboarding wrapper exposes the contract and identity surfaces needed by the first-contract guide: modal contract, modal c, modal id, modal passfile, modal status, modal pull, modal commit, modal diff, modal set, modal repost, modal add-rule, and modal download. It omits the runtime-heavy hub, node, network, predicate, program, chain, local, run, killall, and upgrade surfaces.

Build the full wrapper with cargo build --release -p modal when you need those broader command groups. Use modality for model and rule authoring tasks such as modality model lint, modality model synthesize, and modality model validate.

Command Groups

CommandAliasDescription
modal contractmodal cContract management (create, commit, push, pull)
modal idmodal identityIdentity management (create, derive, get)
modal passfilePassfile encryption/decryption
modal hubContract hub server and collaboration; full wrapper only
modal predicatePredicate listing and testing; full wrapper only
modal programProgram management; full wrapper only
modal nodeNetwork node operations; full wrapper only
modal netmodal networkNetwork information; full wrapper only
modal localLocal development utilities; full wrapper only
modal runQuick node runners; full wrapper only
modal chainChain validation; full wrapper only

Global Commands

# Show version
modal --version
modal -v

# Show help
modal --help
modal <command> --help

# Show status (in contract directory)
modal status

# Pull commits (shortcut for modal contract pull)
modal pull http://hub.example.com/contracts/my-contract

# Show uncommitted changes (shortcut for modal contract diff)
modal diff

# Repost state from another contract
modal repost source-contract-id /source/path /local/path

# Add a rule to the current contract
modal add-rule rules/member-protection.modality

# Download a packed contract file
modal download http://hub.example.com/contracts/my-contract.pack

# Kill all local nodes (full wrapper only)
modal killall

# Upgrade to latest version (full wrapper only)
modal upgrade

Quick Reference

# Identity
modal id create --path alice.passfile
modal id get --path alice.passfile

# Contract workflow
modal c create
modal c set-named-id /parties/alice.id alice.passfile
modal c commit --all --sign alice.passfile -m "Initial setup"
modal c status
modal c log

# Push/Pull
modal c push http://hub.example.com/contracts/my-contract
modal c pull http://hub.example.com/contracts/my-contract

# Predicates
modal predicate list
modal predicate info signed_by
modal predicate test signed_by --data '{"path":"/alice.id","signature":"..."}'

Shortcuts

Full CommandShortcut
modal contractmodal c
modal contract statusmodal status
modal contract pullmodal pull
modal contract commitmodal commit
modal contract diffmodal diff
modal contract setmodal set
modal contract repostmodal repost
modal contract add-rulemodal add-rule
modal contract downloadmodal download
modal identitymodal id
modal networkmodal net
modal local killall-nodesmodal killall

Environment Variables

VariableDescriptionDefault
MODAL_NODE_PATHDefault node directory./node
MODAL_NETWORKNetwork (mainnet/testnet)mainnet
MODAL_HUB_URLDefault hub URL
MODAL_PASSFILEDefault passfile path