38

Where can I find the list of all commands available in VSCode and their description?

I'm only aware of these sources:

In the official docs:

  • This list which only seems to include a subset of Visual Studio Code commands that you might use with vscode.commands.executeCommand API (why is this only a subset of the full list?)
  • This other list in the keybindings doc, which also only seems to include a subset of all commands available (I suppose those tied to a default keybinding?)

In the editor itself:

I can see a list of commands when I open the "default keybindings". Many actions are commented out with //, but interestingly I don't think this includes all the commands either (e.g. maximizeOtherEditor isn't listed)


Does VSCode have an official list of commands (commandID's) either in its documentation or in its code base? If not:

  • What's the closest to it?
  • What's a good way to navigate the code base to try to find all commands and what they do?
Community
  • 1
  • 1
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
  • Are you talking about command pallette commands? –  Oct 14 '19 at 03:33
  • 1
    Thanks @ShawnMelton I'm talking about `command IDs` (e.g. `workbench.action.joinAllGroups`). Are they different? What's their relationship? – Amelio Vazquez-Reina Oct 14 '19 at 13:36
  • If the reason for asking this question is that you want to manage your key-bindings, you _might_ be helped by [http://stackoverflow.com/questions/43184034#61729493](http://stackoverflow.com/questions/43184034#61729493). – Henke May 11 '20 at 12:56
  • 1
    This is an issue asking for that: https://github.com/microsoft/vscode-docs/issues/683. Guys who are led here by google, if you need it, please express your opinions there. – Betty Apr 11 '21 at 04:58

2 Answers2

30

I believe that content of "Preferences: Default Keyboard Shortcuts (JSON)" (command ID workbench.action.openDefaultKeybindingsFile) really shows comprehensive list of all native and extensions-contributed commands VSC knows about at moment when invoked.

This file shows keys from VSC's defaults and extension manifests. Commands with no suggested defaults are those commented out at the end of file.

Their descriptions (as seen in the Command Palette, Keyboard Shortcuts settings, extension Contributions tab and elsewhere) are supposedly in localization properties and I believe there is currently no way to see them along their respective command IDs in single convenient "localized" list. So for now the only way to read the description of command found in aforementioned JSON is pasting its ID into Keyboard Shortcuts search field. (Would be delighted to be proven wrong.)

myf
  • 9,874
  • 2
  • 37
  • 49
  • 8
    There is also a command `vscode.commands.getCommands()` which returns all available commands programaticaly. It does so without giving you details/a description/... though... – Michael Kopp Apr 07 '20 at 20:12
  • 5
    Even in `workbench.action.openDefaultKeybindingsFile` there are some commands missing. e.g.: `workbench.action.terminal.newWithCwd` defined here: https://code.visualstudio.com/updates/v1_39#_open-new-terminals-with-custom-working-directories – Diogo Apr 30 '20 at 17:34
  • You are right indeed. What is strange is that this command is completely omitted from Keyboard Shortcuts GUI (perhaps because this "args" command kind have no GUI in general?), but *is* present in intellisense/validation of the keybindings.json – myf Apr 30 '20 at 19:22
  • It's also missing "Feature Contributions" from extensions, I came across this post hoping to find a solution to getting a full list of all extension's available commands as well as all internal commands. – TryTryAgain May 07 '20 at 06:59
15

In case someone ever fell on this and just wanted a quick-list of VSCode commands to browse through: https://gist.github.com/skfarhat/4e88ef386c93b9dceb98121d9457edbf

If you do, please note the VSCode version and commit. These may well be out of date by the time you read them.

Sami Farhat
  • 1,164
  • 8
  • 12