An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# metadata-xml-tool

> CLI tool for processing Salesforce Metadata XML files

[![Actions Status](https://github.com/amtrack/metadata-xml-tool/workflows/Test%20and%20Release/badge.svg)](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)