Commands & Settings
Complete reference for all commands and configuration options in the MirthSync VS Code Extension.
Commands
Section titled “Commands”Most commands are accessible via the Command Palette (Ctrl+Shift+P). Some are only available from tree view context menus or the file explorer.
Connection Commands
Section titled “Connection Commands”| Command | Description |
|---|---|
MirthSync: Add Connection | Create a new server connection profile |
MirthSync: Edit Connection | Edit an existing connection profile |
MirthSync: Test Connection | Validate the selected connection’s credentials and reachability |
MirthSync: Connect | Establish a session with the selected server |
MirthSync: Disconnect | Close the active server session |
MirthSync: Set as Active Connection | Designate as the default connection for sync operations |
MirthSync: Clear Active Connection | Remove the active connection designation |
MirthSync: Remove Connection | Delete a connection profile |
MirthSync: Refresh Connections | Update the connections tree view from saved profiles |
Sync Commands
Section titled “Sync Commands”| Command | Description |
|---|---|
MirthSync: Pull All | Download all channels, code templates, and global scripts |
MirthSync: Push All | Upload all local changes to the active server |
Toggle Commands
Section titled “Toggle Commands”| Command | Description |
|---|---|
MirthSync: Toggle ConfigurationMap Inclusion | Include/exclude the ConfigMap during sync |
MirthSync: Toggle Force Sync | Enable/disable force overwrite on sync conflicts |
MirthSync: Toggle Deploy After Push | Enable/disable automatic channel deployment after push |
Utility Commands
Section titled “Utility Commands”| Command | Description |
|---|---|
MirthSync: Open Extension Settings | Open VS Code settings filtered to MirthSync configuration |
MirthSync: Show Output | Show the MirthSync output channel for debugging |
MirthSync: Refresh Channels | Refresh the Mirth Channels tree view from the server |
MirthSync: Refresh Templates | Refresh the Code Templates tree view from the server |
Git Commands
Section titled “Git Commands”| Command | Description |
|---|---|
MirthSync: Git Status | Display modified, added, and deleted files in the workspace |
MirthSync: Git Diff | Show a diff of all changes since the last commit |
Mirth CLI Commands
Section titled “Mirth CLI Commands”| Command | Description |
|---|---|
MirthSync: Deploy Channel | Activate a channel on the connected server |
MirthSync: Undeploy Channel | Deactivate a channel on the connected server |
MirthSync: Import Channel | Import a channel from a local file to the server |
MirthSync: Export Channel | Export a channel from the server to a local file |
MirthSync: Server Status | Display server health, version, and connection info |
Dev Container Commands
Section titled “Dev Container Commands”| Command | Description |
|---|---|
MirthSync: Initialize Local Mirth Environment | Scaffold .devcontainer/ config with Docker Compose for OIE |
MirthSync: Open in Dev Container | Reopen the workspace inside the dev container |
MirthSync: Show Mirth Logs | View Mirth server logs from the container |
MirthSync: Restart Mirth Service | Restart the Mirth service in the container |
MirthSync: Show Mirth Server Status | Check the container’s Mirth server health |
Tree View Context Commands
Section titled “Tree View Context Commands”These commands appear when you right-click items in the sidebar tree views:
| Context | Commands 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 group | Pull Channel, Push Channel |
| Code template / Template library | Pull Code Template Library, Push Code Template Library |
Settings
Section titled “Settings”Configure the extension in VS Code settings (Ctrl+,) or in your workspace .vscode/settings.json.
| Setting | Type | Default | Description |
|---|---|---|---|
mirthsync.mirthsyncPath | string | "" | Path to the mirthsync CLI executable. Leave empty for auto-detection. |
mirthsync.mirthcliPath | string | "" | Path to the Mirth CLI executable. |
mirthsync.defaultTimeout | number | 30000 | Timeout for sync operations in milliseconds. Increase for large configurations or slow connections. |
mirthsync.outputVerbosity | number | 1 | Output detail level (0–5). Higher values produce more detailed logs in the Output panel. |
mirthsync.autoSavePresets | boolean | true | Automatically save connection presets after successful operations. |
mirthsync.ignoreCertificateWarnings | boolean | false | Bypass SSL certificate validation warnings. Use only for self-signed certificates in development. |
mirthsync.javadocsUrl | string | "" | URL to Mirth Javadocs for IntelliSense API generation. |
mirthsync.forceSync | boolean | false | Force overwrite on sync conflicts. Bypasses remote change detection. |
mirthsync.promptForForce | boolean | true | Show a confirmation prompt before force-syncing. Only applies when forceSync is enabled. |
mirthsync.includeConfigurationMap | boolean | false | Include the ConfigurationMap during pull/push operations. |
mirthsync.deployAfterPush | boolean | false | Automatically deploy channels after a push operation completes. |
mirthsync.skipDisabled | boolean | false | Skip disabled channels during push operations. |
Example Workspace Settings
Section titled “Example Workspace Settings”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}Snippets
Section titled “Snippets”28 code snippets for Mirth JavaScript development. Type the prefix and press Tab to expand.
| Prefix | Name | Description |
|---|---|---|
cmput | Channel Map Put | channelMap.put('key', value) |
cmget | Channel Map Get | $c('key') |
gmput | Global Map Put | globalMap.put('key', value) |
gmget | Global Map Get | $g('key') |
gcmput | Global Channel Map Put | globalChannelMap.put('key', value) |
gcmget | Global Channel Map Get | $gc('key') |
logi | Logger Info | logger.info('message') |
logd | Logger Debug | logger.debug('message') |
loge | Logger Error | logger.error('message') |
logw | Logger Warn | logger.warn('message') |
trycatch | Try Catch | Try-catch block with logger.error |
dbquery | Database Query | Full DatabaseConnectionFactory pattern with query and close |
httpreq | HTTP Request | Java URL/URLConnection request with response reading |
fileread | File Read | FileUtil.read(path) |
filewrite | File Write | FileUtil.write(path, content, append) |
dateformat | Date Format | DateUtil.getCurrentDate(format) |
dateconvert | Date Convert | DateUtil.convertDate(from, to, string) |
route | Route Message | router.routeMessage(channelName, data) |
alert | Send Alert | alerts.sendAlert(message) |
xmlparse | XML Parse | E4X XML parsing |
jsonparse | JSON Parse | JSON.parse() |
jsonstringify | JSON Stringify | JSON.stringify() |
response | Create Response | ResponseFactory.getSuccess/Error/Sent/Queued/Filtered() |
foreach | For Each Loop | E4X-style for each (var item in collection) |
sendemail | SMTP Email | SMTPConnectionFactory pattern |
getraw | Get Raw Data | msg.getRawData() |
settrans | Set Transformed Data | connectorMessage.setTransformedData() |
hl7seg | HL7 Segment Access | msg['PID']['PID.5']['PID.5.1'].toString() |
msgid | Message ID | msg.getMessageId() |
Diagnostics
Section titled “Diagnostics”14 built-in linting rules run in real-time as you edit. No configuration required.
| Rule ID | Severity | Description |
|---|---|---|
mirth-sql-injection | Warning | String concatenation in SQL query execution using map values |
mirth-eval | Warning | Usage of dangerous eval() function |
mirth-hardcoded-password | Warning | Hardcoded credentials (password, secret, apikey) in source |
mirth-file-path-traversal | Warning | User-provided map values in new File() operations |
mirth-msg-immutable | Error | Modifying the immutable msg object |
mirth-deprecated-co | Warning | Deprecated $co shortcut |
mirth-deprecated-serializer | Warning | Deprecated SerializerFactory API |
mirth-filter-return | Hint | Filter scripts without explicit return true/false |
mirth-map-null-check | Hint | Map values used without null checking |
mirth-potential-infinite-loop | Warning | while(true) without visible break condition |
mirth-logger-inefficient | Hint | String concatenation in logger calls |
mirth-fileutil-no-try | Hint | FileUtil operations without try-catch |
mirth-xmlutil-performance | Hint | XMLUtil.prettyPrint on raw message data |
mirth-undefined-global | Hint | Map object referenced without .get() or .put() call |
Troubleshooting
Section titled “Troubleshooting”Extension Not Loading
Section titled “Extension Not Loading”Symptoms: No tree views in the sidebar, no status bar indicators.
- Check VS Code version:
Help → About— must be 1.85.0+ - Check the extension is enabled:
Ctrl+Shift+X→ search “MirthSync” → verify Enabled - Check the Output panel:
View → Output→ select MirthSync from the dropdown - Reload the window:
Ctrl+Shift+P→Developer: Reload Window
CLI Not Found
Section titled “CLI Not Found”Symptoms: “mirthsync not found” errors when running sync commands.
- Verify CLI is installed:
mirthsync --versionin the terminal - Set the path explicitly in settings:
{"mirthsync.mirthsyncPath": "/usr/local/bin/mirthsync"}
- On Windows, use the full path including
.cmdextension if needed
Connection Failures
Section titled “Connection Failures”Symptoms: “Connection refused” or timeout errors.
- Verify the server URL format:
https://hostname:8443/api - Test network connectivity:
curl -k https://hostname:8443/api/server/version - Check credentials with
MirthSync: Test Connection - For self-signed certificates, enable
mirthsync.ignoreCertificateWarnings(development only) - Increase
mirthsync.defaultTimeoutfor slow networks
Sync Conflicts
Section titled “Sync Conflicts”Symptoms: Push fails with conflict errors.
- Pull the latest server state first:
MirthSync: Pull All - Review differences with
MirthSync: Git Diff - 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
- Push again
IntelliSense Not Working
Section titled “IntelliSense Not Working”Symptoms: No autocomplete suggestions for Mirth APIs.
- Ensure you’re editing a JavaScript block within a Mirth channel XML file
- Check if
mirthsync.javadocsUrlis set for your Mirth version - Reload the window after changing IntelliSense settings
Mirth CLI Not Found
Section titled “Mirth CLI Not Found”Symptoms: “mirth-cli not found” errors when running deploy, undeploy, import, export, or server status commands.
- Set the
MIRTH_HOMEenvironment variable to your Mirth Connect installation directory - Or set the path explicitly in settings:
{"mirthsync.mirthcliPath": "/opt/mirth/cli/mirth-cli"}
- 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
- Linux: