Cheatography
https://cheatography.com
Salesforce CLI Command Reference
This is a draft cheat sheet. It is a work in progress and is not finished yet.
sf alias
sf alias list |
List all aliases currently set on your local computer. |
sf alias set alias='value' |
Set one or more aliases on your local computer. |
sf alias unset alias my-other-alias |
Unset one or more aliases that are currently set on your local computer. |
[-a|-all] : Unset all currently set aliases.
[-p|--no-prompt] : Don't prompt the user for confirmation when unsetting all alliases.
sf config
sf config get CONFIG_VARIABLE [--verbose] |
Get the value of a configuration variable. --verbose : Display whether the configuration variables are set locally or globally. |
sf config list |
List the configuration variables that you've previously set. |
sf config set CONFIG_VARIABLE=NEW_VALUE [-g|--global] |
Set one or more configuration variables, such as your default org. [-g|--global] : Set the configuration variables globally, so they can be used from any Salesforce DX project. |
sf config unset CONFIG_VARIABLE [-g|--global] |
Unset local or global configuration variables. [-g|--global] : Unset the configuration variables globally. |
CONFIG_VARIABLE can be multiple variables separated by space, e.g., target-org api-version.
Configuration Variables
|
The API version for a specific project or all projects. Normally, Salesforce CLI assumes that you’re using the same version of the CLI as the Dev Hub org. |
|
The username or alias for an org that all commands run against by default. |
|
The username or alias for your default Dev Hub org. |
|
|
sf org create
sf org create sandbox |
Create a sandbox org. |
sf org create scratch |
Create a scratch org |
sf org create shape |
Create a scratch org configuration (shape) based on the specified source org. |
sf org create snapshot |
Create a snapshot of a scratch org. |
sf org create user |
Create a user for a scratch org. |
sf org login
sf org login access-token |
Authorize an org using an existing Salesforce access token. |
-r|--instance-url INSTANCE-URL |
URL of the instance that the org lives on. If you specify an --instance-url value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To specify a My Domain URL, use the format "https://<MyDomainName>.my.salesforce.com". To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com". |
sf org login device |
Authorize an org using a device code. |
sf org login jwt |
Log in to a Salesforce org using a JSON web token (JWT). |
sf org login sfdx-url |
Authorize an org using a Salesforce DX authorization URL stored in a file or through standard input (stdin). |
sf org login web |
Log in to a Salesforce org using the web server flow. |
Universal attributes:
[-a|--alias] : Alias for the org.
[-s|--set-default] : Set the authenticated org as the default that all org-related commands run against.
[-d|--set-default-dev-hub] : Set the authenticated org as the default Dev Hub.
|