Skip to main content

CLI Setup

This document describes how to set up the ESP RainMaker command-line interface (CLI) utility.

Installing Python 3

If you have Python 3 already installed, just move on to the next section. Otherwise, follow these steps:

  1. Download Python 3 for your OS from the Python website. Latest version should be fine, but the CLI is tested with Python 3.7.4.
  2. Run the OS specific installer to install Python 3.
  3. Verify the installation by running following command on terminal.
$ python3 --version

Note: On Windows, use python --version to verify the installation.

Installing Dependencies

We will have to first install pip, which is a package installer for Python and then install the dependencies. Here are the steps:

Installing pip

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py

Note: On Windows, use python get-pip.py for pip installation.

Installing dependencies

$ cd /path/to/esp-rainmaker/cli/
$ pip3 install -r requirements.txt

Note: Using this utility requires ESP-IDF to be set up on your host machine. If it is not already done, please refer the ESP-IDF Get Started guide and ensure that the IDF_PATH is set correctly.

Adding the CLI to Your PATH (Optional) [For macOS and Linux Only]

The RainMaker CLI can be used from the esp-rainmaker-cli folder directly as below:

$ ./rainmaker.py <cmd>

However, if you want to allow using it from any path, add it to your PATH variable. The steps are as below:

  1. Open the ~/.bash_profile or ~/.profile file in an editor.
  2. Add export PATH=$PATH:/path/to/esp-rainmaker/cli line at the end.
  3. Save the .bash_profile or .profile file.
  4. Restart your terminal, or just execute $ source ~/.bash_profile or $ source ~/.profile as applicable.