Skip to content
Contact Us

Commands & Settings

Complete reference for all commands and configuration options in the MirthSync VS Code Extension.


Most commands are accessible via the Command Palette (Ctrl+Shift+P). Some are only available from tree view context menus or the file explorer.

CommandDescription
MirthSync: Add ConnectionCreate a new server connection profile
MirthSync: Edit ConnectionEdit an existing connection profile
MirthSync: Test ConnectionValidate the selected connection’s credentials and reachability
MirthSync: ConnectEstablish a session with the selected server
MirthSync: DisconnectClose the active server session
MirthSync: Set as Active ConnectionDesignate as the default connection for sync operations
MirthSync: Clear Active ConnectionRemove the active connection designation
MirthSync: Remove ConnectionDelete a connection profile
MirthSync: Refresh ConnectionsUpdate the connections tree view from saved profiles
CommandDescription
MirthSync: Pull AllDownload all channels, code templates, and global scripts
MirthSync: Push AllUpload all local changes to the active server
CommandDescription
MirthSync: Toggle ConfigurationMap InclusionInclude/exclude the ConfigMap during sync
MirthSync: Toggle Force SyncEnable/disable force overwrite on sync conflicts
MirthSync: Toggle Deploy After PushEnable/disable automatic channel deployment after push
CommandDescription
MirthSync: Open Extension SettingsOpen VS Code settings filtered to MirthSync configuration
MirthSync: Show OutputShow the MirthSync output channel for debugging
MirthSync: Refresh ChannelsRefresh the Mirth Channels tree view from the server
MirthSync: Refresh TemplatesRefresh the Code Templates tree view from the server
CommandDescription
MirthSync: Git StatusDisplay modified, added, and deleted files in the workspace
MirthSync: Git DiffShow a diff of all changes since the last commit
CommandDescription
MirthSync: Deploy ChannelActivate a channel on the connected server
MirthSync: Undeploy ChannelDeactivate a channel on the connected server
MirthSync: Import ChannelImport a channel from a local file to the server
MirthSync: Export ChannelExport a channel from the server to a local file
MirthSync: Server StatusDisplay server health, version, and connection info
CommandDescription
MirthSync: Initialize Local Mirth EnvironmentScaffold .devcontainer/ config with Docker Compose for OIE
MirthSync: Open in Dev ContainerReopen the workspace inside the dev container
MirthSync: Show Mirth LogsView Mirth server logs from the container
MirthSync: Restart Mirth ServiceRestart the Mirth service in the container
MirthSync: Show Mirth Server StatusCheck the container’s Mirth server health

These commands appear when you right-click items in the sidebar tree views:

ContextCommands Available
Connection (disconnected)Connect, Test Connection, Set as Active, Edit, Remove
Connection (connected)Disconnect, Test Connection, Edit, Remove
Connection (active + connected)Pull All, Push All, Disconnect, Test Connection, Edit, Remove
Channel / Channel groupPull Channel, Push Channel
Code template / Template libraryPull Code Template Library, Push Code Template Library

Configure the extension in VS Code settings (Ctrl+,) or in your workspace .vscode/settings.json.

SettingTypeDefaultDescription
mirthsync.mirthsyncPathstring""Path to the mirthsync CLI executable. Leave empty for auto-detection.
mirthsync.mirthcliPathstring""Path to the Mirth CLI executable.
mirthsync.defaultTimeoutnumber30000Timeout for sync operations in milliseconds. Increase for large configurations or slow connections.
mirthsync.outputVerbositynumber1Output detail level (0–5). Higher values produce more detailed logs in the Output panel.
mirthsync.autoSavePresetsbooleantrueAutomatically save connection presets after successful operations.
mirthsync.ignoreCertificateWarningsbooleanfalseBypass SSL certificate validation warnings. Use only for self-signed certificates in development.
mirthsync.javadocsUrlstring""URL to Mirth Javadocs for IntelliSense API generation.
mirthsync.forceSyncbooleanfalseForce overwrite on sync conflicts. Bypasses remote change detection.
mirthsync.promptForForcebooleantrueShow a confirmation prompt before force-syncing. Only applies when forceSync is enabled.
mirthsync.includeConfigurationMapbooleanfalseInclude the ConfigurationMap during pull/push operations.
mirthsync.deployAfterPushbooleanfalseAutomatically deploy channels after a push operation completes.
mirthsync.skipDisabledbooleanfalseSkip disabled channels during push operations.

A recommended .vscode/settings.json for team projects:

{
"mirthsync.defaultTimeout": 60000,
"mirthsync.outputVerbosity": 2,
"mirthsync.ignoreCertificateWarnings": false,
"mirthsync.includeConfigurationMap": false,
"mirthsync.deployAfterPush": false,
"mirthsync.skipDisabled": true
}

28 code snippets for Mirth JavaScript development. Type the prefix and press Tab to expand.

