20th April 2007, updated:5th January 2025

CmdLinker

Tool to handle multiple command line programs

Description

CmdLinker is a quite simple program to execute multiple command-line programs, keeping them together in one only window.

It allows keeping those programs linked under a simple GUI, supporting operations like resetting the working programs, stopping all at once, etc.

CmdLinker is mainly useful to programmers and users who must spawn a set of non interactive command-line programs in order to achieve some predefined functionality.

For example, I use a proxy server, where I must setup two open virtual networks, and run a set of delegate scripts that allow me to forward network connections between the two virtual networks. Without CmdLinker, such setup requires opening 4 command line windows, where I execute the scripts that start the open virtual network connections, plus the scripts to run the delegate scripts that perform the network forwarding. Then , my desktop becomes cluttered with 4 windows or icons that are logically associated together!

CmdLinker allows me to keep those linked commands under one only window. It does not only improves my desktop, it improves my interaction with those programs, as I can stop all of them at once, or just restart them if needed.

The previous figure shows CmdLinker in action: each console/command application is run on its own tab window.

Version / Requirements

The current version of CmdLinker, is 0.9.8.

This is a rewrite I have done in 2025 over the initial version that I wrote in 2007; that year, this program turned out to be quite useful to me: I had to open several terminals and execute some scripts in parallel, and having multiple terminals were an added distraction. So I preferred the distraction of writing this Java program, and then forget about it for the best of 18 years.

License and download

CmdLinker is delivered as it, without any responsibilities on the author. It is open source, it can be used or modified without any limitations.

The program is provided in .jar format, or as a reference to the GitHub repository

Functionality

What can you do with CmdLinker? Mainly, just run sets of command line programs under a common, umbrella graphical interface:

  • Execute any command line program, that should not require any interaction.
  • Close/Terminate/Restart any running program.
  • Group programs: each group is shown on a separate CmdLinker window.
  • Typical GUI controls: apply specific background/foreground colors and fonts.
  • Good GUI interaction, using popup menus / menus when required.
  • Run specific CmdLinker scripts, detailed below.

Scripts

CmdLinker supports basic scripts to drive its operations; that is, it is possible to provide CmdLinker with a text script that instructs it to perform a set of basic operations:

  • Setup default colors and font.
  • Create a new console.
  • Apply specific colors and font to each console.
  • Execute a command line application.

The script is kept purposely simple. It is possible to execute any set of commands without knowing the specific script syntax. For example, the following script executes 3 different .sh scripts on 3 consoles:

EXECUTE /home/users/luismi/batch1.sh
EXECUTE /home/users/luismi/openvpn/asConnect.sh
EXECUTE /home/users/luismi/openvpn/viConnect.sh

Easy, not? This script could be customized as follows, to use specific font size, and different colors on each console:

FONT monospaced bold 12
TAB CheckConnection
FOREGROUND white
BACKGROUND black
EXECUTE /home/users/luismi/batch1.sh

TAB Basic connnction
FOREGROUND white
BACKGROUND blue
EXECUTE /home/users/luismi/openvpn/asConnect.sh
BACKGROUND cyan
EXECUTE /home/users/luismi/openvpn/viConnect.sh

Usage

Each tab displays the command being executed, and, if finished, and status line is added at the top. It is possible to check quickly the status of each command by the icon on the tab. The icons are:

  •  :  The command is still on execution
  •  :  The command has finalized, with error code 0
  •  :  The command has finalized, with error code differente from zero
  •  :  There was some error that prevented the execution of the command
  •  :  The user stopped the command execution

The program should be easily used through the intuitive graphical interface. It must be specifically noted that, to modify the font size and colors used by the program on each tab, it is needed to use the Options.. Display menu element. Changing the font size on the main window only modifies the font size of the tab console being displayed.

Under options, it is possible to specify whether to save the options or not. When saved, the options are kept among multiple program executions, including some default values, like last command executed, etc. In this case, a file with name cmdlinker.conf is stored in the home user directory.

Command line arguments

It is possible to provide CmdLinker with command line arguments:

  • -bg modifies the default background color. It can be provided as a well known color, like white, etc, or as a RGB value, using the notation #RRGGBB.
  • -fg modifies the default foreground color
  • -font modifies the font size. It expects, therefore, an integer, as the family font is always monospaced
  • -c expects one or more additional arguments, that specify the command to execute, and, optionally, the expected arguments. If provided, this must be the last argument
  • -check expects one additional argument, that specify the script to check

It is allowed to specify a script to execute by providing it as the last command line argument, if -c and -check are not specified

Uninstall

Uninstalling CmdLinkeris as easy as removing the associated jar file, and, if options where saved, the file .cmdlinker.conf stored in the home user directory; the easiest way to remove this file is by unsetting the checkbox Save options automatically in the File menu.