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.
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
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.
The listed commands above are only a subset of all commands. More commands are available after logging in via the
Connecting to an Instance
1 2 3
> connect --uri http://localhost:8080 --username firstname.lastname@example.org --password password Connected. http://localhost:8080 > _
Managing an Instance
As of this writing, the CLI supports commands for managing the following features (type
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]
The CLI supports autocompletion. By typing
list- for example, the CLI will display matching commands that start with
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
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:
> connect --uri http://localhost:8080 --username email@example.com --password password bck-i-search: co_
You can press repeatedly to cycle through multiple matching commands.
All commands typed during the shell session are written to a log file named
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.
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 firstname.lastname@example.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:
$ java -jar toro-integrate-cli-client.jar @stop-packages.esb