/login
Authenticate to a new Salesforce org via the browser (sf org login web). Optionally set the org as the project's default target.
> /plugin marketplace add forcedotcom/sf-skills > /plugin install salesforce-development@salesforce
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/login
Context preview
What this command does when you run it.
Authenticate to a new Salesforce org via the browser (sf org login web). Optionally set the org as the project's default target.
Command definition
login.mddescription: Authenticate to a new Salesforce org via the browser (sf org login web). Optionally set the org as the project's default target.
allowed-tools:
- Bash
argument-hint: "[--alias <name>] [--instance-url <url>] [--set-default]"
Authenticate to a Salesforce org. The user can pass:
- `--alias <name>` to label the auth (e.g., `myDevHub`, `customerSandbox`)
- `--instance-url <url>` for non-production endpoints (e.g., `https://test.salesforce.com` for sandboxes, `https://login.salesforce.com` for production — production is the default if omitted)
- `--set-default` to set this org as the project's `target-org` after auth
Workflow:
1. **Parse the arguments** ($ARGUMENTS) the user provided. Extract alias, instance-url, and set-default flag.
2. **Run the login command:**
sf org login web {--alias $ALIAS} {--instance-url $URL}This opens a browser for OAuth. Tell the user clearly: "A browser window will open. Complete the login flow and return here."
3. **Handle browser-isn't-available case:** If the user is on a remote shell or the browser won't open, fall back to:
sf org login device-code {--alias $ALIAS} {--instance-url $URL}which prints a code the user enters at salesforce.com/setup/connect.
4. **After successful auth:** if the user passed `--set-default`, run:
sf config set target-org $ALIAS
Otherwise, suggest they run `/salesforce-development:set-default <alias>` if they want to use this org for the current project.
5. **Verify:** print a one-liner with the new org's alias, edition, and instance URL:
sf org display --target-org $ALIAS --json
so the user sees the connected state.
Rules:
- Always use `--json` on `sf` commands so you can parse outcomes
- Do NOT log access tokens or any auth secrets
- If the user doesn't supply an alias, the auth saves under their username — recommend they pass `--alias` for easier reference later
- For sandbox auth, `--instance-url https://test.salesforce.com` is required
Read more
description: Authenticate to a new Salesforce org via the browser (sf org login web). Optionally set the org as the project's default target. allowed-tools: - Bash argument-hint: "[--alias <name>] [--instance-url <url>] [--set-default]"
Authenticate to a Salesforce org. The user can pass:
- `--alias <name>` to label the auth (e.g., `myDevHub`, `customerSandbox`)
- `--instance-url <url>` for non-production endpoints (e.g., `https://test.salesforce.com` for sandboxes, `https://login.salesforce.com` for production — production is the default if omitted)
- `--set-default` to set this org as the project's `target-org` after auth
Workflow:
1. **Parse the arguments** ($ARGUMENTS) the user provided. Extract alias, instance-url, and set-default flag.
2. **Run the login command:**
sf org login web {--alias $ALIAS} {--instance-url $URL}This opens a browser for OAuth. Tell the user clearly: "A browser window will open. Complete the login flow and return here."
3. **Handle browser-isn't-available case:** If the user is on a remote shell or the browser won't open, fall back to:
sf org login device-code {--alias $ALIAS} {--instance-url $URL}which prints a code the user enters at salesforce.com/setup/connect.
4. **After successful auth:** if the user passed `--set-default`, run:
sf config set target-org $ALIAS
Otherwise, suggest they run `/salesforce-development:set-default <alias>` if they want to use this org for the current project.
5. **Verify:** print a one-liner with the new org's alias, edition, and instance URL:
sf org display --target-org $ALIAS --json
so the user sees the connected state.
Rules:
- Always use `--json` on `sf` commands so you can parse outcomes
- Do NOT log access tokens or any auth secrets
- If the user doesn't supply an alias, the auth saves under their username — recommend they pass `--alias` for easier reference later
- For sandbox auth, `--instance-url https://test.salesforce.com` is required
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Other commands on sf-skills.
- /discovery
Discover installed and available Salesforce capabilities, drill into a domain or skill, or explicitly add one catalog-authorized project skill.
Open command - /logout
Sign out of one or all Salesforce orgs (sf org logout). Confirms before destructive action.
Open command - /org
Show just the connected Salesforce org details — alias, edition, API version, instance URL, username.
Open command - /project
Show just the local SFDX project metadata stats — Apex/triggers/LWC/Aura/objects/perm sets/flows counts and git status.
Open command - /reset-source-tracking
Reset source tracking for the target org — tells the CLI to forget all tracked changes so the next push/pull treats the full org as new state. Destructive on shared sandboxes. Requires explicit confirmation before executing.
Open command - /set-default
Set the project's target-org (the org that all sf commands run against by default). If no org is named, lists the authenticated orgs for the user to pick.
Open command

