MOD command line interface

From MOD Wiki
Jump to navigation Jump to search

The MOD command line interface (modcli) is a small python tool that is used to communicate with the cloud API and ease the process of building and publishing your plugin.

Installation

First you will need to follow the instructions from the mod-devel-cli project to install the tool.

Once installed you can check the status:

$ modcli config list
Active environment: labs
Authenticated in [labs]: No
Registered environments: ['dev', 'labs']

If your active environment is not 'labs' then you have to change it:

$ modcli config set_active_env labs
Current environment set to: labs

Next you need to authenticate. The modcli tool will authenticate using SSO against MOD Forum. So make sure you register for an account first. Then:

$ modcli auth login_sso
SSO login requires you have a valid account in MOD Forum (https://forum.moddevices.com).
If your browser has an active session the credentials will be used for this login. Confirm? [y/N]: y
Logging in to [labs]...
You're now logged in as [xxx] in [labs].

Publishing a plugin

The most basic command for publishing a plugin is:

$ modcli bundle publish <path/to/.json>

When using this command it's important the the .mk file used for the package is in the same directory is the .json file. If .mk file is located somewhere else, for example when using the mod-plugin-builder, the '-p' flag can be used to provide a path to this file. This is done as follows:

$ modcli bundle publish -p ../mod-plugin-builder <path/to/.json>