@ditrit/leto-modelizer-plugin-cli v2.0.1
Leto Modelizer Plugin CLI (leto-modelizer-plugin-cli)
Client for Leto-Modelizer. It installs plugins and imports their models and icons.
Requirements
Leto Modelizer Install
To install the client in Leto Modelizer, use this command line:
npm install --save-dev "git://github.com/ditrit/leto-modelizer-plugin-cli.git#1.0.0"Add this to package.json scripts:
{
"plugin:install": "node node_modules/leto-modelizer-plugin-cli install",
"plugin:init": "node node_modules/leto-modelizer-plugin-cli init"
}How to define official plugins
The user can select one or more plugins to install from a list of official plugins. To do that, create a leto-modelizer-plugin-cli.json file at the root of Leto Modelizer project. Each object represent a plugin. Example :
[
{
"displayName": "Terraform plugin",
"name": "terrator-plugin",
"scope": "ditrit",
"version": "0.12.0" ,
"url": "https://github.com/ditrit/terrator-plugin.git#0.11.0"
}
]displayNameattribute represents the plugin's display name, which is used to assist the user during installation.nameattribute is the plugin's name and must match the one defined in the plugin project.urlattribute is the repository url of the plugin. It must be valid (see NOTE ).scopeattribute is the organisation name of the plugin.versionattribute is the release version of the plugin.
:warning: The url attribute is optional! If specified, the plugin will be installed from the repository instead of the registry.
NOTE:
The repository url must be valid like git@github.com/repository.git, http(s)://github.com/repository.git or http(s)://github.com/repository.git#1.0.0.
Leto Modelizer commands
Install
"plugin:install": "leto-modelizer-plugin-cli install",Tasks performed during installation:
- Install plugin(s) using npm.
- Import icons and models from each installed plugins.
- Then generate or update "src/plugins/index.js".
Options name and version can be added with the npm run plugin:install command
to bypass cli prompts. Example :
npm run plugin:install -- name="name" version="version"Uninstall
"plugin:uninstall": "leto-modelizer-plugin-cli uninstall",Tasks performed during installation:
- Uninstall plugin(s) using npm.
- Delete icons and models from each deleted plugins.
- Then generate or update "src/plugins/index.js".
Options name and version can be added with the npm run plugin:uninstall command
to bypass cli prompts. Example :
npm run plugin:uninstall -- name="name" version="version"