In addition to the graphical Mirth Administrator, Mirth provides a command line interface known as the Mirth Shell. The Mirth Shell is a small java program which for a default installation can be executed as:
java -jar shell-launcher.jar shell-launcher.xml -a https://127.0.0.1:8443 -u admin -p admin -v 0.0.0
In 2.1, the file names have changed and so the program should be executed as:
java -jar mirth-cli-launcher.jar -a https://127.0.0.1:8443 -u admin -p admin -v 0.0.0
Note that the xml file is no longer needed - in 1.8.2, that file contained jar classpaths of needed libraries.
The available command line options for the shell are:
-a url | Specifics the URL to be used to connect to Mirth Server (required). |
-u username | Specifies the login username for Mirth Server (required). |
-p password | Specifies the login password for Mirth Server (required). |
-v version | Specifies the version of Mirth Shell being used (required). Use 0.0.0 to ignore this property. |
-s file | Specifies a script file pathname to be read for commands to be executed. The shell exits after the last command in the file is executed. If the -s option is not specified, the shell enters interactive mode and presents a prompt to manually enter commands (optional). |
-h | Causes the shell to display a short summary of the available command line options and immediately exit. |
Here's a simple example to load some channels:
- Create a text file with some channels you'd like to load. Ex:
import "/pathToFile/Tester.xml"
import "/pathToFile/Tester 2.xml"
import "/pathToFile/Tester 3.xml"
- Save the file with whatever name you wish, we'll call it import.txt in this case.
- Open a terminal or command prompt and go to your Mirth Connect installation directory.
- Run this command: java -jar shell-launcher.jar shell-launcher.xml -a https://127.0.0.1:8443 -u admin -p admin -v 0.0.0 -s "/pathToFile/import.txt"
You should see output similar to the following:
Connected to Mirth Connect server @ https://127.0.0.1:8443 (1.8.2.4472)
Executing statement: import "/pathToFile/Tester.xml"
Channel 'Tester' imported successfully.
Executing statement: import "/pathToFile/Tester 2.xml"
Channel 'Tester 2' imported successfully.
Executing statement: import "/pathToFile/Tester 3.xml"
Channel 'Tester 3' imported successfully.
Disconnected from server.- Verify the channels were loaded in your Mirth Connect instance.


