Skip to content

Commit

Permalink
Cli Tool documentation improvements. Fixes #254
Browse files Browse the repository at this point in the history
Signed-off-by: Nagavijay Sivakumar <nagavijay.sivakumar@bosch-si.com>
  • Loading branch information
Nagavijay Sivakumar committed Jul 25, 2016
1 parent 08027d4 commit 7dc5474
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 17 deletions.
98 changes: 81 additions & 17 deletions website/documentation/vorto-repository/cli-tool/cli-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,57 @@ Vorto Command Line Interface (CLI) tool is REST-Client that allows you, to acces

The CLI-Tool is based on a simple structure.

It consists of a Command Line Interface as well as a `.yaml` file, that stores all necessary configuration properties like _Username_, _Password_, _Proxy_ and _Repository_.
It consists of a Command Line Interface as well as a **.yaml** file, that stores all necessary configuration properties like _Username_, _Password_, _Proxy_ and _Repository_.

## Installation

First of all, you have to download the CLI Tool from the <a href="{{ base }}/downloads/index.html">download</a> page and save it to any working directory.

A very convenient way to use the CLI Tool is, to add the path of the directory into the system's environment PATH variable. Once you did this, you can call the CLI-Tool from any directory.

For Windows,
Open Control Panel -> Advanced System Settings -> Advanced -> Environment Variables

![Environment Variable]({{base}}/img/documentation/cli_evnmt_variable.jpg)

