Overview Version History Q & A Rating & Review
A powerful VS Code extension for comparing Salesforce metadata between orgs with deep attribute-level analysis and an intuitive side-by-side diff viewer.
Features
✨ Deep Metadata Comparison
Compare CustomObjects, CustomFields, ApexClasses, Flows, Layouts, Profiles, and more
Attribute-level diff detection (field types, lengths, picklist values, method signatures, etc.)
Intelligent change detection for arrays (added/removed items in picklists, flow nodes, etc.)
🎨 Advanced Diff Viewer
Side-by-side comparison table for modified items
Expandable/collapsible panels for each metadata type
Color-coded highlighting (green = added, red = removed, yellow = modified)
Metadata type icons and change badges
⚡ Performance & Convenience
Local caching for faster repeat comparisons
Metadata type selection (choose what to compare)
Export results to JSON
Modern Salesforce CLI (sf) integration
Prerequisites
Installation
Clone this repository
Run npm install
Press F5 to run the extension in development mode
Usage
Authenticate to Salesforce
First, authenticate your orgs using Salesforce CLI:
sf org login web --alias myorg1
sf org login web --alias myorg2
Compare Orgs
Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
Run Metadata Comparator: Compare Orgs
Select source org
Select target org
View the diff results in the webview panel
Export Results
After comparing orgs, run Metadata Comparator: Export Diff Results
Choose a location to save the JSON file
Clear Cache
Run Metadata Comparator: Clear Cache to remove locally cached metadata.
Project Structure
metadata-comparator/
├── src/
│ ├── extension.ts # Main extension entry point
│ ├── services/
│ │ ├── sfdxService.ts # SFDX CLI integration
│ │ ├── compareService.ts # Metadata comparison logic
│ │ └── storageService.ts # Local cache management
│ ├── utils/
│ │ └── xmlParser.ts # XML to JSON conversion
│ └── webview/
│ └── diffViewer.ts # Webview UI generator
├── out/ # Compiled JavaScript
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── README.md # This file
✅ Custom Objects
✅ Custom Fields
✅ Apex Classes
✅ Apex Triggers
✅ Flows
✅ Page Layouts
✅ Profiles
✅ Permission Sets
✅ Validation Rules
✅ Workflow Rules
✅ Custom Tabs
Roadmap
[ ] Git-based comparison
[ ] Metadata API integration (as alternative to CLI)
[ ] Export to CSV/Excel
[ ] Deployment package generation from diff
[ ] Change history tracking
Development
Build
npm run compile
Watch Mode
npm run watch
Run Extension
Press F5 in VS Code to launch the extension development host.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
MIT