Skip to content

Install MirthSync CLI

MirthSync installs in minutes on Windows, macOS, and Linux. The CLI includes built-in Git commands, so you can start version controlling your Mirth Connect or OIE configurations without installing anything else.

Before you install MirthSync, make sure you have:

  • Java JRE or JDK version 11 or higher (Java 11, 17, 21, and later LTS versions are supported). MirthSync 3.2 and later bundle a Git library built for Java 11, so they do not start on Java 8.

Additionally:

  • Mirth Connect 4.x or Open Integration Engine (OIE) 3.x/4.x - The integration platform you want to version control
    • ✅ Recommended: Open Integration Engine (OIE) - the community-driven open-source fork
    • ✅ Legacy open-source Mirth Connect 4.x
    • ⚠️ Commercial Mirth Connect versions - compatibility not guaranteed

When using MirthSync on macOS, you’ll also need:

  • coreutils - brew install coreutils
  • gnu-sed - brew install gnu-sed

After installing, add to your PATH in ~/.zshrc or ~/.bash_profile:

Terminal window
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"

If you have Node.js, this installs a mirthsync command on your PATH (Java is still required to run it):

Terminal window
npm install -g @saga-it/mirthsync
mirthsync -V
  1. Go to the releases page
  2. Download mirthsync-X.X.X.zip (or .tar.gz) for the latest release
  3. Extract it to a convenient location (e.g., /opt/mirthsync/ or C:\mirthsync\)

The archive contains the launch scripts in bin/ (mirthsync.sh, mirthsync.bat) and the jar in lib/:

Terminal window
curl -L -o mirthsync.zip https://github.com/SagaHealthcareIT/mirthsync/releases/download/3.8.0/mirthsync-3.8.0.zip
unzip mirthsync.zip
./mirthsync-3.8.0/bin/mirthsync.sh -V

The examples on these pages use java -jar mirthsync.jar. That is the same jar, from lib/mirthsync-X.X.X-standalone.jar, copied or renamed.

Use this method if you:

  • Want to contribute to MirthSync development
  • Need unreleased features from the main branch
  • Want to customize MirthSync for your environment

Prerequisites for source installation:

  • Git
  • Leiningen (Clojure build tool)
  • Java JDK 11 or higher
Terminal window
# Clone the repository
git clone https://github.com/SagaHealthcareIT/mirthsync.git
cd mirthsync
# Build the standalone JAR
lein uberjar
# The JAR will be in target/uberjar/mirthsync-X.X.X-standalone.jar
java -jar target/uberjar/mirthsync-*-standalone.jar -h

MirthSync needs connection details for your Mirth Connect or OIE server. Connection parameters are passed via command-line flags:

FlagDescription
-sServer URL (e.g., https://mirth.example.com:8443/api)
-uUsername
-pPassword (or use MIRTHSYNC_PASSWORD environment variable)
-tTarget directory for configuration files
-iIgnore certificate errors (for self-signed certs)

Example pull command:

Terminal window
# Using password flag
java -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -p yourpassword -t ./mirth-config pull
# Using environment variable for password (recommended)
export MIRTHSYNC_PASSWORD=yourpassword
java -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pull

Test that MirthSync can connect to your server by pulling configurations:

Terminal window
export MIRTHSYNC_PASSWORD=admin
java -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config -i pull

If successful, you’ll see output showing channels and code templates being downloaded to your target directory.


If you get java: command not found:

  1. Install Java JRE or JDK 11 or higher
  2. Verify installation: java -version
  3. Ensure Java is in your PATH

If you can’t connect to Mirth Connect:

  • Verify the server URL includes the /api path
  • Check that Mirth Connect is running
  • Ensure the API port (usually 8443) is accessible
  • Verify your username and password
  • Try adding the -i flag to ignore certificate errors

If you see SSL/TLS certificate errors:

Self-signed certificates:

Terminal window
# Use the -i flag to ignore certificate validation
java -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config -i pull

Proper solution for production:

  • Install your organization’s root CA certificate
  • Use a properly signed certificate for Mirth Connect/OIE

If the connection times out:

  • Check server is running: Open Admin Console to verify Mirth/OIE is up
  • Verify API port: Default is 8443, confirm in your server settings
  • Test network access: curl https://mirth.example.com:8443/api should respond
  • Check firewall: Ensure port 8443 is open between your machine and the server
  • VPN required? Some organizations require VPN to access Mirth servers