I have connecting command prompt to salesforce using below commands.

cd salesforce CLI
cd bin
sfdx force:auth:web:login -d -a DevHub

But i cant able to connect Visual studio code to salesforce. i have installed visual studio code in my system. at the same time Salesforce CLI Integration and Salesforce Extension Pack also installed. but selecforce connecting commands are not showing.

how to connect visual studio code to salesforce. And what are the commands we need to pass.

  • There are no commands to pass; once everything is installed, it should just work. Have you (a) restarted VS Code and/or (b) restarted your computer? Also, if Salesforce CLI is not in your %PATH%, VS Code will not be able to work with it. I recommend restarting and/or reinstalling Salesforce DX to see if that fixes things. – sfdcfox Jan 17 '19 at 6:43

I had the same issue of not connecting to salesforce but I followed below link and was able to reinstall everything.

change the org to your org in project-scratch-def.json and use SFDX: Authorize an org https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce/start-vscode


In order to connect VSCode to Salesforce orgs, you need to install:

When you have SFDX Cli and Salesforce Extension Pack installed you need to create a project folder for your org. You can either run the following command in terminal/command prompt

sfdx force:project:create --projectname "name of your's project folder" --manifest

or in VSCode open "Command Pallete" and type SFDX: Create Project and follow the wizard.

enter image description here

After you have a project folder in SFDX format you will be able to connect it to the Salesforce org. To do so you have a few options:

  • Authorize a new org through the cli and set it as default for the current project (you need to run that command from the project folder)
sfdx force:auth:web -a "alias-for-the-org" --setdefaultusername
  • Set previously authorized org as the default org for the current project
sfdx force:config:set defaultusername=alias-for-another-org
  • Open "Org Launcher" in the VSCode and select previously authorized org / authorize a new one

enter image description here


I had followed this blog to resolve my issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.