How to export / import extensions with VSCode

I’ve found a simple of easy way to export / import extensions to VSCode using the command line terminal.

If you already have VSCode installed you should have access to the code command in the terminal. Try running it to verify that it works.

code --version

You have use the —list-extensions flag to get the list of installed extensions.

code --list-extensions

Use this command to do an export to a sh file like so.

code --list-extensions | xargs -L 1 echo code --install-extension > codeexts.sh

The above command will generate a codeexts.ts file that can be backed up and moved to wherever.

If you wanted to use the file to import extensions to VSCode you can use the sh command.

sh codeexts.sh