Newer Version Available
Install Packages with the CLI
Before you install a package to a scratch org, run this command to list all the packages and locate the ID or package alias.
1sf package version listIdentify the version you want to install. Enter this command, supplying the package alias or package ID (starts with 04t).
1sf package install --package "Expense Manager@1.2.0-12" --target-org jdoe@example.comIf you’ve already set the scratch org with a default username, enter just the package version ID.
1sf package install --package "Expense Manager@1.2.0-12"The CLI displays status messages regarding the installation.
1Waiting for the subscriber package version install request to get processed. Status = InProgress Successfully installed the subscriber package version: 04txx0000000FIuAAM.Control Package Installation Timeouts
When you issue a sf package install command, it takes a few minutes for a package version to become available in the target org and for installation to complete. To allow sufficient time for a successful install, use these parameters that represent mutually exclusive timers.
-
--publish-wait defines the maximum number of minutes that
the command waits for the package version to be available in the target org. The default is 0.
If the package is not available in the target org in this time frame, the install is
terminated.
Setting --publish-wait is useful when you create a new package version and then immediately try to install it to target orgs.
- --wait defines the maximum number of minutes that the command waits for the installation to complete after the package is available. The default is 0. When the --waitinterval ends, the install command completes, but the installation continues until it either fails or succeeds. You can poll the status of the installation using sf package install report.
1sf package install --package "Expense Manager@1.2.0-12" --publish-wait 3 --wait 101sf package install --package "Expense Manager@1.2.0-12" --publish-wait 6 --wait 10