- Home
- Marketplace
- plugins
- salesforce
salesforce
The salesforce plugin integrates Salesforce CLI with Claude Code,
providing org authentication and a general-purpose CLI agent that can
run any sf command including SOQL queries. It supports headless
container environments with JWT, access-token, and SFDX URL
authentication flows. The usage guide below demonstrates how to use
natural language to query accounts, opportunities, cases, and contacts
through the CLI agent.
Installation
Section titled “Installation”/plugin install salesforce@f5xc-salesdemos-marketplacePrerequisites
Section titled “Prerequisites”- Salesforce CLI (
@salesforce/cli) - Salesforce org with API access
- A user account with permissions to query objects (Cases, Opportunities, Accounts, Contacts)
Install the Salesforce CLI on your workstation:
brew install sfVerify the installation:
sf --versionYou should see output like @salesforce/cli/2.x.x.
Authentication Setup
Section titled “Authentication Setup”Step 1: Find your Salesforce domain
Section titled “Step 1: Find your Salesforce domain”Look at your Salesforce URL in the browser. If you access Salesforce at
https://acme.lightning.force.com, your login domain is
https://acme.my.salesforce.com.
Step 2: Authenticate via browser
Section titled “Step 2: Authenticate via browser”sf org login web --alias my-org --set-default --instance-url https://YOUR-DOMAIN.my.salesforce.comReplace YOUR-DOMAIN with your company domain from Step 1. Your browser
opens — complete the SSO or login flow and authorize the app. You should
see:
Successfully authorized your-email@company.com with org ID 00DXXXXXXXXXXXXXXXStep 3: Verify the connection
Section titled “Step 3: Verify the connection”sf org display --target-org my-orgConfirm the output shows Connected Status: Connected with your username
and instance URL.
Step 4: Portable auth for containers (optional)
Section titled “Step 4: Portable auth for containers (optional)”If you need to authenticate in a headless environment (CI/CD, container, remote session), export the SFDX auth URL from your workstation:
sf org display --verbose --target-org my-orgCopy the Sfdx Auth Url value (starts with force://). In the
container, run:
export SFDX_AUTH_URL="force://PlatformCLI::YOUR_AUTH_TOKEN@your-domain.my.salesforce.com"echo "$SFDX_AUTH_URL" | sf org login sfdx-url --sfdx-url-stdin=- --alias=my-org --set-defaultAuthentication methods reference
Section titled “Authentication methods reference”| Method | Best For | Requires |
|---|---|---|
| Web Login | Workstations with a browser | Browser + SSO |
| SFDX URL | Containers, CI/CD, portable auth | Auth URL from an authenticated session |
| JWT Bearer | Automated pipelines | Connected App + private key + consumer key |
| Access Token | Environment variable auth | SF_ACCESS_TOKEN + SF_ORG_INSTANCE_URL |
Note: Device flow (sf org login device) is blocked since August
2025 and is not supported.
Environment variables
Section titled “Environment variables”| Variable | Purpose |
|---|---|
SF_ACCESS_TOKEN | Bearer token for access-token auth |
SFDX_AUTH_URL | Force auth URL for SFDX URL auth |
SF_ORG_INSTANCE_URL | Org instance URL |
SF_JWT_KEY_FILE | Path to JWT private key |
SF_CLIENT_ID | Connected App consumer key |
SF_USERNAME | Salesforce username for JWT |
Commands
Section titled “Commands”/salesforce:sf-status
Section titled “/salesforce:sf-status”Check your Salesforce org connection status, CLI version, and authenticated orgs.
/salesforce:sf-statusWhat to expect: A table showing your sf CLI version, authenticated org alias, username, instance URL, connected status, and API version.
/salesforce:sf-login
Section titled “/salesforce:sf-login”Authenticate to a Salesforce org. Optionally provide an alias.
/salesforce:sf-login/salesforce:sf-login my-orgWhat to expect: If an org with that alias is already authenticated, it reports the connection details. If not, it checks for available credentials (environment variables) and authenticates using the first fully satisfied method.
Skills
Section titled “Skills”salesforce-index
Section titled “salesforce-index”Top-level intent router. Automatically activates when you mention Salesforce, org management, or data queries in natural language.
| You say | Routes to |
|---|---|
| ”login to salesforce”, “authenticate org” | salesforce-auth skill |
| ”check org status”, “list orgs” | cli-operator agent |
| ”show me opportunities”, “look up case” | cli-operator agent (SOQL query) |
| “generate Apex class”, “create Flow” | afv-library development skills |
salesforce-auth
Section titled “salesforce-auth”Container-adapted authentication skill. Supports four auth methods and automatically detects which credentials are available. Prioritizes: access-token, then JWT, then SFDX URL, then web login.
Agents
Section titled “Agents”cli-operator
Section titled “cli-operator”Autonomous Salesforce CLI agent that executes sf commands with safety
guardrails. All Salesforce operations are delegated to this agent to
keep the main session context lean.
Safety rules:
- Read-only by default — write operations require explicit approval
- Never deploys without a preview and confirmation step
- Never echoes access tokens, auth URLs, or credentials in output
- Sanitizes all user-provided values (rejects shell metacharacters)
- Uses
--jsonoutput for structured, parseable results
Response format:
## Result: [SUCCESS | FAILURE | PARTIAL]### Command Executed### Output Summary### IssuesUsage Guide: Account Management
Section titled “Usage Guide: Account Management”These prompts work with any Salesforce org. Replace the placeholder values with your own information. Each prompt produces results specific to your role, accounts, and territory.
Getting started
Section titled “Getting started”After authenticating, verify everything works:
/salesforce:sf-statusThen try a simple natural language query:
list my authenticated salesforce orgsWhat to expect: A table showing all connected orgs with alias, username, instance URL, and connection status.
Find your accounts
Section titled “Find your accounts”Discover which accounts you are assigned to:
what salesforce accounts am I on the account team for? My email is your-email@company.comWhat to expect: A list of accounts grouped by account owner, showing your team member role on each. If most roles show as empty, that is a common data hygiene gap — the account team memberships exist but roles were not populated.
Cross-reference coverage with a colleague
Section titled “Cross-reference coverage with a colleague”Compare your account coverage with a teammate to find gaps:
In salesforce, find all accounts where Colleague Name is on the account team. Then for each of those accounts, check if your-email@company.com is also on the account team. Show me two lists: accounts where we are BOTH tagged, and accounts where only my colleague is tagged but I am missing.What to expect: A summary table showing overlap count and gap count, followed by two lists. If you recently changed roles, you may find zero overlap — this reveals which accounts you need to be added to.
Territory pipeline overview
Section titled “Territory pipeline overview”See all open opportunities across your accounts:
show me all open salesforce opportunities on Colleague Name's account team accounts, sorted by close date, include the stage, amount, and probabilityWhat to expect: A summary with total opportunity count, raw pipeline, and weighted pipeline. Then a stage distribution table and a list of top opportunities by amount. The output flags data hygiene issues like past-due close dates or null amounts.
Opportunity deep dive
Section titled “Opportunity deep dive”Get the full picture on a specific deal:
show me a detailed view of the OPPORTUNITY NAME opportunity in salesforce - include the opportunity team members, any activities or tasks, and the account contactsWhat to expect: The opportunity overview (stage, amount, close date, probability, forecast category, owner), opportunity team members with roles, tagged contacts, recent tasks and events, and field change history showing how the deal amount and close date have moved over time.
Support cases across territory
Section titled “Support cases across territory”Check for open support cases on your accounts:
show me all open salesforce cases across Colleague Name's account team accounts, grouped by account, sorted by most recent firstWhat to expect: A count of open cases with priority and status breakdown, then case details grouped by account. Stale cases (months or years old with no activity) are flagged as hygiene candidates.
Quarterly pipeline forecast
Section titled “Quarterly pipeline forecast”Get a forecast-ready view of your pipeline:
for Colleague Name's accounts, show me a quarterly pipeline summary - group the open opportunities by close date quarter with count, total amount, and weighted amount for each quarterWhat to expect: A table with one row per quarter showing opportunity count, total pipeline, and weighted pipeline. Includes a stage mix breakdown per quarter and highlights the top weighted deals. Past-due opportunities are grouped separately.
Full account overview
Section titled “Full account overview”Deep dive into a specific customer:
give me a full account overview for ACCOUNT NAME in salesforce including contacts, open opportunities, and recent casesWhat to expect: Company profile (industry, revenue, employees, location), key contacts with titles and email, open opportunities with stages and amounts, and recent support cases with status.
Case lookup
Section titled “Case lookup”Look up a specific support case by number:
look up salesforce case CASE-NUMBER and show me the case details, the customer account, and who owns itWhat to expect: Case subject, status, priority, description, the customer account profile, and the case owner with contact information.
Usage Guide: Data Queries
Section titled “Usage Guide: Data Queries”For power users, you can ask for specific SOQL-style queries in natural language. The plugin translates your request into the appropriate SOQL and runs it.
Specific fields
Section titled “Specific fields”query salesforce for all Contacts at ACCOUNT NAME - show Name, Title, Email, Phone, and DepartmentDate filtering
Section titled “Date filtering”show me all salesforce opportunities that closed won in the last 90 days on ACCOUNT NAMEAggregation
Section titled “Aggregation”count all open salesforce cases grouped by priority and status across my accountsCustom objects
Section titled “Custom objects”query the CUSTOM_OBJECT__c object in salesforce for records where Status__c = 'Active'Development Skills
Section titled “Development Skills”The 30 Salesforce development skills from the forcedotcom/afv-library activate automatically for Apex, Flow, LWC, SOQL, metadata, Agentforce, and deployment tasks. Install them separately:
npx skills add forcedotcom/afv-library| Topic | Skill |
|---|---|
| Apex classes and services | generating-apex |
| Apex tests | generating-apex-test |
| Flows | generating-flow |
| LWC and UI bundles | building-ui-bundle-app |
| Custom objects | generating-custom-object |
| Custom fields | generating-custom-field |
| Validation rules | generating-validation-rule |
| Permission sets | generating-permission-set |
| FlexiPages | generating-flexipage |
| Agentforce agents | developing-agentforce |
| Agentforce testing | testing-agentforce |
| Deployment | deploying-ui-bundle |
| SLDS2 migration | uplifting-components-to-slds2 |
| Trigger refactoring | trigger-refactor-pipeline |