Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Using the Command Line Interface

To allow remote management of TORO Integrate instances via the terminal, all editions ship with a command-line interface (CLI) tool.

Getting Started

Under the bin/ directory, run the CLI with:

1
2
3
4
5
6
7
8
9
$ java -jar toro-integrate-cli-client.jar
  _____ ___  ___  ___    ___     _                     _
 |_   _/ _ \| _ \/ _ \  |_ _|_ _| |_ ___ __ _ _ _ __ _| |_ ___
   | || (_) |   / (_) |  | || ' \  _/ -_) _` | '_/ _` |  _/ -_)
   |_| \___/|_|_\\___/  |___|_||_\__\___\__, |_| \__,_|\__\___|
                                        |___/
 :: CLI 3.0.0 ::
 :: Type `help` to get started.
> _

This launches a shell containing commands for managing TORO Integrate. To list available commands, type help.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
> help
  AVAILABLE COMMANDS

  Authentication Commands
          connect: Connects to an integrate instance.

  Built-In Commands
          clear: Clear the shell screen.
          exit, quit: Exit the shell.
          help: Display help about available commands.
          script: Read and execute commands from a file.
          stacktrace: Display the full stacktrace of the last error.

  License Commands
          export-license: Exports the currently installed license in this machine to a file.
          import-license: Imports a license from the provided file.
          install-license: Installs a license to this machine.
          license: Prints the currently installed license.
          product-key: Prints the product key for the installation.

More Commands

The listed commands above are only a subset of all commands. More commands are available after logging in via the connect command.

Connecting to an Instance

Assuming you already have a license installed, you can login to an integrate instance using your credentials from the Marketplace.

1
2
3
> connect --uri http://localhost:8080 --username you@your.org --password password
Connected.
http://localhost:8080 > _
When successful, the prompt changes to the URL of the instance you're currently connected to.

Managing an Instance

As of this writing, the CLI supports commands for managing the following features (type help again):

  • Broker
  • Database
  • Endpoint
  • License
  • Package
  • Properties
  • System

Display help text

To list the help on any command just type help, followed by the intended command.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
http://localhost:8080 > help start-package


NAME
    start-package - Starts a package.

SYNOPSYS
    start-package [--name] string

OPTIONS
    --name  string
        Name of the package to start.
        [Mandatory]

Autocompletion

The CLI supports autocompletion. By typing list- for example, the CLI will display matching commands that start with list-:

1
2
3
4
5
6
7
http://localhost:8080 > list-
Available commands
list-databases                     (Lists the available databases.)
list-destinations (Lists the available destinations in the broker.)
list-endpoints           (Lists the endpoints for a given package.)
list-packages                       (Lists the installed packages.)
list-properties                 (Lists the application properties.)

You may press again to choose a command from the selection.

1
2
3
4
5
6
7
http://localhost:8080 > list-packages
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━┓
┃Name              ┃Context Path       ┃Status ┃Enabled┃Version  ┃
┣━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━╋━━━━━━━╋━━━━━━━╋━━━━━━━━━┫
┃core              ┃                   ┃STARTED┃true   ┃3.0-ALPHA┃
┃examples          ┃/examples-features ┃STARTED┃true   ┃1        ┃
┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━━━┛

When in doubt, press

The CLI aims to be as ergonomic as possible. For example, typing stop-p shows:

1
2
  http://localhost:8080 > stop-package --name
  core                 examples

Reverse search is a terminal feature that allows users to easily find and execute previously typed commands. You can do this with the CLI as well by pressing .

For example, by typing co then pressing the CLI will suggest the previous command we used to connect:

1
2
> connect --uri http://localhost:8080 --username you@your.org --password password
bck-i-search: co_

You can press repeatedly to cycle through multiple matching commands.

Command History

All commands typed during the shell session are written to a log file named toro-integrate-cli.log located under the same directory where the CLI was ran. This is reused by the tool for reverse searches. Make sure that the log file is not publicly accessible.

Scripting

Automation is king! You can write scripts that contain series of commands that need to be executed sequentially by the CLI.

For example, consider this script file named stop-packages.esb, that stops a list of packages:

1
2
3
4
5
6
connect --uri http://localhost:8080 --username you@your.org --password password
stop-package --name examples-messaging
stop-package --name examples-reports
stop-package --name examples-services
list-packages
exit

Passing that as arguments to the CLI in the form of:

1
$ java -jar toro-integrate-cli-client.jar @stop-packages.esb

...produces:

stop-packages.esb