16

I have performed below steps-

  • Install CLI
  • Install extensions "Salesforce Extension Pack" and "Saleforce CLI Itegration"

I am getting only few SFDX command options in Command Palette. Also i have tried uninstall VS Code multiple times but issue still persists.

Please suggest if i am missing some steps here.

enter image description here

10 Answers 10

17

Oh, I know the answer. You have to create a project first. Then and only then the other commands will become available for you


Well, yeah. That's the answer. But just to make it cleaner for you. All the commands, that exists in the palette works with scratch orgs, which can't be used outside a project, because of project-scratch-org.json file, that defines the shape of your scratches

9
  • 2
    Thanks for your response, i have cloned project from GIT repository, still i don't see Auth command available under command palette. Do i need to create the scratch project first to get the command available? Dec 14, 2018 at 6:56
  • Well.. in case, if everything is set properly, you do not. May I ask you to list all the elements lay inside the folder? Dec 14, 2018 at 7:01
  • 1
    To be pedantic, it's the sfdx-project.json file that needs to exist.
    – sfdcfox
    Dec 14, 2018 at 7:22
  • 1
    Oke, I got it. So, here's the flow: 1) create a sfdx project; 2) clone the repo inside it Dec 14, 2018 at 7:22
  • 1
    after open the folder of the project or switching to the project folder, you still have to wait a few seconds (depending on the speed of your computer) for the extension to run, until it shows the error message "Error: we can't query your org at the bottom right pop up". I guess this means that the extension actually has started running. Then you will definitely see the authorize an org option.
    – Don
    Sep 5, 2022 at 9:30
7

I was having this same issue after I created a project and tried to open vscode and log in. The solution I found was going to file -> open folder -> choose the project folder created originally. The options to login option will be available in the command palette.

It was confusing since in the explorer panel the file directory was showing the project files.

2
  • 1
    This happens with me as well and somehow I repeated this step and it started working. Aug 25, 2021 at 15:16
  • 1
    This was exactly the trick. It didn't seem to make sense to have to open the folder for the project I just created. Guess VSC doesn't make any assumptions. ;)
    – Alexx
    Jan 11, 2022 at 19:14
3

I have also faced the same issue. In my case, I have just updated the Visual Studio code but not sfdx CLI. After updating sfdx CLI and restarting Visual Studio, I fixed the issue.

So these 2 may be the possible reason

  1. You do not have sfdx project or you are not on the root of the sfdx project. So create a new sfdx project or reopen root folder of your project via Visual Studio Code
  2. Your Visual Studio Code and sfdx CLI versions are not compactible. So update Visual Studio Code as well as sfdx CLI.
1

sometimes you will need to upgrade the Sforce extn pack or the sf CLI to the latest version. just uninstall the extensions and install again. also you need to create project manifest.

0

I had this issue even though I had a project open with a sfdx-project.json in the root. What ended up being the problem is that my folder path had a space at the end (don't ask me why, not sure):

"C:\path\to\folder \" <-- Notice the space at the end

So my two suggestions:

  1. Check your project's file path
  2. Use the developer console in VSCode (go to Help -> Toggle Developer Tools -> Go to Console Tab) to help debug
0

If tried the above and still not working:

  1. Create again a project with manifest in VSCode with the option Ctrl+P
  2. Once it is created, pay attention to a warning that VS Code throws in the right down corner of your screen saying "Would you like to install extensions in this project?". Hit YES.

After trying all the above, I found out that this was the problem. Somehow VS Code is not deploying the SFDX extension to the project from the very beginning.

0

Try running sfdx update from VSCode terminal (Even if you have just installed fresh from website). After updating, refresh VSCode by closing and restarting. Your Authorization command should work fine.

Cheers!

0

I also had this problem in spite of the fact that I was trying to run this command while I was in an sfdx project. What helped me resolve this was uninstalling the CLI and uninstalling the sfdx auth plugin then reinstalling both.

  1. sfdx plugins:uninstall auth

  2. sfdx plugins:install auth

  3. npm uninstall sfdx-cli --global

  4. npm install sfdx-cli --global

After doing this both the command palette and CLI command (sfdx auth:web:login) worked.

0

Just to add this screenshot for my comment under the best answer. One last trick is to wait for the extension to run after switching to a project folder. you will see an error message after the extension has run. after that you will have the authorize org option. enter image description here

0

This was happening to me as well. I'm not sure what's going on, but Visual Studio Code just seems to be moving slowly in general. I just waited a bit in combination with opening the project folder, and the option eventually showed up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .