SysML v2 for Visual Studio Code
A complete modeling environment for SysML v2 and KerML — language intelligence and live, editable diagrams, right inside your editor.
⚒️ Under Development ⚒️
Write SysML v2 and KerML the way you write code — with completion, hover, real diagnostics, refactorings, and go-to-definition — then see and edit your model as a diagram in the native SysML v2 graphical notation. The whole OMG standard library is built in, so import SI::* just works. No Java runtime, no PlantUML, no extra downloads. Everything runs locally and offline.
Why you'll like it
- 🎯 The full language, not a subset — every SysML v2 and KerML construct from the OMG specification is understood, not a lookalike subset.
- 🖼️ Diagrams you can edit — all nine standard views in authentic SysML v2 notation. Drag, resize, add, connect, rename — your changes flow straight back into the source text.
- 📚 The OMG standard library, bundled —
Parts, ISQ, SI, Requirements, and the rest resolve out of the box, offline.
- 🧠 Editor intelligence everywhere — context-aware completion, rich hover, a documented set of diagnostics with one-click fixes, cross-file rename, and tidy auto-formatting.
- 🤖 AI-agent ready — VS Code AI agents can ask the extension real questions about your model and get grounded answers instead of guesses.
- 🔒 Private by default — zero telemetry. Nothing about you, your code, or your usage ever leaves your machine.
- 🌐 Runs in the browser too — the same language intelligence and the same editable diagrams on vscode.dev and github.dev, including a GitHub repository opened straight from the browser.
- ☕ Nothing to install — no Java, no PlantUML, no extra downloads. Everything ships inside the extension and runs locally.
Quick start
- Install the extension. The Get Started with SysML v2 walkthrough opens automatically (or run Welcome: Open Walkthrough…).
- Open or create a
.sysml file. The status bar reads "SysML: ready" once the bundled library is indexed.
- Type
sysml- and pick a scaffold — sysml-part-def, sysml-requirement, sysml-state-machine, and 40+ more.
- Save — diagnostics appear in the Problems panel, and unambiguous cross-package imports are added for you.
- Run
SysML: Show Diagram (or the graph button in the editor title bar) to open the live, editable diagram. Ctrl+Alt+D toggles side / tab mode.
Language intelligence
- Syntax highlighting for
.sysml and .kerml, including quantity literals (1500 [kg]), escaped names ('name with spaces'), and the full operator set (:>, :>>, ::>, **, ??, ===, hastype, as, ->, #( … ), .?, …).
- Smart completion — 45+ snippets, context-aware keyword / member / import / unit completion for every SysML and KerML construct, inline ghost-text suggestions, and signature help for calc / action / constraint calls.
- Hover — element kind, typing, plain-English multiplicity, relationship details, the modeled doc comment, library-function signatures, and a From standard library link straight into the bundled OMG sources.
- Diagnostics — a stable, documented catalogue (LEX / SYN / RES / SEM / SSM / KSM / UNIT / STYL / MIG families) with per-code severity overrides, dimensional analysis of quantity expressions, and a SysML v1 guardrail that maps
block / «stereotype» idioms to their v2 constructs.
- Quick fixes & refactorings — add a missing import,
&&→and, import…as…→alias, add a missing subject, convert def↔usage, extract to a new package, move to a new file, generate a verification case from a requirement, and more.
- Navigation — document outline (
Ctrl+Shift+O), workspace symbols (Ctrl+T), cross-file go-to-definition (into the read-only library too), find references (including satisfy / verify targets), cross-file rename, document highlight, and go-to-declaration for aliases.
- Auto-import on save — unambiguous unqualified cross-package names get their
import added automatically; ambiguous ones open a picker.
- Formatting — clean, element-per-line layout, with author-placed blank lines preserved (uses your
editor.tabSize).
- Semantic tokens & inlay hints — definitions / usages / library symbols get distinct colors (a bundled SysML v2 Default theme is included; semantic highlighting is on by default), plus implicit-multiplicity and opt-in physical-dimension hints.
- CodeLens — N references on requirement defs, Run verification on verification-case defs (evaluates the case and reports pass/fail), and Show diagram on parts, states, actions, and cases.
Live, editable diagrams
A live view of your model in the SysML v2 graphical notation, with automatic layouts — not PlantUML, no image server, no screenshots to regenerate. The extension offers only the canvas/table views that actually have content in the file you're looking at, and keeps the Browser View available as a panel.
| View |
Shows |
| General |
definitions and depicted usages, packages with circled-plus ownership links to their direct definitions/parts/packages and «import» wiring, dependency / satisfy / verify / derive / allocate links, feature-membership arrows, the full specialization family ({subsets}, {redefines}, dashed hollow-triangle reference subsetting), variation / variant notation, metadata badges, calc / constraint / view compartments, annotations |
| Interconnection |
nested parts as resizable frames, box-like ports with edge docking, connectors routed below the parts, interfaces vs = bindings, item flows |
| Action Flow |
fork / join, decide / merge, send / accept, performer swimlanes |
| State Transition |
composite + parallel states, trigger [guard] / effect, «causation» links |
| Sequence |
activation bars, dashed replies, event-occurrence chains, occurrence def / occurrence interactions |
| Case |
case ovals inside the subject's classic v1 system-boundary box (default; or a linked part box), actors as stick figures |
| Geometry |
parts placed on an x/z coordinate frame |
| Grid |
four independently configured presets: editable Requirements, Elements, and Data tables, plus one-family Allocation / Dependency / Satisfy / Flow / Connection matrices selected from the toolbar |
| Browser panel |
the package / membership tree with expand/collapse, open by default in tab mode and toggleable in side mode |
- Editable. Right-click a blank diagram surface to add an element with the view-specific icon-and-text menu; it lands in that diagram's exact model anchor. Right-click an element or port to choose only relationships valid from that source, then click a compatible target. Or hover an eligible graph endpoint and drag its visible connection dot: General packages set package ownership, definitions specialize definitions, usages redefine usages; Interconnection connects; Action Flow creates succession (or item flow from a pin); State Transition creates transitions; Sequence creates messages only between dashed lifeline-line points; Case creates includes. Incompatible drops are refused, and Geometry/Grid expose no relationship drag. Interconnection View ports keep their specialized drag-to-connect handles and top / right / bottom / left docking points, while selected connectors expose draggable endpoints for reconnection. Connectors draw below the parts and are smart-routed around them; container part frames stay translucent so the wiring beneath remains visible. Connector lines are movable: drag the hollow dot on a segment to add a waypoint, move a waypoint directly, or double-click one to remove it. Drag to rearrange, resize any node, and rename / add / delete elements; semantic changes go through the language server with cross-file rename and a syntax-safety re-parse.
- Your layout, your repo. Positions, sizes, and connector waypoints persist under
.vscode/sysml/diagrams/ — never in the .sysml text — so diagrams are git-friendly and the model stays text-only.
- Theme-aware. Every color adapts to your active VS Code theme (light, dark, high-contrast), with a redesigned toolbar of consistent theme-colored icons and a layout control tailored to each view's real options.
- Side panel or full tab — toolbar, Browser View panel on the left, toggleable properties inspector on the right, minimap, and SVG export. The BV and Properties toggles are arrow icons in the canvas's upper-left / upper-right corners in both modes. The side columns are resizable; the BV header shows a folder-tree icon plus Browser View in both modes, BV branches can be expanded/collapsed, and BV highlights the elements present on the current diagram. Toggle side/tab with
Ctrl+Alt+D.
- Not sure which view you need? SysML: Which Diagram? recommends one from the question you want answered — and understands the SysML v1 names you already know (bdd, ibd, act, stm, sd, req, uc, pkg, par).
Your model in your CI pipeline
The same diagrams render outside VS Code, from a terminal or a build job — no editor, browser, or display server:
npx sysml-diagram export --file model.sysml --view iv --out docs/diagrams/iv.svg
npx sysml-diagram export --file model.sysml --all --out-dir docs/diagrams
And validate the model itself — the same diagnostics as the Problems panel, as text, JSON, SARIF for GitHub code scanning, or inline workflow annotations:
npx sysml-validate models/ --strict
npx sysml-validate models/ --format github
Both tools also ship inside this extension — no separate install needed. Run SysML: Copy Headless CLI Command from the command palette to put the ready-to-run command on your clipboard.
Standalone vector SVG with the full SysML notation (--view grv writes the Grid table as CSV), a --theme light palette for documentation, the OMG standard library bundled in, and a non-zero exit code when the model has errors so a pipeline can gate on it. It reads the diagram settings in .vscode/sysml/project.json and the committed per-view layout in .vscode/sysml/diagrams/, so a pipeline renders the diagram your team arranged — --auto-layout opts out.
The OMG standard library, built in
The full official model library ships with the extension, so import Parts::*, import ISQ::*, and import SI::* resolve immediately — no separate download, no GitHub clone.
| Layer |
Files |
Examples |
| Systems Library |
21 |
Parts, Ports, Items, Actions, States, Requirements, Constraints, Cases, Views, SysML |
| Kernel Libraries |
3 sub-dirs |
Kernel Data Type / Function / Semantic |
| Domain — Quantities & Units |
~20 |
ISQBase, ISQMechanics, ISQElectromagnetism, SI, SIPrefixes, USCustomaryUnits, … |
| Domain — other |
~10 |
Analysis, Cause & Effect, Geometry, Metadata, Requirement Derivation |
The library loads from a precomputed index at startup, so cold open is fast and nothing is parsed until you need it. Point at your own checkout with sysml.standardLibraryPath — it accepts an unzipped sysml.library/ tree, a .kpar archive, or a directory of .kpar archives. JSON abstract-syntax archives are projected to readable .sysml for indexing.
Works with your AI agents
The extension exposes a native VS Code language-model tool surface for agents that can use VS Code tools, including GitHub Copilot Chat / agent mode. These tools are contributed in the extension manifest, activate on demand, and are backed by the SysML language server instead of prompt-only guessing:
| Prompt reference |
Tool |
What it gives an agent |
#sysmlAgentGuidance |
sysml_agent_guidance |
SysML modeling pipeline, hard rules, validation checklist, and quick-reject patterns |
#sysmlContext |
sysml_agent_context |
Active document or selection text, diagnostics, imports, and indexed symbols |
#sysmlValidateDraft |
sysml_validate_draft |
Parser/diagnostic validation for proposed SysML/KerML text; returns a WorkspaceEdit only when no error diagnostics remain |
#sysmlSearchLibrary |
sysml_search_library |
Real bundled standard-library packages, types, symbols, and unit names |
#sysmlResolveSymbol |
sysml_resolve_symbol |
Workspace/library symbol matches plus imports visible from the current document |
#sysmlRequirementTrace |
sysml_requirement_trace |
Requirement definitions and satisfy / verify relationships from loaded SysML documents |
#sysmlExplainDiagnostic |
sysml_explain_diagnostic |
Stable diagnostic-code explanations and deterministic mechanical fixes |
This is not a separate chatbot and it does not ship a model runtime, credentials, telemetry, an MCP server, or Claude/Codex-specific skill packages. Agents that consume VS Code language-model tools can discover these capabilities directly; agents that only consume MCP servers, standalone plugins, or their own skill format need a bridge before they can call the same deterministic SysML operations.
Archive & JSON interchange
Open and extract OMG .kpar package archives, and import / export SysML v2 abstract-syntax JSON through generated textual projections — all from the command palette or the Explorer context menu. (Desktop only — see below.)
In the browser
The extension works in VS Code for the Web — vscode.dev, github.dev, and any browser-hosted VS Code — with the full language server and the diagram preview, not a syntax-highlighting subset. Open a repository in the browser and you get completion, hover, diagnostics with quick fixes, cross-file navigation and rename, formatting, the outline, the AI-agent tools, and all nine editable diagram views. The bundled OMG standard library comes with the extension, so MassValue, Real, and everything else resolves with no setup.
Four things are desktop-only, because a browser gives an extension no filesystem or temp directory for them. Their commands are hidden in the browser rather than shown and failing:
| Desktop only |
Why |
Open / extract .kpar archives |
Needs to unzip to a temporary folder |
| Import / export abstract-syntax JSON |
Same |
| SysML: Open Standard Library Folder |
Reveals a folder in your OS file manager |
sysml-diagram / sysml-validate CLIs |
Node command-line programs |
Private by default
This extension collects no telemetry and transmits nothing about you, your code, or your usage. There is no analytics SDK, no usage reporting, and no network calls beyond the local language server. That's a deliberate, privacy-first choice.
Reference
Settings
Open Settings → Extensions → SysML v2, or edit settings.json:
| Setting |
Default |
What it does |
sysml.standardLibraryPath |
"" (bundled) |
External sysml.library/ directory, .kpar archive, or directory of .kpar archives to use instead of the bundled one |
sysml.validation.severities |
{} |
Per-code severity overrides, e.g. { "STYL001": "off", "RES009": "error" } (always wins over the lint profile) |
sysml.lint.profile |
"default" |
Style/formatting notice strictness (default / quiet / strict); keeps the Problems panel readable on canonical models |
sysml.diagnostics.unusedImports |
"off" |
Report imports whose members are never referenced (off / warning / error) |
sysml.diagnostics.units |
true |
UNIT001–005 dimensional-analysis checks on quantity expressions |
sysml.editor.autoImportOnSave |
false |
Opt in to adding missing workspace imports when saving |
sysml.inlineCompletion.enabled |
true |
Ghost-text inline suggestions |
sysml.inlineCompletion.categories |
[] (all on) |
Opt out of individual inline-suggestion triggers |
sysml.inlayHints.dimension |
false |
Physical-dimension hints after quantity expressions (opt-in) |
sysml.outline.hiddenCategories |
[] |
Hide documentation / representation outline groups |
sysml.workspace.backgroundIndexing |
"imports" |
Background-index unopened files — imports (only files referenced by open files) / off / all |
sysml.preview.diagrams.update |
"on-save" |
When the diagram re-renders (live / on-save / manual) |
sysml.preview.diagrams.defaultKind |
"gv" |
Preferred primary view (gv, iv, afv, stv, sv, cv, gev, grv); Browser View is the BV panel |
sysml.preview.diagrams.defaultMode |
"side" |
Open diagrams as a side panel or a full tab |
sysml.preview.diagrams.showPortLabels |
true |
Port names next to the port stubs |
sysml.preview.diagrams.showMultiplicities |
false |
[1], [0..*] next to usage labels |
sysml.preview.diagrams.showSubjectAsBoundaryBox |
true |
Case View: draw the subject as a v1-style system-boundary box containing its cases (disable for a linked part box) |
sysml.preview.diagrams.lineStyle |
"orthogonal" |
Edge routing — orthogonal (square elbows) / straight (direct) / curved |
sysml.preview.diagrams.syncUsageToDef |
false |
IV structural edits stay local to usages; enable to synchronize them to typed definitions and allow drag-to-reparent |
sysml.trace.server |
"off" |
LSP trace verbosity — messages or verbose for debugging |
Editor behaviour like indent width and format-on-save uses VS Code's built-in editor.* settings. Diagram settings can also be overridden per project in .vscode/sysml/project.json, checked into your repo.
With syncUsageToDef off (the default), additions stay local to the selected usage (inherited paths are materialized as local redefinitions when necessary) and dropping a part into a different parent snaps back. With it on, adding parts, ports, or connectors inside a typed IV usage targets the usage's definition, and a parent-changing drop highlights its destination while dragging, then updates the definition without a confirmation dialog.
Commands (palette: Ctrl+Shift+P → "SysML:")
- SysML: Show Diagram — open the live, editable diagram
- SysML: Which Diagram? (view guidance) — pick the question you want answered (or the v1 diagram you knew) and the recommended view opens
- SysML: Toggle Diagram Side / Tab Mode (
Ctrl+Alt+D)
- SysML: Restart Language Server
- SysML: Reload Standard Library
- SysML: Open Standard Library Folder
- SysML: Open .kpar Archive
- SysML: Extract .kpar Archive
- SysML: Open Abstract Syntax JSON
- SysML: Export Abstract Syntax JSON
- SysML: Show Syntax Tree
- SysML: Show Diagnostic Reference
- SysML: Report Parse Coverage
Diagnostic codes
Run SysML: Show Diagnostic Reference for the in-editor catalogue. Any code's severity can be overridden with sysml.validation.severities.
| Family |
Codes |
Covers |
| Lexical |
LEX001–LEX009 |
incomplete strings/comments/names, invalid escapes, non-canonical boolean operators, non-ASCII identifiers, trailing whitespace |
| Syntax |
SYN010–SYN102 |
modifier ordering, multiplicity, specialization, expressions, connectors, imports/packages, annotations, behavior, requirements/cases/views, SysML/KerML disjointness |
| Resolution |
RES001–RES016 |
unresolved or ambiguous names, visibility, wrong target kinds, package separators, imports/aliases, unused imports, auto-imports, library shadowing |
| Semantics |
SEM001–SEM010, SSM008–SSM013, KSM002–KSM011, UNIT001–UNIT005 |
modeling heuristics, requirement/case bodies, SysML/KerML well-formedness, dimensional analysis |
| Style |
STYL001–STYL007 |
PascalCase definitions, camelCase usages, requirement docs, indentation, import ordering, recursive wildcards, single-element bodies |
| Migration |
MIG001–MIG002 |
SysML v1 idioms (block, activity, «stereotype») mapped to their v2 constructs with one-click rewrites |
File support
| Extension |
Language |
Notes |
.sysml |
SysML v2 |
Full grammar & services |
.kerml |
KerML |
Shares the grammar (includes the KerML kernel rules) |
.kpar |
OMG package archive |
Open / extract from the command palette or Explorer |
.json |
abstract syntax |
Import as a generated .sysml projection; export from textual models |
Licenses & attribution
The extension itself is distributed under its own Freeware License — see the top-level LICENSE file.
The bundled sysml.library/ files are taken verbatim from the OMG SysML v2 Release (release tag 2026-04) and are licensed by their copyright holders under the Eclipse Public License v2.0, reproduced with the release notice in resources/sysml.library/ (LICENSE, NOTICE.md).
The extension bundles the following open-source components, each under its own license:
Full license texts ship inside each dependency in the packaged extension.
Issues & feedback
The extension is being actively developed. If you have any feedback, feature suggestions or bug reports feel free to use the marketplace comment section.
Open an issue at https://github.com/voidaliot/sysml-v2-vscext-release/issues.
| |