Skip to content

Latest commit

 

History

History
190 lines (136 loc) · 6.37 KB

get_started.md

File metadata and controls

190 lines (136 loc) · 6.37 KB

SlimIO Starter Guide

Summary

The purpose of this guide is to allow Developers and Integrators to initialize and setup a SlimIO agent on their local machine (the next guide will be dedicated to how to create your first addon.).

Requirements

⚠️ Node.js must be installed first to get the npm binary command.

To setup the SlimIO CLI with npm just run in your terminal:

$ npm install @slimio/cli -g

Then, run the --help or -h command to known the complete list of available commands.

$ slimio --help

  Usage
    $ slimio <command> [options]

  Available Commands
    init       Clone and install a complete SlimIO Agent.
    add        Add one or many addons to the local agent (Each addon are enabled by default.).
    remove     Remove one or many addons from the local agent (erase them from the disk.).
    create     Create and/or generate SlimIO files and addons.
    build      Build and compile an agent into an executable with Node.js bundled in it.
    archive    Create an addon archive (useful to remotely deploy addons with Prism).
    connect    Connect to a local or remote SlimIO agent (must be started and use the Socket built-in Addon).
    config     Configure a local or remote running agent.
    schema     Create a config file from a JSON Schema (2019-09 draft).
    debug      Debug the local agent (navigate through local agent dump files).
    start      Start the local agent with advanced debugging and logging utilities.
    lang       Configure the CLI default language (which is english by default).
    set        Setup and/or configure a given setting in the local cache.
    get        Get one or all keys stored in the local cache (return all keys if no argument is given).

  For more info, run any command with the `--help` flag
    $ slimio init --help
    $ slimio add --help

  Options
    -v, --version    Displays current version
    -h, --help       Displays this message

👀 If you'r working with private SlimIO packages, think to setup tokens.

Language

The CLI has a i18n implementation. The slimio lang will allow you to choose another language.

Feel free to pull request on github your own language!

Manual installation

⚠️ Manual installation require a lot of experience as a Node.js developer.

For anyone who want to known how to setup an Agent without the help of the CLI.. follow the Getting Started on the Agent repository.

This repository describe how work an Agent and list all his components (useful if you want to dig deeper).

Getting Started

To setup a basic agent just run the following command at the location where you want the agent to be installed:

$ slimio init --set metrology --add ihm

⚠️ The init command create the folder for you (dont mkdir an agent directory yourself).

The CLI will then install the complete agent in "agent" folder by default (which include five built-in addon).

The command can be customised to choose the directory name and eventually initialize with additionals addons (for example to install ihm, prism etc..). Addons must be separated by comma.

$ slimio init dirName --add ihm,prism

or to setup a given set (for example to install all required addons to achieve metrology)

$ slimio init --set metrology --add ihm

Now that your agent is installed you can launch it with

$ cd agent # enter in the installed directory (if not done yet).
$ slimio start
# OR without npm
$ node index --autoreload 500

👀 Complete documentation on the script argument here

Install / Add one or many addons

If you want to install additional addons, just go to the root of the agent and run following command:

$ cd yourAgentFolder
$ slimio add cpu-addon
# Or use the complete github URL
$ slimio add https://github.com/SlimIO/cpu-addon

By default all addon(s) are writted as active in agent.json.

{
    "addons": {
        "cpu": {
            "active": true,
            "standalone": false
        }
    }
}

👀 📄 for more information on agent.json fields, check Agent configuration

If you want to add each addons as active: false add the -d (--disabled) option.

$ slimio add cpu-addon -d 

Remove installed addon

It is possible to completely remove installed addon with the slimio remove command. Let's imagine that we want to remove the ihm addon. Just run the following command in your terminal:

$ slimio remove ihm

By default the addon will be deleted from the local agent configuration. (agent.json). If for some reason the addon has been removed from ./addons but not from agent.json, then just run a synchronization:

$ slimio config sync

Configure agent.json / agent.toml

The SlimIO CLI expose a config command that allow you to easily manage and edit agent.json. By default this command run a REPL (Real-eval-print-loop) if there is no arguments provided (Like the example bellow).

Running help into this REPL will give you the complete list of available commands.

These commands can be runned without entering the REPL mode, few examples:

$ slimio config sync
$ slimio config enable ihm,cpu

Notice that addons must be separated by a comma for sync, enable and disable commands.

Available addons

SlimIO is not a the state of MVP yet. A lot of addons have to be installed by yourself if you want to experiment with the product.

name description git
ihm Light embedded interface to manage a local Agent https://github.com/SlimIO/ihm