PrefixNameDescription
cmputChannel Map PutchannelMap.put('key', value)
cmgetChannel Map Get$c('key')
gmputGlobal Map PutglobalMap.put('key', value)
gmgetGlobal Map Get$g('key')
gcmputGlobal Channel Map PutglobalChannelMap.put('key', value)
gcmgetGlobal Channel Map Get$gc('key')
logiLogger Infologger.info('message')
logdLogger Debuglogger.debug('message')
logeLogger Errorlogger.error('message')
logwLogger Warnlogger.warn('message')
trycatchTry CatchTry-catch block with logger.error
dbqueryDatabase QueryFull DatabaseConnectionFactory pattern with query and close
httpreqHTTP RequestJava URL/URLConnection request with response reading
filereadFile ReadFileUtil.read(path)
filewriteFile WriteFileUtil.write(path, content, append)
dateformatDate FormatDateUtil.getCurrentDate(format)
dateconvertDate ConvertDateUtil.convertDate(from, to, string)
routeRoute Messagerouter.routeMessage(channelName, data)
alertSend Alertalerts.sendAlert(message)
xmlparseXML ParseE4X XML parsing
jsonparseJSON ParseJSON.parse()
jsonstringifyJSON StringifyJSON.stringify()
responseCreate ResponseResponseFactory.getSuccess/Error/Sent/Queued/Filtered()
foreachFor Each LoopE4X-style for each (var item in collection)
sendemailSMTP EmailSMTPConnectionFactory pattern
getrawGet Raw Datamsg.getRawData()
settransSet Transformed DataconnectorMessage.setTransformedData()
hl7segHL7 Segment Accessmsg['PID']['PID.5']['PID.5.1'].toString()
msgidMessage IDmsg.getMessageId()

14 built-in linting rules run in real-time as you edit. No configuration required.

Rule IDSeverityDescription
mirth-sql-injectionWarningString concatenation in SQL query execution using map values
mirth-evalWarningUsage of dangerous eval() function
mirth-hardcoded-passwordWarningHardcoded credentials (password, secret, apikey) in source
mirth-file-path-traversalWarningUser-provided map values in new File() operations
mirth-msg-immutableErrorModifying the immutable msg object
mirth-deprecated-coWarningDeprecated $co shortcut
mirth-deprecated-serializerWarningDeprecated SerializerFactory API
mirth-filter-returnHintFilter scripts without explicit return true/false
mirth-map-null-checkHintMap values used without null checking
mirth-potential-infinite-loopWarningwhile(true) without visible break condition
mirth-logger-inefficientHintString concatenation in logger calls
mirth-fileutil-no-tryHintFileUtil operations without try-catch
mirth-xmlutil-performanceHintXMLUtil.prettyPrint on raw message data
mirth-undefined-globalHintMap object referenced without .get() or .put() call

Symptoms: No tree views in the sidebar, no status bar indicators.

  1. Check VS Code version: Help → About — must be 1.85.0+
  2. Check the extension is enabled: Ctrl+Shift+X → search “MirthSync” → verify Enabled
  3. Check the Output panel: View → Output → select MirthSync from the dropdown
  4. Reload the window: Ctrl+Shift+PDeveloper: Reload Window

Symptoms: “mirthsync not found” errors when running sync commands.

  1. Verify CLI is installed: mirthsync --version in the terminal
  2. Set the path explicitly in settings:
    {
    "mirthsync.mirthsyncPath": "/usr/local/bin/mirthsync"
    }
  3. On Windows, use the full path including .cmd extension if needed

Symptoms: “Connection refused” or timeout errors.

  1. Verify the server URL format: https://hostname:8443/api
  2. Test network connectivity: curl -k https://hostname:8443/api/server/version
  3. Check credentials with MirthSync: Test Connection
  4. For self-signed certificates, enable mirthsync.ignoreCertificateWarnings (development only)
  5. Increase mirthsync.defaultTimeout for slow networks

Symptoms: Push fails with conflict errors.

  1. Pull the latest server state first: MirthSync: Pull All
  2. Review differences with MirthSync: Git Diff
  3. If you’re sure your local changes should win, enable force sync:
    • Click the Force indicator in the status bar, or
    • Run MirthSync: Toggle Force Sync
  4. Push again

Symptoms: No autocomplete suggestions for Mirth APIs.

  1. Ensure you’re editing a JavaScript block within a Mirth channel XML file
  2. Check if mirthsync.javadocsUrl is set for your Mirth version
  3. Reload the window after changing IntelliSense settings

Symptoms: “mirth-cli not found” errors when running deploy, undeploy, import, export, or server status commands.

  1. Set the MIRTH_HOME environment variable to your Mirth Connect installation directory
  2. Or set the path explicitly in settings:
    {
    "mirthsync.mirthcliPath": "/opt/mirth/cli/mirth-cli"
    }
  3. The extension checks these paths automatically:
    • Linux: /opt/mirth/cli/mirth-cli, /usr/local/mirth/cli/mirth-cli, /opt/mirthconnect/cli/mirth-cli
    • macOS: /Applications/Mirth Connect/cli/mirth-cli, /opt/mirth/cli/mirth-cli
    • Windows: C:\Program Files\Mirth Connect\cli\mirth-cli.bat, C:\Program Files (x86)\Mirth Connect\cli\mirth-cli.bat