this is to read plugins
npm install dts-sf-coe-meta-readernode --version
sf --version
node --version
powershell
npm install --global @salesforce/cli
`
3. Verify installation: sf --version
$3
Once you have Salesforce CLI installed, install this plugin:
`powershell
sf plugins install dts-sf-coe-meta-reader
`
Verify the plugin is installed:
`powershell
sf plugins
`
You should see dts-sf-coe-meta-reader in the list of installed plugins.
---
š Authentication: Connect to Your Salesforce Org
Before you can use the plugin, you need to authenticate with your Salesforce org.
$3
`powershell
sf auth web login --alias my-org
`
This will:
1. Open your browser
2. Ask you to log in to Salesforce
3. Ask for permission to connect Salesforce CLI
4. Click "Allow" and you're done!
Replace my-org with any name you want for this org (example: sf auth web login --alias production or sf auth web login --alias sandbox)
$3
If you need to authenticate without a browser:
`powershell
sf auth device login --alias my-org
`
Then follow the on-screen instructions to complete the authentication.
---
š How to Use This Plugin
$3
Before running any commands, see which orgs you have authenticated:
`powershell
sf org list
`
You'll see something like:
`
Alias Username Type
āāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāā
my-org admin@mycompany.com Production
my-sandbox dev@mycompany.com Sandbox
`
---
š” Main Command: Read Profile Metadata
$3
Extract a Profile from your Salesforce org:
`powershell
sf read profile --profile "Admin" --targetOrg my-org
`
What this does:
1. Connects to the org named my-org
2. Reads the Profile named "Admin"
3. Asks for confirmation
4. Creates a file called Admin-profile.xml in your current folder
5. The XML file contains all Profile details (permissions, object access, field-level security, etc.)
$3
| Parameter | Short Flag | Required? | Description |
| ------------- | ---------- | --------- | ---------------------------------------------------------------------------------------------- |
| --profile | -p | ā
Yes | The exact name of the Profile to read (e.g., "Admin", "Standard User", "System Administrator") |
| --targetOrg | -o | ā
Yes | The alias of the org you authenticated (from sf org list) |
| --name | -n | ā No | Optional custom name for the output file |
$3
Example 1: Export Admin Profile from Production
`powershell
sf read profile --profile "System Administrator" --targetOrg production
`
Creates: System Administrator-profile.xml
Example 2: Export Custom Profile from Sandbox
`powershell
sf read profile --profile "Custom Sales User" --targetOrg my-sandbox
`
Creates: Custom Sales User-profile.xml
Example 3: Export with Custom Output Name
`powershell
sf read profile --profile "Admin" --targetOrg my-org --name "admin-backup-2024"
`
Creates: admin-backup-2024.xml
---
š Where Does the Output Go?
The exported Profile XML file is saved in your current working directory (the folder you're in when you run the command).
$3
`powershell
Navigate to your desired folder first
cd C:\Users\YourUsername\Desktop
Then run the command
sf read profile --profile "Admin" --targetOrg my-org
`
The file will now be saved to your Desktop!
---
š ļø Common Issues & Solutions
$3
Solution: Check the exact Profile name in Salesforce:
1. In Salesforce, go to Setup > Users > Profiles
2. Find the exact name of the Profile
3. Use that exact name in the command (names are case-sensitive!)
$3
Solution: The plugin wasn't installed. Run:
`powershell
sf plugins install dts-sf-coe-meta-reader
`
$3
Solution: You need to authenticate first. Run:
`powershell
sf auth web login --alias my-org
`
$3
Solution: Salesforce CLI isn't installed or not in your PATH. Reinstall it:
`powershell
npm install --global @salesforce/cli
`
---
š Understanding the Output XML File
When you export a Profile, you get an XML file that looks like this:
`xml
MyApexClass
true
true
true
true
false
`
You can:
- š Read it - Understand what permissions the Profile has
- š¾ Backup it - Keep a version history of Profile changes
- š Compare it - Diff two profiles to see what changed
- š¤ Deploy it - Use it with Salesforce CLI to update profiles in other orgs
---
š¤ Support & Feedback
Found a bug? Have a feature request? Create an issue or contact the development team.
---
š Learn More
- Salesforce CLI Documentation: https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm
- Profile Metadata Reference: https://developer.salesforce.com/docs/atlas.en-us.meta_api_meta.meta/meta_api_meta/meta_profiles.htm
- Salesforce DX Guide: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev_guide.meta/sfdx_dev_guide/sfdx_dev_guide_intro.htm
---
š License
BSD-3-Clause License - See LICENSE file for details
---
Happy developing! š
Made with ā¤ļø for Salesforce developers
---
For Developers: Contributing & Building
$3
This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
2. Generate your plugin:
`
sf plugins install dev
sf dev generate plugin
git init -b main
git add . && git commit -m "chore: initial commit"
``