https://github.com/amtrack/metadata-xml-tool
CLI tool for processing Salesforce Metadata XML files
https://github.com/amtrack/metadata-xml-tool
cli metadata salesforce sfdx
Last synced: 5 months ago
JSON representation
CLI tool for processing Salesforce Metadata XML files
- Host: GitHub
- URL: https://github.com/amtrack/metadata-xml-tool
- Owner: amtrack
- License: mit
- Created: 2018-01-25T14:48:40.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-12-31T14:30:04.000Z (6 months ago)
- Last Synced: 2026-01-04T22:30:15.102Z (6 months ago)
- Topics: cli, metadata, salesforce, sfdx
- Language: Shell
- Size: 65.4 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metadata-xml-tool
> CLI tool for processing Salesforce Metadata XML files
[](https://github.com/amtrack/metadata-xml-tool/actions)
## Installation
```console
$ npm install -g metadata-xml-tool
```
## Usage
```text
metadata-xml-tool.
Usage:
metadata-xml-tool [options]
Commands:
remove-element [file]...
remove-element-matching [file]...
replace-tag-value [file]...
Options:
-h --help Show help
```
## Examples
`$ metadata-xml-tool remove-element validationRules src/objects/Account.object`
```diff
diff --git a/src/objects/Account.object b/src/objects/Account.object
index 9324e0b..3b2a9ff 100644
--- a/src/objects/Account.object
+++ b/src/objects/Account.object
@@ -478,23 +478,6 @@
CORE.USERS.ALIAS
ReadWrite
-
- VAT_Number_10
- true
- LEN(VAT_Number__c) < 10
- VAT_Number__c
- VAT Number must be 10 characters
-
-
- Test_Min_5_Max_10
- true
- OR(
- LEN(Test__c) < 5,
- LEN(Test__c) > 10
- )
- Test__c
- Test__c should be between 5 and 10 characters long
-
AltavistaNews
online
```
`$ metadata-xml-tool remove-element-matching listViews "Ideas_Last_7_Days" src/objects/Idea.object`
```diff
diff --git a/src/objects/Idea.object b/src/objects/Idea.object
index 7a272cf..e2c9c0d 100644
--- a/src/objects/Idea.object
+++ b/src/objects/Idea.object
@@ -32,25 +32,6 @@
Picklist
-
- Ideas_Last_7_Days
- IDEA.CREATED_DATE
- IDEA.TITLE
- IDEA.CREATED_BY_NICKNAME
- VOTE_STATS.WEIGHTED_SUM
- IDEA.NUM_COMMENTS
- IDEA.STATUS
- IDEA.CATEGORIES
- COMMUNITY.NAME
- IDEA.IDEA_THEME
- Everything
-
- IDEA.CREATED_DATE
- equals
- LAST_N_DAYS:7
-
- Last 7 Days
-
InternalIdeasIdeaRecordType
true
```
`$ metadata-xml-tool remove-element-matching userPermissions "ManageEncryptionKeys" src/profiles/Admin.profile`
```diff
diff --git a/src/profiles/Admin.profile b/src/profiles/Admin.profile
index e7939c7..33ca7e1 100644
--- a/src/profiles/Admin.profile
+++ b/src/profiles/Admin.profile
@@ -2596,8 +2596,4 @@
true
ViewSetup
-
- true
- ManageEncryptionKeys
-
```
`$ metadata-xml-tool replace-tag-value runningUser ".*" "user@example.com" src/dashboards/CompanyDashboards/AdoptionDashboard.dashboard`
```diff
diff --git a/src/dashboards/CompanyDashboards/AdoptionDashboard.dashboard b/src/dashboards/CompanyDashboards/AdoptionDashboard.dashboard
index 916f693..7c3c3ef 100644
--- a/src/dashboards/CompanyDashboards/AdoptionDashboard.dashboard
+++ b/src/dashboards/CompanyDashboards/AdoptionDashboard.dashboard
@@ -283,7 +283,7 @@
false
- admin@universal.containers
+ user@example.com
#000000
Adoption Dashboard
#000099
```
## Sponsors
- [IPfolio](http://www.ipfolio.com)
- [PARX](http://www.parx.com)
## License
MIT © [Matthias Rolke](mailto:mr.amtrack@gmail.com)