sfpm
Getting started

Bootstrap your org

Install the sfpm helper packages into a DevHub with sfpm bootstrap, and choose a tier.

sfpm bootstrap installs sfpm's helper packages into a DevHub. For each package, it decides whether to build, promote, or install it, and it skips packages that are already current. The target org must be a DevHub. The command checks this before it does any package work, and stops if it is not.

What it installs

TierPackagesPurpose
core@b64hub/sfpm-artifactArtifact tracking custom setting (SfpmArtifact__c).
pool@b64hub/sfpm-artifact, @b64hub/sfpm-orgsAdds scratch org and sandbox pool management.
full@b64hub/sfpm-artifact, @b64hub/sfpm-orgs, @b64hub/sfpm-uiAdds the artifact history object and UI components.

Tiers are cumulative. pool includes core, and full includes pool.

This page lists the packages in each tier. The metadata inside each package comes from the sfpm-bootstrap repository and is not described here.

Choose a tier

  • With --tier, sfpm uses the tier you name.
  • Without --tier in an interactive terminal, sfpm asks you to choose one.
  • Without --tier in a non-interactive run, sfpm installs full. A run is non-interactive when you pass --json or --plain, when CI=true is set, or when the output is not a terminal.

In CI, a sfpm bootstrap run without --tier installs the full tier. Pass --tier explicitly in pipelines.

Run it

sfpm bootstrap -o my-devhub --tier core
FlagDescription
-o, --target-org <org>Required. The DevHub to bootstrap. The org must be a DevHub.
-t, --tier <tier>core, pool, or full. See the tier table above.
-f, --forceRebuild, re-promote, and re-install every package, even when it is current.
--jsonPrint the result as JSON.
--plainPrint plain text instead of the interactive display.

What each run does

For each package in the tier, sfpm compares the DevHub with the target org and picks one action:

  • build when the DevHub has no Package2 for the package, when the Package2 has no package versions yet, or when --force is set. sfpm creates the Package2 if it is missing, then builds a package version with org validation. An interactive run asks before it creates the Package2. A non-interactive run creates it without asking.
  • promote when no version has been released yet, but an unreleased version exists. sfpm promotes that version.
  • install when the installed version differs from the latest released version, or when nothing is installed. sfpm installs the released version into the target org, with the RunLocalTests test level.
  • skip when the installed version matches the latest released version.

The target org is both the DevHub that builds the packages and the org that receives the install.

Re-running the command is safe. It skips packages that are current and retries the ones that failed.

The command clones https://github.com/b64hub/sfpm-bootstrap into a temporary directory with git, and deletes that directory when it finishes. git must be on your PATH, and the machine needs network access to GitHub.

Next

For the commands that use a project after bootstrap, see the quick start.

On this page