Skip to content

How to Execute Commands?

Commands can be manually executed by running Shell commands or scripts.

They can also be executed automatically, for example when you display a Docker container logs or when you run docker-compose.yml files or when you run load tests.

Many actions in Kraken trigger a command execution. In any case, the result is always displayed in the Command Executions Panel.

Shell Commands

Shell command execution is relative to a file path. So, in order to execute a shell command or script, select a file or folder in the Files Manager and open the contextual menu:

Execute Command Menu

Run a Shell Script

Simply click on Run script to execute a .sh file.

The script is automatically set as a executable file and executed.

You cannot pass arguments or environment variables this way (Use the Shell command launcher instead).

Info

The menu item is only visible if the selected file ends with the .sh extension.

Run a Shell Command

Click on the Execute command menu item to open the command execution dialog. The execution path is displayed at the top of the dialog.

Simple Mode

Use the simple mode to type your command in a single line:

Execute Command Simple Dialog

  1. Add eventual environment variables to the execution context,
  2. Click on Execute to run the command.

Warning

It may happen that running your command in simple mode do not work. In such case you may need to switch to advanced mode and prefix your command with /bin/sh and -c.

Advanced Mode

Use the advanced mode to type your command on multiple lines (one argument per line):

Execute Command Advanced Dialog

  1. Add eventual environment variables to the execution context,
  2. Click on Execute to run the command.

Command Executions

All command execution logs are visible in the Command executions panel at the bottom of the application.

Each command is visible in a dedicated tab:

Command Executions

To stop a command, click on the Stop Icon icon at right of the tab header.

Once the command has stopped, click on the Close Icon icon to close the tab.

Tip

Close all finished commands by right-clicking on the panel header, then on Close Finished Tasks Command Executions Contextual Menu

Note

Closing a Docker container logs command only stops streaming the container logs. It does not stop the container.