The SFDX Command Runner is a Visual Studio Code extension designed to automate Salesforce DX (SFDX) tasks. It simplifies retrieving metadata, running SOQL queries, and processing Salesforce metadata files using SFDX commands directly from VS Code.
Key Features:
Retrieve metadata with sfdx force:source:retrieve.
Execute SOQL queries to fetch customizable objects.
Save SFDX commands from a JSON file to a .txt file.
Run commands sequentially from a text file.
Installation
Install the extension:
Clone the repository or download it from the VS Code Marketplace (if published).
Run the following command to install dependencies:
npm install
Launch the extension:
Open the extension in VS Code.
Press F5 to run and debug the extension in a new VS Code window.
Activate the extension:
Open the Command Palette in VS Code (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Type Run SFDX Command and hit Enter.
Commands
1. Run SFDX Command
This command:
Executes an SOQL query to retrieve all customizable objects from Salesforce.
Saves a list of SFDX metadata retrieve commands to a text file based on a JSON input file.
Sequentially executes all SFDX commands from the generated file.
2. Retrieve Metadata
Retrieves metadata using the command sfdx force:source:retrieve --metadata <metadataType>, where <metadataType> is fetched from a JSON file.
Usage
Open your VS Code workspace where Salesforce DX is set up.
Ensure the following files exist in the root of your project:
outputfilename.json: A JSON file containing metadata objects to retrieve.
The JSON file should have the following structure: