Spec42

Open-source language tooling for SysML v2 and KerML — one analysis engine for editors and automation.

Spec42 in VS Code showing a SysML v2 drone model and generated structure visualization
Spec42 combines textual SysML v2 / KerML modeling with generated model visualizations in VS Code.

What is Spec42?

Spec42 gives systems engineers a smoother path from model authoring to validation. The same Rust analysis engine powers an LSP server for editors and a CLI for validation, troubleshooting, and standard-library diagnostics. You get consistent behavior from your workstation to CI — live feedback while editing and deterministic checks in pipelines.

For background on the modeling language, see What is SysML v2? on Learn. For focused workflow pages, see SysML v2 VS Code extension, SysML v2 language server, and SysML v2 CI validation.

Why teams use Spec42

  • Write with confidence — live diagnostics, semantic highlighting, completion, hover, and navigation
  • Understand structure quickly — symbols, references, hierarchy features, Model Explorer, and Model Visualizer
  • Validate the same way locally and in CIspec42 check with text, JSON, SARIF, and JUnit reports
  • Reduce library setup friction — bundled SysML standard-library support and spec42 doctor diagnostics
  • Integrate optional package workflows — Sysand detection when present, without making Sysand mandatory
  • Publish deterministic artifacts — CI-friendly validation and Rust-owned SVG/JSON diagram export

Editor experience (VS Code)

The SysML v2 Editor (Elan8.spec42) extension ships the language server binary in published builds, so most users can install and start modeling without separate CLI setup.

Language support

  • Rich support for .sysml and .kerml files
  • Workspace-first diagnostics, navigation, and symbols with background indexing
  • Completion, snippets, hover, semantic tokens, formatting, and code actions
  • Go to definition, find references, rename, document/workspace symbols, and hierarchies
  • Configurable library indexing via spec42.libraryPaths

Exploration and views

  • Model Explorer — structural navigation across the workspace
  • Model Visualizer — graphical views alongside textual modeling
  • Supported views — General, Interconnection, Action Flow, State Transition, and Sequence (plus provisional Browser, Grid, and Geometry renderers)

CLI and automation

Use the CLI for terminal workflows, scripted quality gates, and environment troubleshooting. Common commands:

  • spec42 doctor — library paths, runtime, and setup diagnostics
  • spec42 check — deterministic validation reports for CI
  • spec42 diagrams export — headless SVG/JSON diagram export

Download binaries from GitHub Releases. Run spec42 doctor first when editor, library, or CI behavior differs from what you expect.

Getting started

  1. Install the VS Code extension.
  2. Open a .sysml or .kerml file — try the Kitchen Timer example in the repo if you want a compact first model.
  3. Use the command palette: SysML: Show SysML Model Explorer or SysML: Open SysML Visualizer.
  4. For CI or terminal validation, install the CLI from releases and run spec42 doctor then spec42 check.

Example models and domain libraries live in the spec42 repository (office, timer, intersection, webshop, and drone examples).

Status and scope

Spec42 is open source (MIT) and actively developed toward a credible daily-use baseline for core editing, validation, and visualization workflows. It does not claim full OMG SysML v2 specification coverage; conformance and supported workflows are tracked in the project documentation.