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

Uploaded Python 3Windows x86-64

syster_cli-0.5.1a0-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.5.1a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

syster_cli-0.5.1a0-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.5.1a0.tar.gz.

File metadata

  • Download URL: syster_cli-0.5.1a0.tar.gz
  • Upload date:
  • Size: 59.1 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.5.1a0.tar.gz
Algorithm Hash digest
SHA256 3e416d94f2d7fd74464da7296b8f801d2ec0c234273cc015146f2e1e331aebda
MD5 b0d746464c0bd9c4eee7ff4d49a5d139
BLAKE2b-256 47856b2ed8fe897df1e473d5b13ed4ace2cbd1f57095a10497c93a39e10a059f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: syster_cli-0.5.1a0-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.5.1a0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5947c1abeb236706e0d67c3ffeff5379c5ae6af313f3b9a6b9545b4578ada639
MD5 141a98eda4a98d3b14d041e12e636d22
BLAKE2b-256 371bca075e4dc58db34ca2de3b305008071fc25db2ade179056fd92483addf1f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for syster_cli-0.5.1a0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e5e3c60e7d9774295d4d019b91aeadff005fb1603d2dcc8e3a6eb314643dd62
MD5 37ae09126e86808eef9c8ad3a6798265
BLAKE2b-256 e73366c36ea1128a72ac48bc0a2f961ff5c292c93e1d7f081d34002ba531f677

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for syster_cli-0.5.1a0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cd25471b4d7a1ac3b52a4b912188449cb81a9a5a5a78bf674778794982e63758
MD5 ac5963f69b378df8a0932b45c9f40222
BLAKE2b-256 df0eda81e30755d1d3143e5722141ead98a84df47ac76728234a8b53b4040bf4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for syster_cli-0.5.1a0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8c8272762c66634afe4d93f61703030a90bfca6b005170532b9251b370a6ad97
MD5 20d6d51c51214f496725056ae0770c14
BLAKE2b-256 755b56b8eeda9e378bf6d3e771df41971a7ff9280a8c503142a343fa2a746dd9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for syster_cli-0.5.1a0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2257531e77185e902300f9ff05b2d05e9c3362243d9e6647f5fc27012aaf146
MD5 2ffe7c851d9f13d6a8ac0d760e2585a0
BLAKE2b-256 12a200010044e23be5b0cc0b49e5c8ac8da0307643d4616651ae1dced4c840a4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for syster_cli-0.5.1a0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ef487f816bf3f97b9a4e56f57100b18879f8b7239daa8471acd98b85b0df999
MD5 5cc3081cbfb8d10008e6bc9781a66b6d
BLAKE2b-256 33661b1d2125cb2ea51de733004fcfa03a3e9f22dd65ffbfd56e82fab319aaaf

See more details on using hashes here.

Provenance

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