You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the name of Allah, the Compassionate, the Merciful
@modelscript/cli
Unified command-line interface (modelscript, alias msx) for ModelScript. Provides a high-performance polyglot toolchain for compilation, simulation, optimization, formal verification, enterprise digital thread coexistence, CAD extraction, and package management across Modelica, SysML v2, STEP, and related engineering domains.
Installation & Usage
After building the monorepo, the CLI is available locally or via npx under modelscript or the primary shorthand msx:
# Check version and global options
npx msx --help
# or
npx modelscript --help
# Run with background compiler daemon for instant response
npx msx --daemon <command>
Command Reference
1. Modeling, Flattening, Simulation & Power Systems
Command
Description
msx compile <name> <paths...>
Flatten a Modelica model into a flat DAE arena (alias: msx flatten)
msx simulate <name> <paths...>
Numerically simulate a Modelica model and output CSV or JSON trajectories
msx instantiate <name> <paths...>
Instantiate and query the hierarchical AST structure of a Modelica model
msx fmu <name> <paths...>
Export a Modelica model as a standalone FMI 2.0/3.0 FMU archive (alias: export-fmu)
msx import-fmu <fmu>
Import an external FMU archive and generate an acausal or causal Modelica wrapper (fmu-import)
msx cosim
Manage multi-FMU co-simulation sessions, participants, FMUs, and signal replay
msx optimize <name> <paths...>
Solve optimal control problems via direct collocation with state/control boundary constraints
msx grad <name> <paths...>
Compute exact parameter sensitivities through simulation using continuous adjoints
msx mc <name> <paths...>
Run Monte Carlo simulations for parametric uncertainty quantification
msx surrogate <name> [paths...]
Train or import an AI surrogate model (ROM) and generate C, ONNX, or Modelica code
msx csg <name> <paths...>
Compile and extract Constructive Solid Geometry (CSG) topologies to 3D meshes
msx pscad <action> [files...]
Inspect, lint, diff, and simulate PSCAD power system projects (.pscx, .pslx) and COMTRADE
2. Formal Verification & Automated Testing
Command
Description
msx verify [target] [paths...]
Unified formal verification and simulation validation across SysML v2, Modelica, and CAD
msx falsify
Run adversarial multi-domain requirement falsification across SysML v2, Modelica, and CAD
msx verify-decisions <paths...>
Formally verify SysML v2 decision tables, decide nodes, and state guards for exhaustiveness and disjointness
msx decompose <paths...>
Perform symbolic state-space region decomposition over SysML v2 decision conditions
msx generate-tests <paths...>
Synthesize formal boundary-condition and 100% MC/DC test suites from SysML v2 models
msx export-formal <paths...>
Export SysML v2 models to standard formal verification formats (SMT-LIB2, nuXmv, OCRA)
3. Linting, Formatting, Diffing & Rendering
Command
Description
msx lint <path> [paths...]
Lint polyglot models and libraries using QueryEngine and linear CST analysis rules
msx format <files...>
Format source files using their language DSL formatter or unparser
msx unparse <file>
Unparse and re-synthesize clean, canonical source code from the language AST
msx diff <file1> <file2>
Compute an AST-aware semantic diff between two model files (any registered DSL)
msx pr-diff [file]
Compute visual and semantic pull request diff across Git revisions (SysML, Modelica)
msx render <name> <paths...>
Render a Modelica class diagram or icon to standalone SVG
msx i18n <paths...>
Extract internationalization (.pot) translation templates from Modelica models
4. Digital Thread, Enterprise Coexistence & Compliance
Command
Description
msx polyglot <action>
Multi-domain Triple Graph Grammar (TGG) projection, formal verification, and digital thread tracking