Before you can use the CLI Tool as a REST Client, you need to initialize basic preferences. The preferences are stored in the file `.vortocli.yaml`, which is located in your home directory (in Windows, for example: `C:\Users\{$username}\`).
For Mac/Linux, from Terminal window execute,

export path=%path%:~/Applications/<<vorto cli tool installed directory>>


Before you can use the CLI Tool as a REST Client, you need to initialize basic preferences.

By default the preferences are stored in `<<home directory>>/.vortocli.yaml.file`, which is located in your home directory.
For Windows,

`C:\Users\{$username}\.vortocli.yaml.file`

For Mac,

`/Users/{$username}/Documents/.vortocli.yaml.file`

For Linux,

You have to setup vorto in one of the following ways:
`/usr/{$username}/Documents/.vortocli.yaml.file`

* Use the **vorto config** command.
To initialize vorto with additional values (or change them afterwards) like username, password, proxy or repository, use the command flags `-username`, `-password`, `-proxy` or `-repo`.
Example: `vorto config -username <username> -password <password> -repo http://vorto.eclipse.org`
* Edit the `.vortocli.yaml` file with a text editor.
![CLI Yaml file]({{base}}/img/documentation/yamlfile.jpg)

You have to setup vorto via **vorto config**. If you want to initialize vorto with additional values (or change them afterwards) like _-username_, _-password_, _-proxy_ and _-repo_, then you can extend the **vorto config** command with four additional flag parameters _-username_, _-password_, _-proxy_ and _-repo_, or you can edit the _.vortocli.yaml_ file via text editor.

vorto config -username vortouser -password password -repo http://vorto.eclipse.org

Congratulations! - Setup is done and you are now able to use the Vorto CLI Tool.

![CLI Yaml file]({{base}}/img/documentation/yamlfile.jpg)

<table class="table table-bordered">
<tbody>
<tr>
<td><i class="fa fa-info-circle info-note"></td>
<td>Enable the proxy in the configuration file _.vortocli.yaml_ (Line 4) if you are accessing internet via proxy server. </td>
</tr>
</tbody>
</table>


## CLI Commands

Expand All @@ -67,44 +96,79 @@ Each of them is based on a similar structure and offers a unique functionality.
<tbody>
<tr>
<td>vorto config</td>
<td>With the vorto config command you do the basic CLI Tool setup.<br>Additional flag parameters:<br><ul><li>username - vorto username credentials</li><li>password - vorto password credentials</li><li>proxy- network proxy</li><li>repo - specify repository (Default: http://vorto.eclipse.org/repo)</li></ul></td>
<td><b>vorto config -username andreas -password test1234 -repo http://vorto.eclipse.org/repo</b></td>
<td>With the vorto config command you do the basic CLI Tool setup.<br>Additional flag parameters:<br><ul><li>username - vorto username credentials</li><li>password - vorto password credentials</li><li>proxy- network proxy</li><li>repo - specify repository (Default: http://vorto.eclipse.org)</li></ul></td>
<td>
For (Windows/Mac/Linux),<br/>
<b>vorto config -username vortouser -password password -repo http://vorto.eclipse.org</b></td>
</tr>
<tr>
<td>vorto help</td>
<td>To get more familiar with the CLI Tool commands, it's a good approach to call the <b>vorto help</b> command.<br><b>vorto help</b> lists you all other possible commands, including flag parameters and examples.</td>
<td><b>vorto help</b></td>
<td>For (Windows/Mac/Linux),<br/>
<b>vorto help</b></td>
</tr>
<tr>
<td>vorto query</td>
<td>After everything is successfully setup, you are able to access the Repository.<br> Via <b>vorto query</b> you can query all models of your Repository.<br>The result of this command contains all models in the Repository.</td>
<td><b>vorto query "*"</b></td>
<td>
For (Windows/Mac/Linux),<br/>
eg.1, <b>vorto query "*"</b><br/>
eg.2, <b>vorto query "*functionblocks*"</b></td>
</tr>
<tr>
<td>vorto info</td>
<td>If you are now interested in a certain model and you want to get more information from this specific model, you can use vorto info to get it.<br> The result of this command is a detailed view of the requested model.</td>
<td><b>vorto info examples.informationmodels.sensors.TI_SensorTag_CC2650:1.0.0</b></td>
<td>
For (Windows/Mac/Linux),<br/>
<b>vorto info examples.informationmodels.TI_SensorTag:1.0.0</b></td>
</tr>
<tr>
<td>vorto download</td>
<td>Furthermore you can start working with a certain model locally, when you download it via <b>vorto download</b>.<br> To open and to work with it, you can use any text editor to modify this certain model and you can even upload it again.<br>Via the flag -outputPath can you specify a download directory.<br>Additional flag parameters:<br><ul><li>output - (Default: DSL)</li><li>outputPath - path to store the download (Default: current directory)</li><li>includeDependencies - whether to include dependencies or not (Default: false)</li></ul></td>
<td><b>vorto download examples.informationmodels.sensors.TI_SensorTag_CC2650:1.0.0 -outputPath D:\models</b></td>
<td>
For Windows, <br/>

<b>vorto download examples.informationmodels.TI_SensorTag:1.0.0 -outputPath D:\models</b>
<br/><br/>
For Mac/Linux, <br/>
<b>vorto download examples.informationmodels.TI_SensorTag:1.0.0 -outputPath /Users/{$username}/Documents/models/</b>
</td>

</tr>
<tr>
<td>vorto generators</td>
<td>If you want to generate platform specific code, you can get a short overview of all active code generators via <b>vorto generators</b>.</td>
<td><b>vorto generators</b></td>
<td>
For (Windows/Mac/Linux),<br/>
<b>vorto generators</b></td>
</tr>
<tr>
<td>vorto generate</td>
<td>Afterwards you can generate <b>vorto generate</b> your platform specific code (specified by -generatorKey) in a very convenient way.<br>Additional flag parameters:<br><ul><li>generatorKey</li><li>outputPath</li></ul></td>
<td><b>vorto generators</b></td>
<td>
For Windows, <br/>
<b>vorto generate examples.informationmodels.TI_SensorTag:1.0.0 -generatorKey mqtt -outputPath D:\models</b>
<br/><br/>
For Mac/Linux, <br/>
<b>vorto generate examples.informationmodels.TI_SensorTag:1.0.0 -generatorKey mqtt -outputPath /Users/{$username}/Documents/models//b>
</td>
</tr>
<tr>
<td>vorto share</td>
<td>Additionally to all this access functionality, you are also able to share your models.<br>Therefore you either have to deposit your credentials in the .vortocli.yaml file or you have to pass them as additional parameters.<br>
Additional flag parameters:<br><ul><li>username - vorto username credentials (Default: value in .vortocli.yaml)</li><li>password - vorto password credentials (Default: value in .vortocli.yaml)</li></ul></td>
<td><b>vorto share D:\Models\ TI_SensorTag_CC2650\src\models\ TI_SensorTag_CC2650.infomodel</b><br><b>vorto share D:\Models\ TI_SensorTag_CC2650\src\models\ TI_SensorTag_CC2650.infomodel -username andreas -password test1234</b></td>
<td>
For Windows,<br/>
<b>vorto share D:\Models\TI_SensorTag_CC2650\src\models\TI_SensorTag.infomodel
</b>
<br/>
<b>vorto share D:\Models\TI_SensorTag_CC2650\src\models\TI_SensorTag.infomodel -username vortouser -password password</b>
<br/><br/>
For Mac/Linux,<br/>
<b>vorto share /Users/{$username}/Documents/models/TI_SensorTag.infomodel
</b>
<br/><br/>
<b>vorto share /Users/{$username}/Documents/models/TI_SensorTag.infomodel -username vortouser -password password</b></td>
</tr>
</tbody>
</table>
Binary file modified website/img/documentation/yamlfile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7dc5474

Please sign in to comment.