MDAPI Diff
Professional Salesforce metadata comparison tool for VS Code. Compare individual files or entire folders against your Salesforce org with side-by-side diffs, a tree view for folder results, and one-click apply.
Features
- Single File Diff: Right-click any metadata file to compare with the org version
- Folder Diff: Compare an entire folder against the org — results displayed in an interactive tree view
- Tree View Panel: Browse folder diff results grouped by status (Added/Modified/Removed/Unchanged) or metadata type, with filter and search
- Apply Org Changes: One-click to pull the org version down to your local file, with automatic backup
- Export Reports: Export folder diff results as JSON, CSV, or a text summary
- XML Normalization: Sorts XML elements, strips volatile attributes (timestamps, user refs), and normalizes whitespace to reduce false-positive diffs — especially useful for Profiles and Permission Sets
- Smart Org Detection: Automatically finds the Salesforce CLI even when VS Code doesn't inherit your shell PATH
- Private Files: Org content stays in memory via virtual documents — never written to disk
- Cancellation Support: Cancel any long-running operation with ESC; temp files, CLI processes, and virtual documents are cleaned up automatically
- Smart Caching: Caches the connected org list to reduce CLI calls
160+ Salesforce metadata types including:
- Apex Classes, Triggers, Pages, Components
- Custom Objects, Fields, Validation Rules
- Flows, Workflows, Approval Processes
- Profiles, Permission Sets, Permission Set Groups
- Layouts, Flexipages, Lightning Web Components, Aura
- Reports, Dashboards, Email Templates
- Named Credentials, Connected Apps, Auth Providers
- And many more — plus source-format
-meta.xml files
Getting Started
- Install the extension from the VS Code Marketplace
- Open a Salesforce project in VS Code
- Authenticate with your org:
sf org login web
- Single file: Right-click any metadata file → MDAPI Diff
- Folder: Right-click any folder → MDAPI Diff: Compare Folder with Org
Requirements
Commands
| Command |
Description |
| MDAPI Diff |
Compare a local file with its org version |
| MDAPI Diff: Compare Folder with Org |
Compare all metadata in a folder against the org |
| Select Salesforce Org |
Choose which org to compare against |
| Refresh Connected Orgs |
Re-fetch the list of authenticated orgs |
| Toggle Tree Grouping |
Switch folder diff tree between status and type grouping |
| Toggle Changed Only |
Show only modified/added/removed components in the tree |
| Export Diff Report |
Export folder diff results (JSON / CSV / Summary) |
| Apply All Org Changes to Local |
Batch-apply all org versions to local files |
Extension Settings
| Setting |
Default |
Description |
mdapiDiff.enabled |
true |
Enable/disable the extension |
mdapiDiff.apiVersion |
62.0 |
Salesforce API version |
mdapiDiff.ignoreWhitespace |
true |
Ignore whitespace in diffs |
mdapiDiff.normalizeXml |
true |
Normalize XML for cleaner diffs |
mdapiDiff.removeVolatileElements |
true |
Strip timestamps/user refs from comparisons |
mdapiDiff.sortXmlElements |
true |
Sort XML elements for stable comparison |
mdapiDiff.createBackups |
true |
Create backups before applying org changes |
mdapiDiff.enableCancellation |
true |
Enable cancellation for long operations |
mdapiDiff.autoSelectSingleOrg |
true |
Auto-select when only one org is connected |
mdapiDiff.orgCacheDuration |
300000 |
Org list cache duration (ms) |
mdapiDiff.folderDiff.maxConcurrency |
3 |
Max concurrent chunk retrievals |
mdapiDiff.folderDiff.chunkSize |
10 |
Components per retrieval chunk |
mdapiDiff.folderDiff.inclusiveMode |
false |
Include org-only components (slower) |
mdapiDiff.logLevel |
INFO |
Log level (DEBUG, INFO, WARN, ERROR) |
Release Notes
1.1.1
- Fix org selection failing for users whose VS Code doesn't inherit shell PATH
- Fix parsing of new SF CLI format (
sf org list returning flat array)
- Filter out orgs with expired/revoked tokens instead of showing them
- Improved error messages with actual CLI output instead of generic text
- Fixed Report Issue URL
1.1.0
- Folder diff with interactive tree view (group by status or type)
- XML normalization: sort elements, remove volatile attributes, normalize whitespace
- Export diff reports (JSON, CSV, Summary)
- Batch apply org changes
- Component classification (Added / Modified / Removed / Unchanged)
- Chunked retrieval with configurable concurrency
1.0.5
- Initial release with single-file diff, org selection, cancellation support
Enjoy comparing your Salesforce metadata!
| |