Things I Learned #3: VS Code, extensions, and the command line

less than 1 minute read til learning   vscode Comments

In my last TIL post, I talked about using VS Code to perform a diff by using

code --diff file1 file2
BTW, the --diff can be shortened to just -d.

In this edition of Things I Learned, I want to talk a little more about using Visual Studio Code from the command line. There are several good command-line arguments I've learned about recently.


The first argument is one that lets you output your list of installed extensions

code --list-extensions
If you want the versions, tack on
Here's the output when I run it
A windows terminal showing the output from code dash dash list dash extensions dash dash show dash versions
Getting a list of installed extensions in Visual Studio Code

You can also install an extension by

code --install-extension publisher.extension
So, to install the Vim extension, it would look like this:
code --install-extension vscodevim.vim
If you want to avoid any prompts, you can add

You can remove an extension using

code --uninstall-extension publisher.extension

If you're having problems with Visual Studio Code, you can start it with all extensions disabled, too:

code --disable-extensions