A modern, web-based interface for executing SOQL queries, Anonymous Apex, and DML operations against Salesforce orgs with Monaco Editor
npm install sf-utils-cliA modern, web-based interface for executing SOQL queries, Anonymous Apex, and DML operations against Salesforce orgs.
!Salesforce Utils CLI
!Node.js
!Monaco Editor
!Version
!License
Account.Owner.Name)!Apex
sf) installed and authenticatedsf plugins install sfdx-mohanc-plugins`
- At least one Salesforce org authenticated with the CLI$3
`bash
npm install -g sf-utils-cli
`šÆ Usage
$3
Production mode:
`bash
sf-utils
`
The server will start on
http://localhost:3456
Error: Port alredy in use
`
ā Error: Port 3456 is already in use! Find and kill the process using port 3456:
lsof -ti:3456 | xargs kill -9
# or on Windows:
netstat -ano | findstr :3456
`$3
1. Enter your Salesforce org username or alias in the connection field
2. Click Connect
3. Wait for the green checkmark confirming connection
Tip: Use Salesforce CLI aliases for easier connection:
`bash
sf org login web --alias production
sf org login web --alias sandbox
`Then simply use
production or sandbox in the connection field.š Examples
$3
#### Basic Query
`sql
SELECT Id, Name, Industry, AnnualRevenue
FROM Account
WHERE Industry = 'Technology'
LIMIT 10
`#### Query with Relationships
`sql
SELECT Id, Name, Owner.Name, Owner.Email,
(SELECT Id, Subject, Status FROM Tasks)
FROM Account
WHERE CreatedDate = THIS_MONTH
`#### LIKE Query
`sql
SELECT Name, Code, DeveloperName
FROM AttributeDefinition
WHERE DeveloperName LIKE 'ATT_%'`
#### NOT LIKE Query
`sql
SELECT Name, Code, DeveloperName
FROM AttributeDefinition
WHERE NOT DeveloperName LIKE 'ATT_%'`#### Aggregate Query
`sql
SELECT Industry, COUNT(Id) AccountCount, AVG(AnnualRevenue) AvgRevenue
FROM Account
WHERE Industry != null
GROUP BY Industry
ORDER BY COUNT(Id) DESC
`#### Tooling API Query
Enable "Use Tooling API" checkbox
`sql
SELECT Id, Name, Body, ApiVersion
FROM ApexClass
WHERE Name LIKE 'Test%'
ORDER BY Name
`$3
#### Update Records Based on Query
`apex
List accts = [
SELECT Id, Name
FROM Account
WHERE Name != null
];
for (Account a : accts) {
a.Name2__c = a.Name;
}
update accts;
System.debug('Updated ' + accts.size() + ' accounts.');
`#### Bulk Update with Custom Objects
`apex
List ads = [
SELECT Name, Code, DeveloperName
FROM AttributeDefinition
WHERE NOT DeveloperName LIKE 'ATT_%'
];
for (AttributeDefinition a : ads) {
a.DeveloperName = a.Code;
}
update ads;
System.debug('Updated ' + ads.size() + ' AttributeDefinitions.');
`#### Data Processing and Logging
`apex
// Calculate and log opportunity statistics
List opps = [
SELECT Id, Name, Amount, StageName, CloseDate
FROM Opportunity
WHERE CloseDate = THIS_YEAR
];Decimal totalAmount = 0;
Integer closedWon = 0;
for (Opportunity opp : opps) {
if (opp.Amount != null) {
totalAmount += opp.Amount;
}
if (opp.StageName == 'Closed Won') {
closedWon++;
}
}
System.debug('Total Opportunities: ' + opps.size());
System.debug('Closed Won: ' + closedWon);
System.debug('Total Amount: $' + totalAmount.setScale(2));
`$3
#### Insert Records
Format:
Object:Field1,Field2|value1,value2|value3,value4`
Account:Name,Industry,AnnualRevenue|Acme Corp,Technology,1000000|Global Inc,Finance,5000000
`#### Update Records
Format:
Object:Id,Field1,Field2|recordId,value1,value2`
Account:Id,Name,Industry|001XXXXXXXXXXXXXXX,Updated Acme Corp,Technology
`#### Delete Records
Format:
Object:Id1,Id2,Id3`
Account:001XXXXXXXXXXXXXXX,001YYYYYYYYYYYYYYY
`āļø Features in Detail
$3
The editor provides intelligent autocomplete:
- SOQL Keywords: Type
SEL ā suggests SELECT, WHERE, ORDER BY, etc.
- SObject Names: After FROM, get a list of all objects in your org
- Field Names: After SELECT, see all fields for the queried object
- Relationship Fields: Type Account. to see related fields
- Functions: Aggregate functions like COUNT(), SUM(), AVG()$3
- Automatically saves successful queries
- Shows timestamp, record count, and org
- Click any query to reload it
- Delete individual queries or clear all
- Persists across browser sessions
$3
- Sorting: Click column headers to sort ascending/descending
- Search: Filter results across all columns
- Pagination: Navigate through large datasets (50 records per page)
- Export: Download results as CSV
- Nested Objects: Automatically flattens related records (e.g.,
Owner.Name)$3
- Ctrl/Cmd + Enter - Execute query/code
- Standard Monaco Editor shortcuts:
- Ctrl/Cmd + / - Toggle comment
- Ctrl/Cmd + D - Select next occurrence
- Alt + Up/Down - Move line up/down
š§ Configuration
š Troubleshooting
$3
Problem: "Failed to get org details"
- Verify Salesforce CLI is installed:
sf --version
- Check org authentication: sf org list
- Ensure the username/alias is correct$3
Problem: "No such column 'FieldName'"
- Verify field exists in the object
- Check field API name (custom fields end with
__c)
- Ensure proper permissions on the field$3
Problem: Apex code compilation fails
- Check syntax errors in your code
- Verify all variables are declared
- Ensure proper object/field API names
$3
Problem: Large query results are slow
- Add
LIMIT` clause to queries- This tool runs locally and uses your authenticated Salesforce CLI session
- No credentials are stored in the application
- All API calls use your CLI's access tokens
- Run only in trusted environments
- Do not expose the server port to public networks
1. Always test DML operations in sandbox first
2. Use LIMIT clauses to avoid large data transfers
3. Review queries in history before re-executing
4. Enable "Use Tooling API" only for metadata queries
5. Export important query results as CSV backups
6. Use meaningful variable names in Apex code
7. Add System.debug() statements for troubleshooting
MIT License (c) Mohan Chinnappan
- Built with Monaco Editor - The code editor that powers VS Code
- Uses Tailwind CSS for styling
- Powered by Salesforce CLI
For issues related to:
- Salesforce CLI: Check Salesforce CLI Documentation
- SOQL Syntax: See SOQL Reference
- Apex Syntax: Visit Apex Developer Guide
---
Made with ā” for the Salesforce Developer Community