diff --git a/website/documentation/vorto-repository/cli-tool/cli-tool.md b/website/documentation/vorto-repository/cli-tool/cli-tool.md index 52f3f8281c..2c2e8e0c1b 100644 --- a/website/documentation/vorto-repository/cli-tool/cli-tool.md +++ b/website/documentation/vorto-repository/cli-tool/cli-tool.md @@ -17,42 +17,61 @@ title: Vorto CLI Tool ## Overview -Vorto Command Line Interface (CLI) tool is REST-Client that allows you, to access your specified repository with all Vorto related functionalities. +The Vorto Command Line Interface (CLI) tool is a REST-Client that allows you to access your specified repository with all Vorto related functionalities. ## Basic Structure -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_. +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_. ## Installation -First of all, you have to download the CLI Tool from the download page and save it to any working directory. +Download the CLI Tool from the Vorto Downloads 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 a terminal window execute + + export path=%path%:~/Applications/<> + +Before you can use the CLI Tool as a REST Client, you need to initialize basic preferences. By default the preferences are stored in the file `.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. +You have to setup the CLI Tool in one of the following ways: + +* 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 -password -repo http://vorto.eclipse.org` * Edit the `.vortocli.yaml` file with a text editor. ![CLI Yaml file]({{base}}/img/documentation/yamlfile.jpg) -Congratulations! - Setup is done and you are now able to use the Vorto CLI Tool. - + + + + + + + +
Enable the proxy in the configuration file .vortocli.yaml (Line 4) if you are accessing internet via proxy server.
## CLI Commands -Now let's continue how you can really gain a benefit from the CLI Tool. - -The Vorto CLI Tool provides a scope of seven different Vorto Commands to interact with your specified Repository. - -Each of them is based on a similar structure and offers a unique functionality. +The Vorto CLI Tool provides a scope of different Vorto Commands to interact with your specified Repository. +Each of them offers a unique functionality and is based on the following syntax: vorto [command] [-flag1 parameter1 -flag2 parameter2 ... ] @@ -66,45 +85,117 @@ Each of them is based on a similar structure and offers a unique functionality. - vorto config - With the vorto config command you do the basic CLI Tool setup.
Additional flag parameters:
  • username - vorto username credentials
  • password - vorto password credentials
  • proxy- network proxy
  • repo - specify repository (Default: http://vorto.eclipse.org/repo)
- vorto config -username andreas -password test1234 -repo http://vorto.eclipse.org/repo - - - vorto help - To get more familiar with the CLI Tool commands, it's a good approach to call the vorto help command.
vorto help lists you all other possible commands, including flag parameters and examples. - vorto help - - - vorto query - After everything is successfully setup, you are able to access the Repository.
Via vorto query you can query all models of your Repository.
The result of this command contains all models in the Repository. - vorto query "*" + vorto config + With the vorto config command you do the basic CLI Tool setup.
Additional flag parameters:
+
    +
  • username
    + Vorto Repository username credentials
  • +
  • password
    + Vorto Repository password credentials
  • +
  • proxy
    + network proxy
  • +
  • repo
    + Vorto repository URL (default: http://vorto.eclipse.org)
  • +
+ + + For (Windows/Mac/Linux),
+

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

+ + + + vorto help + To get more familiar with the CLI Tool commands, it's a good approach to call the vorto help command.
vorto help lists you all other possible commands, including flag parameters and examples. + For (Windows/Mac/Linux),
+

vorto help + + + + vorto query + After everything is successfully setup, you are able to access the Repository.
Via vorto query you can query models of your Repository. + + + For (Windows/Mac/Linux),

+ Query all models of your Repository:
+ vorto query "*"

+ Query all models containing the string "functionblocks":
+ vorto query "*functionblocks*" - vorto info - 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.
The result of this command is a detailed view of the requested model. - vorto info examples.informationmodels.sensors.TI_SensorTag_CC2650:1.0.0 + vorto info + 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.
+ The result of this command is a detailed view of the requested model. + + For (Windows/Mac/Linux),
+ vorto info examples.informationmodels.TI_SensorTag:1.0.0 - vorto download - Furthermore you can start working with a certain model locally, when you download it via vorto download.
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.
Via the flag -outputPath can you specify a download directory.
Additional flag parameters:

  • output - (Default: DSL)
  • outputPath - path to store the download (Default: current directory)
  • includeDependencies - whether to include dependencies or not (Default: false)
- vorto download examples.informationmodels.sensors.TI_SensorTag_CC2650:1.0.0 -outputPath D:\models - - - vorto generators - If you want to generate platform specific code, you can get a short overview of all active code generators via vorto generators. - vorto generators - - - vorto generate - Afterwards you can generate vorto generate your platform specific code (specified by -generatorKey) in a very convenient way.
Additional flag parameters:
  • generatorKey
  • outputPath
- vorto generators - - - vorto share - Additionally to all this access functionality, you are also able to share your models.
Therefore you either have to deposit your credentials in the .vortocli.yaml file or you have to pass them as additional parameters.
- Additional flag parameters:
  • username - vorto username credentials (Default: value in .vortocli.yaml)
  • password - vorto password credentials (Default: value in .vortocli.yaml)
- vorto share D:\Models\ TI_SensorTag_CC2650\src\models\ TI_SensorTag_CC2650.infomodel
vorto share D:\Models\ TI_SensorTag_CC2650\src\models\ TI_SensorTag_CC2650.infomodel -username andreas -password test1234 - + vorto download + Furthermore you can start working with a certain model locally, when you download it via vorto download.
+ 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.
+ Via the flag -outputPath you can specify a download directory.
+ Additional flag parameters:
+
    +
  • output
    + output format (default: DSL)
  • +
  • outputPath
    + path to store the download (default: current directory)
  • +
  • includeDependencies
    + whether to include dependencies or not (default: false)
  • +
+ + + For Windows,
+ vorto download examples.informationmodels.TI_SensorTag:1.0.0 -outputPath D:\models

+ For Mac/Linux,
+ vorto download examples.informationmodels.TI_SensorTag:1.0.0 -outputPath /Users/{$username}/Documents/models/ + + + + vorto generators + If you want to generate platform specific code, you can get a short overview of all active code generators via vorto generators. + + + For (Windows/Mac/Linux),
+ vorto generators + + + + vorto generate + Afterwards you can generate vorto generate your platform specific code (specified by -generatorKey) in a very convenient way.
+ Additional flag parameters:
+
    +
  • generatorKey
  • +
  • outputPath
  • +
+ + + For Windows,
+ vorto generate examples.informationmodels.TI_SensorTag:1.0.0 -generatorKey mqtt -outputPath D:\models

+ For Mac/Linux,
+ vorto generate examples.informationmodels.TI_SensorTag:1.0.0 -generatorKey mqtt -outputPath /Users/{$username}/Documents/models + + + + vorto share + Additionally to all this access functionality, you are also able to share your models.
+ Therefore you either have to deposit your credentials in the .vortocli.yaml file or you have to pass them as additional parameters.
+ Additional flag parameters:
+
    +
  • username
    + Vorto Repository username credentials (default: value in .vortocli.yaml)
  • +
  • password
    + Vorto Repository password credentials (default: value in .vortocli.yaml)
  • +
+ + + For Windows,
+ vorto share D:\Models\TI_SensorTag_CC2650\src\models\TI_SensorTag.infomodel
+ vorto share D:\Models\TI_SensorTag_CC2650\src\models\TI_SensorTag.infomodel -username vortouser -password password

+ For Mac/Linux,
+ vorto share /Users/{$username}/Documents/models/TI_SensorTag.infomodel

+ vorto share /Users/{$username}/Documents/models/TI_SensorTag.infomodel -username vortouser -password password + + \ No newline at end of file diff --git a/website/img/documentation/cli_evnmt_variable.jpg b/website/img/documentation/cli_evnmt_variable.jpg index 2b35082b9c..4e92ac944e 100644 Binary files a/website/img/documentation/cli_evnmt_variable.jpg and b/website/img/documentation/cli_evnmt_variable.jpg differ diff --git a/website/img/documentation/yamlfile.jpg b/website/img/documentation/yamlfile.jpg index 0a3a13a2cd..3160c9d0f3 100644 Binary files a/website/img/documentation/yamlfile.jpg and b/website/img/documentation/yamlfile.jpg differ