Skill-Details
salesforce
Sales CRM management is useful to sales teams but Salesforce-specific.
Vor Nutzung prüfen
Die automatische Prüfung bewertet Relevanz, nicht Sicherheit oder Empfehlung. Lies vor der Nutzung die Quellanweisungen.
SKILL.md
Dieser Auszug wurde bei der Prüfung gespeichert. Die externe Quelle enthält die vollständige und aktuelle Version.
---
name: salesforce
description: "Query and manage Salesforce CRM data via the Salesforce CLI (`sf`). Run SOQL/SOSL queries, inspect object schemas, create/update/delete records, bulk import/export, execute Apex, deploy metadata, and make raw REST API calls."
homepage: https://developer.salesforce.com/tools/salesforcecli
metadata: {"clawdbot":{"emoji":"☁️","requires":{"bins":["sf"]},"install":[{"id":"npm","kind":"node","package":"@salesforce/cli","bins":["sf"],"label":"Install Salesforce CLI (npm)"}]}}
permissions:
- exec: "Runs the Salesforce CLI for authenticated CRM queries, metadata inspection, and administrative tasks."
- file_write: "Writes query exports or import files only when the user asks for saved artifacts."
- network: "Uses the authenticated Salesforce org connection through the Salesforce CLI."
---
# Salesforce Skill
Use the Salesforce CLI (`sf`) to interact with Salesforce orgs. The CLI must be authenticated before use. Always add `--json` for structured output.
If the `sf` binary is not available, stop and ask the user to install the Salesforce CLI using the repo's declared install metadata or the official Salesforce CLI guide. After the CLI is available, authenticate with `sf org login web` before touching org data.
## Safety Boundaries
- Do not create, update, delete, deploy, or execute Apex without explicit user confirmation.
- Do not reveal access tokens, auth URLs, refresh tokens, or verbose org-display output in chat.
- Do not export data to files unless the user asked for a saved artifact or bulk workflow.
- Do not target a production org by default when sandbox or staging access is available.
## Authentication and Org Management
### Log in (opens browser)
```bash
sf org login web --alias my-org
```
Other login methods:
```bash
# JWT-based login (CI/automation)
sf org login jwt --client-id <consumer-key> --jwt-key-file server.key --username [email protected] --alias my-org
# Login with an existing access token
sf org login access-token --instance-url https://mycompany.my.salesforce.com
# Login via SFDX auth URL (from a file)
sf org login sfdx-url --sfdx-url-file authUrl.txt --alias my-org
```
### Manage orgs
```bash
# List all authenticated orgs
sf org list --json
# Display info about the default org (access token, instance URL, username)
sf org display --json
# Display info about a specific org
sf org display --target-org my-org --json
# Display with SFDX auth URL (sensitive - contains refresh token)
sf org display --target-org my-org --verbose --json
# Open org in browser
sf org open
sf org open --target-org my-org
# Log out
sf org logout --target-org my-org
```
### Configuration and aliases
```bash
# Set default target org
sf config set target-org my-org
# List all config variables
sf config list
# Get a specific config value
sf config get target-org
# Set an alias
sf alias set [email protected]
# List aliases
sf alias list
```
## Querying Data (SOQL)
Standard SOQL queries via the default API:
```bash
# Basic query
sf data query --query "SELECT Id, Name, Email FROM Contact LIMIT 10" --json
# WHERE clause
sf data query --query "SELECT Id, Name, Amount, StageName FROM Opportunity WHERE StageName = 'Closed Won'" --json
# Relationship queries (parent-to-child)
sf data query --query "SELECT Id, Name, (SELECT LastName, Email FROM Contacts) FROM Account LIMIT 5" --json
# Relationship queries (child-to-parent)
sf data query --query "SELECT Id, Name, Account.Name FROM Contact" --json
# LIKE for text search
sf data query --query "SELECT Id, Name FROM Account WHERE Name LIKE '%Acme%'" --json
# Date filtering
sf data query --query "SELECT Id, Name, CreatedDate FROM Lead WHERE CreatedDate = TODAY" --json
# ORDER BY + LIMIT
sf data query --query "SELECT Id, Name, Amount FROM Opportunity ORDER BY Amount DESC LIMIT 20" --json
# Include deleted/archived records
sf data query --query "SELECT Id, Name FROM Account" --all-rows --json
# Query from a file
sf data query --file queryVollständige Quelle auf GitHub lesen (öffnet externe Seite)