web stats
Mirth Shell Commands - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 10-17-2016, 12:33 PM
dre4967 dre4967 is offline
OBX.2 Kenobi
Join Date: Mar 2011
Posts: 64
dre4967 is on a distinguished road
Default Mirth Shell Commands

I'm looking online to get a lit of Mirth Shell commands and I'm referencing this site below. The version of Mirth says 1.8 for these shell commands and didn't know if there was any updates to this document.


Also per documentation I don't see a command to import a channel group or import code templates, does Mirth have the ability to import these configs via shell command.

Mirth Version
Webservice to the end, Mirth
Reply With Quote
Old 10-17-2016, 01:26 PM
ahart ahart is offline
OBX.2 Kenobi
Join Date: Oct 2014
Posts: 56
ahart is on a distinguished road

I also have not found the latest official mirth-cli list of commands, however there is a help command that you can execute inside the mirth-cli.
To import a code library, it is:
codetemplate library import "{LOCALDRIVE}\Mirth\channels\General Library.xml" force
The "library" is optional, so you can still import scripts not in a library. Substitute between the quote characters the fully qualified path to your file.

Groups cannot be imported via the cli. Narupley stated it could be done via the web service interface, but I didn't figure that out in the time I spent on it. I've been intending to revisit it.

Last edited by ahart; 10-17-2016 at 02:36 PM.
Reply With Quote
Old 10-18-2016, 07:34 AM
dre4967 dre4967 is offline
OBX.2 Kenobi
Join Date: Mar 2011
Posts: 64
dre4967 is on a distinguished road

Thanks ahart for the info.
Webservice to the end, Mirth
Reply With Quote
Old 10-20-2019, 09:26 PM
stormcel stormcel is offline
OBX.3 Kenobi
Join Date: Mar 2010
Location: Phoenix
Posts: 173
stormcel is on a distinguished road

2 years later, here is the Mirth Shell commands from the help list for 3.4:
java -jar mirth-cli-launcher.jar -ahttps://localhost:8443 -uusername -ppassword
Connected to Mirth Connect server @ https://localhost:8443 (
Available Commands:
        Returns status of deployed channels

deploy [timeout]
        Deploys all Channels with optional timeout (in seconds)

import "path" [force]
        Imports channel specified by <path>.  Optional 'force' overwrites existing channels.

export id|"name"|* "path"
        Exports the specified channel to <path>

importcfg "path" [nodeploy]
        Imports configuration specified by <path>.  Optional 'nodeploy' stops channels from being deployed after importing.

exportcfg "path"
        Exports the configuration to <path>

importalert "path" [force]
        Imports alert specified by <path>.  Optional 'force' overwrites existing alerts.

exportalert id|"name"|* "path"
        Exports the specified alert to <path>

importscripts "path"
        Imports global script specified by <path>

exportscripts "path"
        Exports global script to <path>

codetemplate library list [includecodetemplates]
        Lists all code template libraries. Optional 'includecodetemplates' additionally lists the code templates within each library.

codetemplate list
        Lists all code templates.

codetemplate [library] import path [force]
        Imports code templates or libraries (with the 'library' option).

codetemplate library export id|name|* path
        Exports all matched code template libraries to <path>.

codetemplate export id|name path
        Exports a single code template to <path>.

codetemplate library remove id|name|*
        Removes all matched code template libraries.

codetemplate remove id|name
        Removes a single code template.

importmessages "path" id
        Imports messages specified by <path> into the channel specified by <id>

exportmessages "path/file-pattern" id [xml|xml-attach|raw|processedraw|transformed|encoded|response] [pageSize]
        Exports all messages for channel specified by <id> to <path>

importmap "path"
        Imports configuration map specified by <path>

exportmap "path"
        Exports configuration map to <path>

channel undeploy|deploy|start|stop|halt|pause|resume|stats id|"name"|*
        Performs specified channel action

channel remove|enable|disable id|"name"|*
        Remove, enable or disable specified channel

channel list
        Lists all Channels

        Removes all messages from all Channels (running channels will be restarted)

resetstats [lifetime]
        Removes all stats from all Channels. Optional 'lifetime' includes resetting lifetime stats.

dump stats|events "path"
        Dumps stats or events to specified file

user list
        Returns a list of the current users

user add username "password" "firstName" "lastName" "organization" "email"
        Adds the specified user

user remove id|username
        Removes the specified user

user changepw id|username "newpassword"
        Changes the specified user's password

        Quits Mirth Connect Shell
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 12:46 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation