Sensedia CLI

Sensedia CLI (ssd) is Sensedia’s command line interface. It allows you to interact with Sensedia API Platform through the command line of a shell, creating and managing your APIs in an easier and quicker way.

Browse the menu on the left for information on the available commands. Below you will find helpful tips to get started with Sensedia CLI.

Quick start

How to Install Sensedia CLI

First Steps:
  • 1. Log into your Sensedia API Platform and click the profile button with your user name on the top-right corner of your screen. The “Edit Profile” menu will be displayed on the left.

  • 2. Under your e-mail address field, you will find the button Download CLI for your OS here. Follow the instructions to choose the file that is compatible with your OS. Read the instructions on this page for more information on Installing the Binary File.

  • 3. Right below the download field, you will also find the button CREATE CLI TOKEN.

After creating your CLI token, keep it safe in a place you can easily access whenever necessary. Remember that after you close the “Edit profile” menu, as a safety measure, your token number will be hidden by password masking, and you will not be able to display it again.
  • 4. While configuring Sensedia CLI, you will also need to use your manager URL sent by the Sensedia team. Learn How to Configure Sensedia CLI below.

how to install config

Installing the Binary File

Once the binary file is downloaded, you’ll only need a few steps to complete the installation:

Open a terminal window in the folder where the Sensedia CLI binary file is located and type the following command that allows the file to run:

# Changes the file permissions
$  chmod +x ssd

Then, this file will need to be moved, so it can be run in any folder where a terminal window is open. In order to do so, run the following command:

# Moves the file
$ sudo mv ssd /usr/local/bin

Now, your Sensedia CLI is ready to be used!

How to Configure Sensedia CLI

Open a terminal window and run the command ssd configure. The interactive mode will be activated and it will ask you the complete the following:

  • What is the URL of your API Platform?

    • Enter your organization’s API Platform (URL) address. E.g.: “manager-name.sensedia.com”

Remember to substitute the address “manager-name.sensedia.com” with your manager URL sent by the Sensedia team.
  • Please provide your Sensedia CLI Token:

    • Enter the token number you created in step 3.

  • Choose a default output for the CLI:

    • Here you should use the keyboard arrows to choose the file type you prefer.

  • Choose the product you want to use the CLI with.

    • Again, you should use the keyboard arrows to choose the product you want to use with the CLI.

A success message will appear after you complete these steps.

Getting help

You can get help directly from Sensedia CLI by typing:

# Shows the available commands and flags
$ ssd
$ ssd --help
$ ssd -h

By running Sensedia CLI without specifying any command, as shown above, you can see a list of all available commands.

You can also get help for a specific command by passing the flags -h or --help to the command. The following example shows how to get help for the create command:

ssd api-management create -h

This help mode provides a description of the operation the command performs and displays the flags that can be used with it. The create command must be followed by a subcommand, as indicated in the following snippet of the help text:

Usage:
  ssd api-management create [command]

By passing the help flag as shown above, you can also see a list of the subcommands available for that command.

It is also possible to get help for a specific subcommand, through the flags -h or --help:

ssd api-management create api -h

The example above displays help for the create api command.

Usage modes

Sensedia CLI supports two usage modes: direct mode and interactive mode.

In the direct mode, you enter the command completely, that is, including its flags and respective arguments on the same line, and then press the Enter key to execute it. Example:

ssd api-management create api "Tech Writer API" --path "/tech-writer-api/v1"

However, if you just type ssd followed by a command without flags and arguments and press the Enter key, the interactive mode will be activated. In this mode, questions are presented in sequence so that you can specify each argument of the required flags one by one.

To run the create api command through the interactive mode, for example, just type:

ssd api-management create api

When pressing the Enter key, the following questions will be presented in sequence:

index create api interactive
Running the 'create api' command through the interactive mode

For each question, specify the argument and press Enter. Questions corresponding to optional flags are indicated by the expression (OPTIONAL) before the question. Such questions can be skipped. Suggested arguments are indicated in parentheses after the question. To opt for the suggested argument, simply press the Enter key on your keyboard. Some questions present the possible arguments as options to be selected. Use the arrow keys on your keyboard to select the option you want and press Enter. You can also type a part of the desired option to filter it.

The interactive mode will only be enabled if no flag is specified at all.

If you choose to use the direct mode, you must specify all the required flags for the command. Otherwise, an error will be returned and the operation will not be executed.

Version

You can check the version of Sensedia CLI you are running by typing:

ssd version
Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]