Skip to main content

SysML v2 and KerML analysis CLI (binary distribution)

Project description

Syster CLI

Command-line interface for SysML v2 and KerML analysis, interchange, and semantic model editing.

Installation

cargo install syster-cli

Or build from source:

cargo build --release --features interchange

The interchange feature (enabled by default) adds model export/import, decompilation, and semantic editing commands.

Usage

Basic Analysis

# Analyze a single file
syster model.sysml

# Analyze a directory
syster ./models/

# With verbose output
syster -v model.sysml

# Standard library is loaded by default; skip with --no-stdlib
syster --no-stdlib model.sysml

# Custom stdlib path
syster --stdlib-path /path/to/sysml.library model.sysml

Export Formats

Export models to various interchange formats:

# Export to XMI (OMG standard)
syster model.sysml --export xmi

# Export to YAML (human-readable)
syster model.sysml --export yaml

# Export to JSON-LD (linked data)
syster model.sysml --export json-ld

# Export to KPAR (Kernel Package Archive)
syster model.sysml --export kpar -o model.kpar

# Export AST as JSON
syster model.sysml --export-ast

# Self-contained export (includes stdlib)
syster model.sysml --export xmi --self-contained

Import and Roundtrip

# Import and validate an XMI file
syster model.xmi --import

# Import into workspace for analysis
syster model.xmi --import-workspace

# Decompile XMI back to SysML text + metadata
syster model.xmi --decompile

Decompilation produces two files:

  • model.sysml — the reconstructed SysML text
  • model.metadata.json — element ID mappings for round-trip fidelity

Query and Inspect

Browse the semantic model without modifying it:

# List all elements in a model
syster model.sysml --list

# Search elements by name (substring match)
syster model.sysml --query Vehicle

# Filter by metaclass kind
syster model.sysml --list --kind PartDefinition
syster model.sysml --query mass --kind AttributeUsage

# Inspect a specific element (children, relationships, ID)
syster model.sysml --inspect Vehicle

# Inspect by qualified name
syster model.sysml --inspect "VehicleModel::Car::engine"

# JSON output for any command
syster model.sysml --list --json
syster model.sysml --inspect Vehicle --json

Rename Elements

Rename a definition or usage across the model:

# Rename an element
syster model.sysml --rename Vehicle=Automobile -o updated.sysml

The renamed output is written to the specified file (or stdout). A companion .metadata.json file is written alongside the output so that element IDs are preserved through subsequent edits.

Add Members

Add a new part, attribute, or other member to an existing element:

# Add an untyped part
syster model.sysml --add-member "Vehicle:PartUsage:chassis" -o updated.sysml

# Add a typed part
syster model.sysml --add-member "Vehicle:PartUsage:engine:Engine" -o updated.sysml

# Add an attribute
syster model.sysml --add-member "Vehicle:AttributeUsage:color" -o updated.sysml

The format is PARENT:KIND:NAME[:TYPE]. Supported kinds:

Kind string Element kind
PartUsage, part Part usage
PartDefinition, part_def Part definition
AttributeUsage, attribute, attr Attribute usage
AttributeDefinition, attr_def Attribute definition
PortUsage, port Port usage
PortDefinition, port_def Port definition
ItemUsage, item Item usage
ItemDefinition, item_def Item definition
Package Package

Remove Elements

Remove an element from the model by name or qualified name:

# Remove by simple name
syster model.sysml --remove-member wheels -o updated.sysml

# Remove by qualified name
syster model.sysml --remove-member "VehicleModel::Car::wheels" -o updated.sysml

Metadata and ID Preservation

When working with interchange formats, element identity (UUIDs) matters. The CLI uses companion .metadata.json files to preserve element IDs across edits:

  1. Export a model to XMI — each element gets a stable UUID.
  2. Decompile the XMI back to SysML — a .metadata.json file records the original IDs.
  3. Edit the SysML (rename, add, remove) — the CLI reads the companion metadata and carries IDs forward.
  4. Re-export — previously-known elements retain their original UUIDs.
# Full round-trip example
syster model.sysml --export xmi -o model.xmi
syster model.xmi --decompile -o model.sysml          # creates model.metadata.json
syster model.sysml --rename Car=Sedan -o model.sysml  # updates model.metadata.json
syster model.sysml --add-member "Sedan:PartUsage:sunroof" -o model.sysml
syster model.sysml --export xmi -o model.xmi          # IDs preserved

Export Format Examples

Given this SysML input:

part def Vehicle {
    attribute mass : Real;
}

XMI Output

<?xml version="1.0" encoding="ASCII"?>
<sysml:PartDefinition 
    xmlns:sysml="https://www.omg.org/spec/SysML/20250201"
    xmi:id="68e00c54-9196-421b-9149-76783d5c26f5"
    declaredName="Vehicle" 
    qualifiedName="Vehicle">
  <ownedRelatedElement xsi:type="sysml:AttributeUsage"
      xmi:id="15e06b2e-7efc-4d4a-8c66-670ce186f57f"
      declaredName="mass" 
      qualifiedName="Vehicle::mass"/>
</sysml:PartDefinition>

YAML Output

- '@type': PartDefinition
  '@id': cc10f11d-996f-4251-8952-9723018b762d
  name: Vehicle
  qualifiedName: Vehicle
  ownedMember:
    - '@id': 48e432b9-fdfe-483a-bd2d-36e6417703b2

- '@type': AttributeUsage
  '@id': 48e432b9-fdfe-483a-bd2d-36e6417703b2
  name: mass
  qualifiedName: Vehicle::mass
  owner:
    '@id': cc10f11d-996f-4251-8952-9723018b762d

