In this blog, I would like to share with you the available Salesforce CLI Commands. CLI Commands will reduce your effort in creating and configuring the Apex, Visualforce, Lightning components. Refer to my previous blogs for setting up the SFDX with visual studio code IDE.
Prerequisites
- Install Visual Studio Code v1.23 or later
- Install SFDX Command Line Interface
- Install this extension ‘Salesforce CLI Integration for Visual Studio Code‘
- Go through my blogs –
Run Salesforce CLI Commands
To run the command from Visual Studio Code, open the command palette by pressing Ctrl + Shift + P or Cmd + Shift + P or from the Integrated terminal (Ctrl+| Cmd+`).
SFDX Commands – on Command Palette
Integrated Terminal – with Login CLI Command
Available Salesforce CLI Commands
- Authorize Or Login To An Org Using The Web-Based Flow
force:auth:web:login —clientid —setdefaultdevhubusername —setalias —instanceurl <https://test.salesforce.com>
-
- setdefaultdevhubusername – set the org to be default developer hub org. optional parameter
- setalias – to set the alias name for the connected org by mapping the session id (only generated on successful login)
- clientid – Consumer key of the connected app, optional parameter
- instanceurl – Instance Url of the org to be connected, https://login.salesforce.com be the default instance URL
Use the –setdefaultdevhubusername parameter only when authorizing a Dev Hub org. Do not use it when authorizing to other orgs, such as a sandbox.
2.Logout From Connected Orgs
force:auth:logout –all | –targetusername – -noprompt
- – -all | -a – Includes all authenticated orgs: for example, Dev Hubs, sandboxes, DE orgs, and expired, deleted, and unknown-status scratch orgs, Optional
- – -noprompt |-p – do not prompt for confirmation, Optional
- – -targetusername | -u – a username or alias for the target org. Overrides the default target org, Optional
– – all and – -targetusername can’t be used together.
3.Lists All Orgs That The Salesforce CLI Has Created Or Authenticated
sfdx force:org:list – -all
- – -all –Lists all authenticated orgs, including expired, deleted, and unknown-status scratch orgs, Optional
- – -clean – Remove all local org authorizations for deleted or expired orgs, Optional
- -p |- -noprompt – Do not prompt for confirmation, Optional
4.Lists All Alias
sfdx force:alias:list
Lists the aliases that the Salesforce CLI can use for various commands and tasks
5. Open A Connected Org Or Org Component
Opens an org in your browser.
sfdx force:org:open -u <Alias | username> -p <Path to components>
- -p | –path- Navigation URL path (not including domain), Optional
- -r | –urlonly – Displays a navigation URL but doesn’t launch your browse, Optional
- -u | –targetusername – username or alias for the target org. Overrides the default target org, Optional
Example
sfdx force:org:open -u sfdcEvangel
sfdx force:org:open –path one/one.app
In the next blog, I will explain about the commands related to scratch org management.
Don’t forget to share the post if you like it & bookmark the blog for future references. If you have any comments or doubts on this post, Please comment on the box.
References
'스타 블로그' 카테고리의 다른 글
Custom Validation In A Lightning Input Field Component (0) | 2022.04.16 |
---|---|
Custom Lightning Page Template / Layout (0) | 2022.04.16 |
Lightning Component For Communicating Server Side Aura Method (0) | 2022.04.16 |
쿠리야마 리오 인★ 화보같은 사진 모음 (0) | 2022.04.08 |
DevOps (0) | 2022.03.13 |