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.5a0.tar.gz (60.3 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.5a0-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

syster_cli-0.4.5a0-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.5a0-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.5a0-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.5a0-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

syster_cli-0.4.5a0-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.5a0.tar.gz.

File metadata

  • Download URL: syster_cli-0.4.5a0.tar.gz
  • Upload date:
  • Size: 60.3 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.5a0.tar.gz
Algorithm Hash digest
SHA256 5dc504c8796ec49b46abecbd922dcbc92a9f7d28da45d911c2a251ad74382f23
MD5 c171ede4b03bb9e66bfc8d578ea5bee6
BLAKE2b-256 e05475eb073ec2ee423300d30bfbd6a654ad78dd65f03765e69231864ab2102c

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0.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.5a0-py3-none-win_amd64.whl.

File metadata

  • Download URL: syster_cli-0.4.5a0-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.5a0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 16fd0e96644de713b45730ea15c3a25f8f0654ec89b5b95f59568cdb53330936
MD5 c950047063f4856d15ff5e1ece4ef9bb
BLAKE2b-256 1dfc216829a1208a00dc3cb3b953a335a29fd3218fd24ffbe6c3cedd9bb92da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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.5a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.5a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 892b32aa0192a5b0a0ddd6500512e123de2b46c8d8f686aa114e04b390a5da5f
MD5 6748c5792a6fdcbf01e231eb8a6f0ea5
BLAKE2b-256 ef459fe3d5d20752f674c308c51fc16f7cb8f8607f39aa3a0b9e183a3948fd5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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.5a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.5a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7db49ce85c7d20a3b83e35dc3ddef735570fb925044acae7c42beac609e31106
MD5 595e93b938e6c751a4500a6ea9623293
BLAKE2b-256 cdf54afdfc11b438f558b67c98bf678c53f46c2c7672d956e45aa8df86222533

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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.5a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.5a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3e4faa713b1f4e4baaf5983620f519912441900044711997278e81cb617bf06f
MD5 cccbee259140f62f23182bccff63581a
BLAKE2b-256 0719824b48d2ee5252a68bd8ddbc735bc9af931a655d42a66572a94d29536773

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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.5a0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.5a0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 606ac40e5df034c1593343677b984169364872e041f74b867ad5e65d86cfb959
MD5 2904113e36ce7d1b2e4f354478f385fe
BLAKE2b-256 4f891e474130e13aa524aa05fb4a60d98cb4d2f7f45f41baa5b0b255f6003b5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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.5a0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for syster_cli-0.4.5a0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 49407d016ddfad6f558547ee2b7d1caad4fd49c516cd2cdb20cf48dc79e43674
MD5 73639c25ea1986b8fa899fd3251619a2
BLAKE2b-256 b2b86facdbc60f2a3ad6e5b2a894b49c086e02695d86edab61ed15ad7e22b5ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for syster_cli-0.4.5a0-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