Install MirthSync CLI
Installing MirthSync CLI
Section titled “Installing 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.
Prerequisites
Section titled “Prerequisites”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
macOS Additional Requirements
Section titled “macOS Additional Requirements”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:
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"Installation
Section titled “Installation”Option 1: npm
Section titled “Option 1: npm”If you have Node.js, this installs a mirthsync command on your PATH (Java is still required to run it):
npm install -g @saga-it/mirthsyncmirthsync -VOption 2: Release archive
Section titled “Option 2: Release archive”- Go to the releases page
- Download
mirthsync-X.X.X.zip(or.tar.gz) for the latest release - Extract it to a convenient location (e.g.,
/opt/mirthsync/orC:\mirthsync\)
The archive contains the launch scripts in bin/ (mirthsync.sh, mirthsync.bat) and the jar in lib/:
curl -L -o mirthsync.zip https://github.com/SagaHealthcareIT/mirthsync/releases/download/3.8.0/mirthsync-3.8.0.zipunzip mirthsync.zip./mirthsync-3.8.0/bin/mirthsync.sh -VThe 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.
Install from Source
Section titled “Install from Source”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
# Clone the repositorygit clone https://github.com/SagaHealthcareIT/mirthsync.gitcd mirthsync
# Build the standalone JARlein uberjar
# The JAR will be in target/uberjar/mirthsync-X.X.X-standalone.jarjava -jar target/uberjar/mirthsync-*-standalone.jar -hConfiguration
Section titled “Configuration”MirthSync needs connection details for your Mirth Connect or OIE server. Connection parameters are passed via command-line flags:
| Flag | Description |
|---|---|
-s | Server URL (e.g., https://mirth.example.com:8443/api) |
-u | Username |
-p | Password (or use MIRTHSYNC_PASSWORD environment variable) |
-t | Target directory for configuration files |
-i | Ignore certificate errors (for self-signed certs) |
Example pull command:
# Using password flagjava -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=yourpasswordjava -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config pullVerify Installation
Section titled “Verify Installation”Test that MirthSync can connect to your server by pulling configurations:
export MIRTHSYNC_PASSWORD=adminjava -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config -i pullIf successful, you’ll see output showing channels and code templates being downloaded to your target directory.
Troubleshooting
Section titled “Troubleshooting”Java not found
Section titled “Java not found”If you get java: command not found:
- Install Java JRE or JDK 11 or higher
- Verify installation:
java -version - Ensure Java is in your PATH
Connection errors
Section titled “Connection errors”If you can’t connect to Mirth Connect:
- Verify the server URL includes the
/apipath - Check that Mirth Connect is running
- Ensure the API port (usually 8443) is accessible
- Verify your username and password
- Try adding the
-iflag to ignore certificate errors
SSL Certificate Errors
Section titled “SSL Certificate Errors”If you see SSL/TLS certificate errors:
Self-signed certificates:
# Use the -i flag to ignore certificate validationjava -jar mirthsync.jar -s https://mirth.example.com:8443/api -u admin -t ./mirth-config -i pullProper solution for production:
- Install your organization’s root CA certificate
- Use a properly signed certificate for Mirth Connect/OIE
Firewall or Network Issues
Section titled “Firewall or Network Issues”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/apishould respond - Check firewall: Ensure port 8443 is open between your machine and the server
- VPN required? Some organizations require VPN to access Mirth servers