Skip to content

Design Guidelines Resources

Matt Graham edited this page Apr 28, 2023 · 1 revision

Resources are the qualifing noun that the action acts upon. Resources are optional and used only when necessary. For example, in the command sf apex generate class, the resource class qualifies what the command apex generate will generate. In the command sf org login jwt, the resource jwt is the qualifying type of login that will take place.

In many of the core Salesforce CLI commands, if a required resource is missing, the command prompts for it. For example:

$ sf org login
$ Which of these commands do you mean (Use arrow keys)
→ org login access-token     Authorize an org using an existing Salesforce access token.
  org login device           Authorize an org using a device code.
  org login jwt              Log in to a Salesforce org using a JSON web token (JWT).
  org login sfdx-url         Authorize an org using a Salesforce DX authorization URL stored in a file.
  org login web              Log in to a Salesforce org using the web server flow.

Guidelines

  • Resources are optional.
  • Resources are nouns.

Good Examples

  • sf org create sandbox
  • sf org login jwt
  • sf apex generate class
  • sf cmdt create record
Clone this wiki locally