Package development commands including creating, versioning, installing, listing, and promoting packages.
sf package DevelopmentCommands for package development.
Create package.
# Create unlocked package
sf package create --name MyPackage --package-type Unlocked --path force-app
# Create managed package
sf package create --name MyManagedPackage --package-type Managed --path force-app
Create package version.
# Create version
sf package version create --package MyPackage \
--code-coverage \
--installation-key MyKey123 \
--wait 10
Install package.
# Install by ID
sf package install --package 04txx --target-org myOrg
# Install by alias
sf package install --package "[email protected]" --target-org myOrg
# Install with wait
sf package install --package 04txx --target-org myOrg --wait 10
List packages and versions.
# List packages
sf package list --target-org myDevHub
# List versions for specific package
sf package version list --target-org myDevHub --packages MyPackage
Promote package version to released status.
sf package version promote --package "[email protected]" --target-org myDevHub
Uninstall package and report status.
# Uninstall package
sf package uninstall --package "[email protected]" --target-org myOrg
# Report status
sf package uninstall report --request-id <request-id> --target-org myOrg
Display package ancestry and dependencies.
# Display ancestry
sf package version displayancestry --package MyPackage --target-org myDevHub
# Display dependencies
sf package version displaydependencies --package 04txx --target-org myDevHub
Manage push upgrades (managed packages).
# Schedule push upgrade
sf package push-upgrade schedule --package 04txx --start-time "2024-01-15T10:00:00"
# Report status
sf package push-upgrade report --request-id <id>