Skip to content
Development
Skill

/dx-org-devhub-configure

Enable Dev Hub on a Salesforce org, view its status and scratch org allocation, or read its current DevHubSettings preferences, using the Salesforce CLI (sf). Use when someone wants to turn on or enable Dev Hub, set up an org for scratch orgs or 2GP/unlocked packages, check

From plugin
sf-skills
1.1k200 skills6 agents15 commands4 MCP

Claude Code

$ npx -y skills add forcedotcom/sf-skills --skill dx-org-devhub-configure --agent claude-code

SKILL.md

dx-org-devhub-configure.SKILL.md
name: dx-org-devhub-configure
description: "Enable Dev Hub on a Salesforce org, view its status and scratch org allocation, or read its current DevHubSettings preferences, using the Salesforce CLI (sf). Use when someone wants to turn on or enable Dev Hub, set up an org for scratch orgs or 2GP/unlocked packages, check whether Dev Hub is already enabled, see scratch org allocation (Active/Daily limits, remaining, and a pre-flight warning near the limit), see which Dev Hub preferences (packaging, org shape export, scratch org snapshots) are on or off, configure those preferences, list active scratch orgs, or list authenticated orgs when none is specified. Enabling deploys enableScratchOrgManagementPref, is irreversible, needs a System Administrator (ModifyAllData or ModifyMetadata), and does not work in sandboxes. DO NOT TRIGGER for creating or deleting individual scratch orgs."
allowed-tools: Read, Bash(bash), Bash(sf api request rest), Bash(sf data query), Bash(sf org list), Bash(sf project deploy), Bash(sf config get), Bash(sf org display), Bash(sf org open), Bash(jq)
metadata:
  version: "1.1"
  domains: ["Developer Experience"]
  # DevHubSettings metadata + the Tooling API DevHubSettings endpoint require
  # DevHubSettings base fields need API 47.0+, but enableShapeExportPref needs
  # 55.0+ and enableScratchOrgSnapshotPref needs 61.0+, so the script reads and
  # deploys at 62.0 (see scripts/devhub.sh SETTINGS_API_VERSION).
  minApiVersion: "62.0"
  # Enabling needs ModifyAllData OR ModifyMetadata (either suffices). accessCheck
  # is a flat array with no OR operator, so declaring both would read as AND and
  # could falsely gate an admin holding only one. Declare the canonical
  # System-Administrator perm; the OR alternative stays documented in the
  # description and body.
  accessCheck: "UserPermissions.ModifyAllData"
  cliTools:
    - tool: ["jq"]
      semver: ">=1.6.0"
    - tool: ["sf"]
      semver: ">=2.0.0"

Enable Dev Hub & View Scratch Org Allocation

Enable **Dev Hub** on a Salesforce org, verify whether it is already on, and see the org's **scratch org allocation** (Active and Daily limits, how many remain, and a pre-flight warning when close to the limit) — for the default org or a named org. The skill can also read the org's current **DevHubSettings preferences**, configure Dev Hub sub-preferences (packaging, org shape export, scratch org snapshots), list the active scratch orgs created from a Dev Hub, and list which orgs are authenticated when none is specified.

Dev Hub is the org feature that lets you **create and manage scratch orgs** and **second-generation (2GP) / unlocked packages**.

When to use

Trigger on requests like:

  • "Enable Dev Hub" / "Turn on Dev Hub" / "Set up this org for scratch orgs."
  • "Is Dev Hub enabled on my org?" / "Check if Dev Hub is on."
  • "How many scratch orgs can I create?" / "What's my scratch org allocation /

limit?" / "How many scratch orgs do I have left?"

  • "Turn on packaging / 2GP / unlocked packages" / "Enable org shape export" /

"Enable scratch org snapshots" (Dev Hub sub-preferences).

  • "Which Dev Hub preferences are turned on?" / "Show my current DevHubSettings."
  • "List the scratch orgs on my Dev Hub."
  • "What orgs do I have authenticated?" / "I didn't pass an org — what's available?"

When NOT to use

Do **not** trigger this skill for:

  • **Creating or deleting an individual scratch org** — that is

`sf org create scratch` / `sf org delete scratch`, a different workflow. This skill enables the *Dev Hub feature* and reports *allocation*; it does not create scratch orgs.

How Dev Hub enablement is determined

The standard object **`ScratchOrgInfo`** is provisioned and becomes queryable **only when Dev Hub is enabled**. So a successful `SELECT COUNT() FROM ScratchOrgInfo` means Dev Hub is **ON**; an `INVALID_TYPE` error means it is **OFF**. This is the reliable signal.

> Do **not** infer enablement from `sf org list limits` alone: it reports > `ActiveScratchOrgs` / `DailyScratchOrgs` rows even on orgs where Dev Hub is > **off**, so limits show allocation but not enablement.

How enabling works (important)

  • The Dev Hub master switch is the **deployable** Metadata API field

**`DevHubSettings.enableScratchOrgManagementPref`**. There is **no** `enableDevHub` field and **no** dedicated `sf` command to turn it on — deploying this setting is exactly what the Setup toggle does.

  • **Enabling is irreversible** — once on, Dev Hub cannot be turned off.
  • **Requires** a user with **ModifyAllData** or **ModifyMetadata** (a **System

Administrator** has these). A user without them gets `INSUFFICIENT_ACCESS`.

  • **Cannot** be enabled in a **sandbox**, or in an org that has a **registered

namespace**. The script checks the org's edition/sandbox facts before an `--enable --apply` and refuses (no deploy attempted) if the target is a sandbox; there's no reliable CLI signal for a registered namespace, so that stays a documented caveat rather than an enforced check.

  • Available in **Developer, Enterprise, Performance, Unlimited**, and **trial**

editions — `status` and `--allocation` show the org's edition when known.

Steps

1. **CRITICAL:** Run the bundled helper script, which handles Dev Hub detection, the enablement deploy (with a safe dry-run default), allocation math, and structured output, and works on macOS and Linux. Always invoke it by **absolute path** from the skill directory — never `./scripts/`, which resolves against the user's current directory and will either run the wrong script or fail. The script self-checks this: if `$0` is not absolute it exits with a usage error, so pass the full path to `<skill_dir>` (the directory containing this SKILL.md).

   bash "<skill_dir>/scripts/devhub.sh" <alias-or-username>            # status: on? + edition + allocation
   bash "<skill_dir>/scripts/devhub.sh"                               # default org (target-org
Read more
@forcedotcom
Ships withsf-skills

This repository provides Salesforce agent skills, plugins, and sample apps for building applications.

1.1k200 skills6 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of forcedotcom/sf-skills on GitHub, a chart by star-history.com

Other skills on sf-skills.

agentforce-observe

agentforce-observe

Analyze production Agentforce agent behavior using session traces and Data Cloud, and manage Agent Health Monitoring (AHM)…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about dx-org-devhub-configure.

Which coding agents can use dx-org-devhub-configure?
dx-org-devhub-configure installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.