Dx Org Switch
Sets the default Salesforce org for the Salesforce CLI, locally by default and globally on request.
- CCM score
- 77 of 100
- skills.sh installs
- 5.9K
- GitHub stars
- 1.2K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers picking an org from
sf org list, then setting it as the defaulttarget-orgwithsf config set - Applies changes to the current project directory by default, with a
--globaloption for system-wide scope - Verifies the new value with
sf config get target-org --jsonand reports any error - Warns that a
SF_TARGET_ORGenvironment variable overrides the config, and suggestssf org login webfor unauthorized orgs
Install
$ npx -y skills add forcedotcom/sf-skills --skill dx-org-switch -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Steps
- Identify the org: the user provides a username or alias (
orgIdentifier). If not provided, runsf org listto show authenticated orgs and ask the user which one to use. - Set the default org:
- Local (default):
sf config set target-org <orgIdentifier>- Applies only within the current project directory. Use this for normal project work.
- Global (only if user explicitly requests):
sf config set target-org <orgIdentifier> --global- Applies system-wide across all directories. Use when working outside a project or when the user asks for global scope.
- If this fails, report the error and suggest running
sf org login webif the org may not be authorized.
- Local (default):
- Verify:
sf config get target-org --json- Note: the JSON output does not include a scope/location field — it cannot confirm whether the value is local or global. Confirm the value only, e.g.:
target-org is now set to: <value> - If it fails, report the error and advise running
sf config get target-org.
Notes
Details
- Repository
- github.com/forcedotcom/sf-skills
- Categories
- CLI & Terminal, DevOps & Cloud
- First seen
- Jul 14, 2026
Questions
What does the dx-org-switch skill do?
The dx-org-switch skill changes which Salesforce org the Salesforce CLI commands run against by setting the default target-org. It works when you say things like switch org, change default org, or use alias, and it applies to scratch orgs, sandboxes, or production.
How do I install the dx-org-switch skill?
Run npx -y skills add forcedotcom/sf-skills --skill dx-org-switch -y in your project. Once installed, the agent can set the target org locally for the project, or globally when you explicitly ask for it.
Does dx-org-switch need the Salesforce CLI?
Yes, the skill works through the sf command line tool, version 2.0.0 or later. It uses sf org list to show authenticated orgs and sf config set target-org to change the default org.
Where does dx-org-switch rank in its category?
It sits in the CLI and Terminal category, where it ranks in the top 50. Other skills in that category include herdr, gws-shared, opentui, cf-cli and pnpm.
More from forcedotcom/sf-skills
All 78- Dx Org Permission Set Assign5.9K
- Platform Custom Lightning Type Generate5.9K
- Agentforce Test5.8K
- Agentforce Observe5.8K
- Platform Lightning App Coordinate5.8K
- Design Systems Slds2 Migrate5.8K
- External Diagram Mermaid Generate5.7K
- Integration Connectivity Connected App Configure5.6K
- Integration Connectivity Generate5.6K
- Agentforce D360 Analyze5.4K
- Experience Ui Bundle Frontend Generate5.4K
- Platform Tracing Configure5.4K
- Experience Ui Bundle Metadata Generate5.3K
- Platform Value Set Generate5.3K
- Experience Ui Bundle App Coordinate5.3K
- Experience Ui Bundle Deploy5.3K
- Experience Ui Bundle Salesforce Data Access5.3K
- Platform Tracing Agentforce Configure5.3K
- Dx App Analytics Query5.3K
- Experience Ui Bundle Custom App Generate5.3K
- Integration Eventing Cdc Configure5.3K
- Integration Eventing Subscription Configure5.3K
- Platform Trust Archive Manage5.3K
- Experience Ui Bundle File Upload Generate5.2K
Similar to Dx Org Switch
More CLI & Terminaldx-org-manageSkillforcedotcom/sf-skills6.4K installsAutomates Salesforce scratch org creation, snapshot-based builds, and browser opening via the sf CLI.
sf-deploySkilljaganpro/sf-skills1.5K installsSalesforce deployment orchestration using sf CLI v2 with dry-run validation, scoped deploys, and failure triage.
BuildBase ConsoleMCP serverbuildbase-appRead and change BuildBase organizations, members, content, email, workflows, and settings.
wiki-switchSkillar9av/obsidian-wiki2.1K installsSwitch, list, inspect, and scaffold named Obsidian vault config profiles from one global config directory.