- '@type': FeatureTyping
  '@id': rel_1
  source:
    '@id': 48e432b9-fdfe-483a-bd2d-36e6417703b2
  target:
    '@id': Real

AST JSON Output (--export-ast)

{
  "files": [
    {
      "path": "model.sysml",
      "symbols": [
        {
          "name": "Vehicle",
          "qualified_name": "Vehicle",
          "kind": "PartDefinition",
          "start_line": 1,
          "start_col": 10,
          "supertypes": ["Parts::Part"]
        },
        {
          "name": "mass",
          "qualified_name": "Vehicle::mass",
          "kind": "AttributeUsage",
          "supertypes": ["Real"]
        }
      ]
    }
  ]
}

All Options

syster [OPTIONS] <FILE>

Arguments:
  <FILE>              Input file or directory to analyze

Options:
  -v, --verbose       Enable verbose output
  -o, --output <FILE> Write output to file instead of stdout
      --json          Output results as JSON
      --no-stdlib     Skip loading standard library
      --stdlib-path   Path to custom standard library

Analysis:
      --export-ast    Export AST as JSON

Interchange (requires interchange feature):
      --export <FMT>    Export model (xmi, yaml, json-ld, kpar)
      --self-contained  Include stdlib in export
      --import          Import and validate interchange file
      --import-workspace Import into workspace for analysis
      --decompile       Decompile interchange to SysML + metadata

Semantic Model:
      --list            List all model elements
      --query <NAME>    Search elements by name (substring)
      --kind <KIND>     Filter by metaclass kind
      --inspect <NAME>  Inspect element details
      --rename <OLD=NEW>  Rename an element
      --add-member <PARENT:KIND:NAME[:TYPE]>  Add a member element
      --remove-member <NAME>  Remove an element

Exit Codes

Code Meaning
0 Success — no errors
1 Error — parse failure, missing element, invalid input, or hard validation error
2 Success with warnings — e.g. --import with unresolved stdlib type references

Features

  • Parse and validate SysML v2 and KerML files
  • Symbol table analysis with qualified names
  • Import resolution and type checking
  • Error reporting with source locations
  • Export to XMI, YAML, JSON-LD, and KPAR formats
  • Import and validate interchange files
  • Decompile XMI back to SysML text with metadata
  • Self-contained export with embedded stdlib
  • Semantic model queries (list, search, inspect)
  • In-place model editing (rename, add member, remove)
  • Element ID preservation across edit round-trips via companion metadata

Supported Formats

Format Extension Description
XMI .xmi OMG XML Metadata Interchange (standard)
YAML .yaml Human-readable YAML representation
JSON-LD .jsonld JSON Linked Data format
KPAR .kpar Kernel Package Archive (ZIP)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syster_cli-0.4.6a0.tar.gz (59.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

syster_cli-0.4.6a0-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

syster_cli-0.4.6a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

syster_cli-0.4.6a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

syster_cli-0.4.6a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

syster_cli-0.4.6a0-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

syster_cli-0.4.6a0-py3-none-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file syster_cli-0.4.6a0.tar.gz.

File metadata

  • Download URL: syster_cli-0.4.6a0.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syster_cli-0.4.6a0.tar.gz
Algorithm Hash digest
SHA256 a09dbf4156f3557da275c31abc703595d16edec2c6507ffdb2f14c1c8ca845e4
MD5 435e8ee1f118319db09bd51552869d1a
BLAKE2b-256 1fce9d7ab36545e780e52a894d59a22fe252bc873b3e508dbeba79828df6ba94

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0.tar.gz:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-win_amd64.whl.

File metadata

  • Download URL: syster_cli-0.4.6a0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4903f5655f2380e61108f9435470f87b1a247f7f7b6367cf1fbc1ade3ea57b04
MD5 631aaae721d5043f078eb8b7cca13dda
BLAKE2b-256 8d77d1cddf944637743f83c6ae80b1c68bba465e2eec8bd54105488909cbef05

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-win_amd64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54376356a3451d46e6af38f83c40c2e61c8fece94be5c1ce0d0fd68159529633
MD5 983a410f747153e2068df70bbfefa8b6
BLAKE2b-256 c4cb3888262e9ca4d865412b3861e84067dec619868b47f9b2b9e4fdac4c072a

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2b4b549877bba1f03e2e353ca35a10a1ed5f166dfbf8456f144acd9654cfbaa0
MD5 d1f32fdc9a9cbfcbf8a62f518644322d
BLAKE2b-256 b6c49c5f95426a0fb73e0e6ae917bef0110e7d375b5db3c297216750b382bfbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9fc5c673999a665be2ff889759fbd3e920c307380163b7bbcf446c0d89be2db1
MD5 8a7edd5842ef6fe8077dd511e79694b1
BLAKE2b-256 4748d5daf654d2ceff765ad79eeac4dd0811d4787ecdeabe149b227454acbaaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3aee0e65b0c07d35fd96a5842b980809c4a3d28eabcc9abf9343b25f0041bcc
MD5 e9d0a01194e878ba705a4d7d048154fb
BLAKE2b-256 950bb7ac54ebe7133ec404cfe0f69937cc35013bb3a6c469baab007d9b2f8178

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syster_cli-0.4.6a0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.6a0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 331437e88fcb5828b9cb214a00113d89482cb018a0c6b3f9859017feb48bfd49
MD5 ec563bf981c815b995bd329db6ef8836
BLAKE2b-256 902e5877763ec602cfae1f81c1c06bfaf186cb9e15c316d87f623a8eed696c00

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.6a0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on jade-codes/syster-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page