Frequently Used Packaging Operations for Second-Generation Managed Packages

For a complete list of Salesforce CLI packaging commands, see: Salesforce Command Line Reference Guide.

Salesforce CLI commandWhat it Does
sf package createCreates a package. When you create a package, you specify its package type and name, among other things.
sf package version createCreates a package version.
sf package installInstalls a package version in a scratch, sandbox, or production org.
sf package uninstallRemoves a package that has been installed in an org. This process deletes the metadata and data associated with the package.
sf package version promoteChanges the state of the package version from beta to the managed-released state.
sf org create scratchCreates a scratch org.
sf org openOpens an org in the browser.