CLI reference
All commands live under the sf setup-agents topic.
Configures AI agent rule files for the current project directory. Auto-detects installed tools and prompts for role profile selection.
sf setup-agents local [--rules cursor|vscode|codex|claude|agentforce]
[--profile <value>] [-f]
| Flag | Type | Description |
|---|---|---|
--rules |
string | Target AI tool. Options: cursor · vscode · codex · claude · agentforce. Omit to auto-detect. |
--profile |
string | Comma-separated role profiles. Omit for interactive multi-select. Non-TTY defaults to developer. |
-f, --force |
boolean | Overwrite existing rule files. |
When --rules is omitted, the command checks for:
| Indicator | Tool Configured |
|---|---|
.cursor/ directory | cursor |
.vscode/ directory | vscode |
AGENTS.md file | codex |
CLAUDE.md file | claude |
.a4drules/ directory | agentforce |
| none detected | all 5 tools |
# Auto-detect tools, interactive profile selection
sf setup-agents local
# Configure only Cursor
sf setup-agents local --rules cursor
# Configure Claude Code
sf setup-agents local --rules claude
# Configure with multiple combined profiles
sf setup-agents local --profile developer,architect,cgcloud
# Full Agentforce setup for a QA engineer
sf setup-agents local --rules agentforce --profile qa
# Force overwrite existing files
sf setup-agents local --force
Writes a @salesforce/mcp
server entry into .cursor/mcp.json (or ~/.cursor/mcp.json with --global),
enabling Cursor AI to call Salesforce org tools directly.
sf setup-agents mcp [--target-org <alias>] [--profile <value>]
[--all-toolsets] [-g]
| Flag | Type | Description |
|---|---|---|
--target-org |
string | Org alias or username. Omit for interactive org picker (requires TTY). |
--profile |
string | Determines which MCP toolsets to activate. See toolset map below. |
--all-toolsets |
boolean | Force-enable all available Salesforce MCP toolsets. |
-g, --global |
boolean | Write to ~/.cursor/mcp.json (user-level) instead of project. |
| Profile | Toolsets |
|---|---|
developer · architect · qa · cgcloud | metadata · data · testing · users |
ba · pm · ux · crma · data360 | metadata · data |
devops | metadata · orgs · users |
mulesoft | metadata · orgs |
If no authenticated Salesforce orgs are found, the command offers to start a
sf org login web flow — prompts for an alias, opens the browser for
OAuth, and waits for the login to complete before proceeding with MCP configuration.
# Configure for a specific org
sf setup-agents mcp --target-org myOrgAlias
# Write to global ~/.cursor/mcp.json
sf setup-agents mcp --target-org myOrg --global
# Enable all toolsets
sf setup-agents mcp --target-org myOrg --all-toolsets
# Profile-aware toolset selection
sf setup-agents mcp --target-org myOrg --profile developer
Scans the project for rule files generated by an older version of the plugin
and regenerates only the stale ones. Active profiles are inferred from
existing .cursor/rules/ profile files.
sf setup-agents update [--dry-run] [-y]
| Flag | Type | Description |
|---|---|---|
--dry-run |
boolean | List stale files without modifying them. |
-y, --yes |
boolean | Skip confirmation prompt. Useful in CI. |
| Location | Version Token |
|---|---|
.cursor/rules/*.mdc | pluginVersion: "x.y.z" in frontmatter |
.github/copilot-instructions.md | <!-- setup-agents: x.y.z --> |
AGENTS.md | <!-- setup-agents: x.y.z --> |
CLAUDE.md | <!-- setup-agents: x.y.z --> |
.a4drules/*.md | <!-- setup-agents: x.y.z --> |
.a4drules/workflows/*.md | <!-- setup-agents: x.y.z --> |
# Preview what would be updated
sf setup-agents update --dry-run
# Update with confirmation
sf setup-agents update
# Update without prompting (CI)
sf setup-agents update --yes
Each profile tailors the rules to the specific role — from Developer to Data Cloud Engineer.