Skip to content

Commit da3a216

Browse files
committed
Update documentation for samm-cli
1 parent 24865de commit da3a216

File tree

1 file changed

+47
-15
lines changed
  • documentation/developer-guide/modules/tooling-guide/pages

1 file changed

+47
-15
lines changed

documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ latest release [on GitHub](https://github.com/eclipse-esmf/esmf-sdk/releases/lat
1111
[[samm-cli-getting-started]]
1212
== Running the SAMM CLI
1313

14-
For the executable jar, call `java -jar samm-cli-{esmf-sdk-version}.jar` followed by one of the following subcommands (e.g., `java -jar samm-cli-{esmf-sdk-version}.jar help`).
15-
In the following sections, `samm` will be used as the command name.
14+
For the executable jar, call `java -jar samm-cli-{esmf-sdk-version}.jar` followed by one of the
15+
following subcommands (e.g., `java -jar samm-cli-{esmf-sdk-version}.jar help`). In the following
16+
sections, `samm` will be used as the command name.
1617

1718
[TIP]
1819
====
@@ -26,27 +27,53 @@ alias samm='java -jar /location/to/samm-cli-{esmf-sdk-version}.jar'
2627
====
2728

2829
. *For the Windows native executable:*
29-
* *Download*: Download via above link or visit the repository of the Java SDK which contains the SAMM CLI at the Github https://github.com/eclipse-esmf/esmf-sdk/releases[releases page] and download executable file for Windows.
30+
* *Download*: Download via above link or visit the repository of the Java SDK which contains the
31+
SAMM CLI at the Github https://github.com/eclipse-esmf/esmf-sdk/releases[releases page] and
32+
download executable file for Windows.
3033
* *Extract*: extract it to a location of your choice.
3134
* *Open* `samm.exe`: This will open a command prompt in this directory, where you can enter further `samm` commands.
3235
* *Input*: Make sure to read the below documentation and provide model files in the correct xref:models-directory-structure[directory structure].
3336

3437
. *For the Linux native executable:*
35-
* *Download*: Download via above link or visit the repository of the Java SDK which contains the SAMM CLI at the Github https://github.com/eclipse-esmf/esmf-sdk/releases[releases page] and download executable file for Linux.
38+
* *Download*: Download via above link or visit the repository of the Java SDK which contains the
39+
SAMM CLI at the Github https://github.com/eclipse-esmf/esmf-sdk/releases[releases page] and
40+
download executable file for Linux.
3641
* *Extract*: Unpack the archive to your preferred directory.
3742
* *Open Terminal*: Open the Terminal and navigate to the directory with the application.
38-
* *Input*: Make sure to read the below documentation and provide model files in the correct xref:models-directory-structure[directory structure].
43+
* *Input*: Make sure to read the below documentation and provide model files in the correct
44+
xref:models-directory-structure[directory structure].
45+
3946
* *Execute*: Run the application using the command `./samm`.
4047

41-
Successful execution of a command is signaled by returning 0. In case of a logical or other internal error the error code 1 is being returned.
42-
Missing or wrong command parameters result in error code 2 being returned.
48+
Successful execution of a command is signaled by returning 0. In case of a logical or other internal
49+
error the error code 1 is being returned. Missing or wrong command parameters result in error code 2
50+
being returned.
4351

44-
To get an overview of all commands and subcommands, use `samm help`.
45-
To get help for a certain subcommand, use `help` before the subcommand name, e.g., `samm help aspect`, `samm help aspect validate` or `samm help aas to aspect`.
46-
Each subcommand can have its own set of options which allow the user to further fine-tune the execution of the command.
47-
The available options and their meaning can also be seen in the help text of the individual subcommands.
52+
To get an overview of all commands and subcommands, use `samm help`. To get help for a certain
53+
subcommand, use `help` before the subcommand name, e.g., `samm help aspect`, `samm help aspect
54+
validate` or `samm help aas to aspect`. Each subcommand can have its own set of options which allow
55+
the user to further fine-tune the execution of the command. The available options and their meaning
56+
can also be seen in the help text of the individual subcommands.
4857

4958
=== List of commands
59+
60+
[TIP]
61+
====
62+
In place of `<model>` in the command descriptions below, you can provide either one of:
63+
64+
* a relative file name, such as `AspectModel.ttl` or `./somewhere/AspectModel.ttl` (on Linux and
65+
MacOS) or `.\somewhere\AspectModel.ttl` (on Windows),
66+
* an absolut file name, such as
67+
`/home/me/aspect-models/org.eclipse.esmf.example/1.0.0/AspectModel.ttl` (on Linux and MacOS) or
68+
`C:\Users\me\aspect-models\org.eclipse.esmf.example\1.0.0\AspectModel.ttl` (on Windows),
69+
* a URL pointing to a .ttl file in a publically accessible GitHub repository, such as
70+
`\https://github.com/eclipse-tractusx/sldt-semantic-models/blob/main/io.catenax.battery.battery_pass/6.0.0/BatteryPass.ttl`
71+
or `\https://github.com/eclipse-esmf/esmf-aspect-model-editor/blob/main/core/apps/ame/src/assets/aspect-models/org.eclipse.examples/1.0.0/Movement.ttl`,
72+
* an Aspect Model URN, such as `urn:samm:org.eclipse.esmf.example:1.0.0#Aspect`, however note that
73+
this also requires setting a models source, see xref:configuration-of-model-resolution[configuration
74+
of model resolution] for more information.
75+
====
76+
5077
[width="100%",options="header",cols="20,50,30"]
5178
|===
5279
| Command | Description/Options | Examples
@@ -209,6 +236,7 @@ The available options and their meaning can also be seen in the help text of the
209236

210237
|===
211238

239+
[[configuration-of-model-resolution]]
212240
=== Configuration of model resolution
213241

214242
When a loaded file refers to model elements defined elsewhere, the model resolver looks up the files
@@ -228,10 +256,14 @@ to load. You can configure where such lookup should be done:
228256
language/script language, including complex logic if necessary.
229257

230258
* Using the `--github` switch, you can configure a location in a remote GitHub repository as models
231-
root. Using the switch requires the additional switch `--github-name` to set the remote
232-
repository (e.g., `eclipse-esmf/esmf-sdk`). Optionally, you can also provide `--github-directory`
233-
to set the remote directory and `--github-branch` to set the branch name.
234-
259+
root, e.g., `eclipse-esmf/esmf-sdk`. Optionally, you can also provide `--github-directory`
260+
to set the remote directory and `--github-branch` or `--github-tag` to set the branch name or tag,
261+
respectively.
262+
263+
NOTE: When using an Aspect Model URN as input to a command (such as
264+
`urn:samm:org.eclipse.esmf.example:1.0.0#Aspect`), you must also provide at least one of the
265+
switches mentioned above (`--models-root`, `--custom-resolver` or `--github`), otherwise samm-cli
266+
will not know where to find the corresonding file(s).
235267

236268
[[using-the-cli-to-create-a-json-openapi-specification]]
237269
== Using the CLI to create a JSON OpenAPI Specification

0 commit comments

Comments
 (0)