| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ModelScript is a completely web-native, polyglot incremental compiler supporting multiple engineering domains — from requirements and system architecture to simulation, CAD, CAE, and manufacturing. By natively supporting Modelica, SysML v2, STEP, OWL2, and OpenFOAM (CFD), ModelScript enables seamless cross-domain simulation-based requirements verification.
Designed for modern workflows, it features a robust engine for incremental compilation and flattening, seamless FMU import/export and integration, surrogate ROM generation from FMUs, as well as advanced model optimization and parameter calibration. All of this is accessible directly in the browser or via the command line.
This project is a monorepo managed with Lerna, Nx, and npm workspaces. The structure reflects our transition to a fully modular, high-performance compiler and simulator architecture.
| Package | Description |
|---|---|
| @modelscript/cad | Procedural CAD: TypeScript DSL for programmatic 3D geometry with STEP compilation |
| @modelscript/compiler | Salsa-based query engine for incremental compilation, type checking, and flattening |
| @modelscript/core | Central compiler engine for ModelScript (legacy flattener, simulator, optimizer) |
| @modelscript/cosim | MQTT-linked co-simulation engine for ModelScript |
| @modelscript/diagram | Diagram rendering, interactive SVG generation, and X6-based visual layouts |
| @modelscript/ecad | ECAD structural extraction and Gerber layout generator for ModelScript |
| @modelscript/language | ModelScript DSL Compiler — parser/lexer codegen, WASM runtime, FMI, reasoner, and SMT solver |
| @modelscript/lsp | Language Server Protocol — completions, hover, diagnostics, formatting, colors |
| @modelscript/mcp | Model Context Protocol implementation for AI/LLM integration |
| @modelscript/symbolics | ModelScript Symbolics Engine |
| @modelscript/utils | Common utility functions across the monorepo |
| Package | Description |
|---|---|
| @modelscript/csv | CSV tabular data parsing and validation |
| @modelscript/example | Example language configuration illustrating how to add new languages |
| @modelscript/modelica | Tree-sitter grammar (native + WASM) and language configuration for Modelica |
| @modelscript/owl2 | OWL2 Functional Syntax parsing and ontological knowledge extraction |
| @modelscript/step | STEP (ISO 10303) grammar and querying for CAD/CAE interoperability |
| @modelscript/sysml2 | SysML v2 tree-sitter AST querying, handling, and verification |
| Package | Description |
|---|---|
| @modelscript/cli | msc command-line interface — flatten, simulate, optimize, lint, render, and more |
| @modelscript/api | REST API for ModelScript — simulation, publishing, GraphQL, SPARQL, and RDF |
| @modelscript/morsel | Visual editor — code editing, diagram viewer, simulation, and plotting |
| @modelscript/web | Web frontend for browsing and exploring libraries (NPM-style registry) |
| @modelscript/ide | ModelScript VS Code Web IDE with GitHub/GitLab repository integration |
| @modelscript/site | Main modelscript.org website |
| @modelscript/vscode | VS Code extension — syntax highlighting, LSP client, diagram view |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.shgit clone https://github.com/modelscript/modelscript.git
cd modelscript
npm installBuild all packages (in dependency order via Nx):
npm run buildStart all services concurrently:
npm run devThis launches:
| Service | URL | Description |
|---|---|---|
| Morsel (editor) | http://localhost:3002 | Visual editor with diagrams and simulation |
| Web (library browser) | http://localhost:3001 | Browse and explore libraries |
| API | http://localhost:3000 | REST API for simulation, publishing, queries |
| IDE (VS Code Web) | http://localhost:3003 | Browser-based VS Code environment |
The IDE includes a browser-local AI assistant powered by WebLLM (Qwen3-0.6B). To enable it, download the model weights (~350 MB, one-time):
npm run download-model --workspace=@modelscript/ideOnce downloaded, restart npm run dev and open the ModelScript AI panel in the IDE sidebar.
After building, the CLI is available as msc:
# Flatten a model to DAE incrementally
npx msc flatten Modelica.Electrical.Analog.Examples.CauerLowPassAnalog path/to/MSL
# Simulate a model (outputs CSV by default)
npx msc simulate BouncingBall model.mo --stop-time 5
# Simulate with JSON output
npx msc simulate BouncingBall model.mo --format json
# Solve an optimal control problem
npx msc optimize MyModel model.mo \
--objective "u^2" --controls "u" --control-bounds "u:-1:1" --stop-time 10
# Lint Modelica files
npx msc lint model.mo
# Render a diagram to SVG (outputs to stdout)
npx msc render MyModel model.mo > diagram.svgRun the test suite across all packages (including the new compiler tests):
npm testnpm run lint
npm run formatPre-built images are published to the GitHub Container Registry on every push to main.
Run the latest images without building:
docker compose pull # Pull latest images from ghcr.io/modelscript/*
docker compose up -d # Start containers
docker compose down # Stop containers
docker compose logs -f # Tail logsTo build from source instead:
npm run docker:build # Build images locally
npm run docker:up # Start containers| Service | Port | URL |
|---|---|---|
| API | 3000 | http://localhost:3000 |
| Morsel | 3002 | http://localhost:3002 |
| Web | 3001 | http://localhost:3001 |
| IDE | 3003 | http://localhost:3003 |
ModelScript is licensed under the AGPL-3.0-or-later. See COPYING for more details.
| Back | FazBrowse Home | New Git URL |