Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to export your VS Code extensions from terminal

How to export your VS Code extensions from terminal

Note: Unix-like systems only.

  1. Export your extensions to a shell file:
code --list-extensions | sed -e 's/^/code --install-extension /' > my_vscode_extensions.sh
  1. Verify your extensions installer file:
less my_vscode_extesions.sh

Install your extensions (optional)

Run your my_vscode_extensions.sh using Bash command:

bash my_vscode_extensions.sh
@Chusynuk

This comment has been minimized.

Copy link

@Chusynuk Chusynuk commented Apr 16, 2020

Top! super useful!
Thanks :)

@Siniliote

This comment has been minimized.

Copy link

@Siniliote Siniliote commented Jul 2, 2020

Hi, great idea.
But i have this error :

code --list-extensions | sed -e 's/^/code --install-extension /' > my_vscode_extensions.sh
Ignoring option list-extensions: not supported for code.
@joseluisq

This comment has been minimized.

Copy link
Owner Author

@joseluisq joseluisq commented Jul 2, 2020

@Siniliote I'm not sure why you have no that option. Verify if you have the latest VSCode installed as well as you have made Install 'code' command in PATH from VSCode editor. Then just try it out code --list-extensions to check if everything works.

@Siniliote

This comment has been minimized.

Copy link

@Siniliote Siniliote commented Jul 2, 2020

@joseluisq
My version in my wsl :

~ code -v
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
@Siniliote

This comment has been minimized.

Copy link

@Siniliote Siniliote commented Jul 2, 2020

It's very strange...
Works with CLI cmd.exe and powershell.exe.
Not with wsl 2 in Ubuntu.

With CLI wsl 2

~ code --help
code 1.46.1

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -a --add <folder>                 Add folder(s) to the last active window.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before returning.
  --locale <locale>                 The locale to use (e.g. en-US or zh-TW).
  -h --help                         Print usage.

Extensions Management
  --category                           Filters installed extensions by provided category, when using --list-extension.
  --enable-proposed-api <extension-id> Enables proposed API features for extensions. Can receive one or more extension
                                       IDs to enable individually.

Troubleshooting
  -v --version                       Print version.
  --verbose                          Print verbose output (implies --wait).
  --log <level>                      Log level to use. Default is 'info'. Allowed values are 'critical', 'error',
                                     'warn', 'info', 'debug', 'trace', 'off'.
  -s --status                        Print process usage and diagnostics information.
  --prof-startup                     Run CPU profiler during startup
  --disable-extensions               Disable all installed extensions.
  --disable-extension <extension-id> Disable an extension.
  --sync <on> <off>                  Turn sync on or off
  --inspect-extensions <port>        Allow debugging and profiling of extensions. Check the developer tools for the
                                     connection URI.
  --inspect-brk-extensions <port>    Allow debugging and profiling of extensions with the extension host being paused
                                     after start. Check the developer tools for the connection URI.
  --disable-gpu                      Disable GPU hardware acceleration.
  --max-memory                       Max memory size for a window (in Mbytes).
  --telemetry                        Shows all telemetry events which VS code collects.

With CLI cmd.exe

C:\Users\siniliote>code --help
Visual Studio Code 1.46.1

Usage: code.exe [options][paths...]

To read output from another program, append '-' (e.g. 'echo Hello World | code.exe -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -a --add <folder>                 Add folder(s) to the last active window.
  -g --goto <file:line[:character]> Open a file at the path on the specified
                                    line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an
                                    already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before
                                    returning.
  --locale <locale>                 The locale to use (e.g. en-US or zh-TW).
  --user-data-dir <dir>             Specifies the directory that user data is
                                    kept in. Can be used to open multiple
                                    distinct instances of Code.
  -h --help                         Print usage.

Extensions Management
  --extensions-dir <dir>                            Set the root path for
                                                    extensions.
  --list-extensions                                 List the installed
                                                    extensions.
  --show-versions                                   Show versions of installed
                                                    extensions, when using
                                                    --list-extension.
  --category                                        Filters installed
                                                    extensions by provided
                                                    category, when using
                                                    --list-extension.
  --install-extension <extension-id | path-to-vsix> Installs or updates the
                                                    extension. Use `--force`
                                                    argument to avoid
                                                    prompts.
  --uninstall-extension <extension-id>              Uninstalls an extension.
  --enable-proposed-api <extension-id>              Enables proposed API
                                                    features for extensions.
                                                    Can receive one or more
                                                    extension IDs to enable
                                                    individually.

Troubleshooting
  -v --version                       Print version.
  --verbose                          Print verbose output (implies --wait).
  --log <level>                      Log level to use. Default is 'info'.
                                     Allowed values are 'critical', 'error',
                                     'warn', 'info', 'debug', 'trace', 'off'.
  -s --status                        Print process usage and diagnostics
                                     information.
  --prof-startup                     Run CPU profiler during startup
  --disable-extensions               Disable all installed extensions.
  --disable-extension <extension-id> Disable an extension.
  --sync <on> <off>                  Turn sync on or off
  --inspect-extensions <port>        Allow debugging and profiling of
                                     extensions. Check the developer tools for
                                     the connection URI.
  --inspect-brk-extensions <port>    Allow debugging and profiling of
                                     extensions with the extension host being
                                     paused after start. Check the developer
                                     tools for the connection URI.
  --disable-gpu                      Disable GPU hardware acceleration.
  --max-memory                       Max memory size for a window (in Mbytes).
  --telemetry                        Shows all telemetry events which VS code
                                     collects.
@Siniliote

This comment has been minimized.

Copy link

@Siniliote Siniliote commented Jul 2, 2020

I'm solved... In my wsl/ubuntu it's vscode-server not vscode.

@joseluisq

This comment has been minimized.

Copy link
Owner Author

@joseluisq joseluisq commented Jul 2, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.