Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install list of extensions #42994

Closed
malorus opened this issue Feb 5, 2018 · 12 comments
Closed

Install list of extensions #42994

malorus opened this issue Feb 5, 2018 · 12 comments
Assignees
Labels
extensions Issues concerning extensions

Comments

@malorus
Copy link

malorus commented Feb 5, 2018

I was about to transfer a set of 20 extensions to another instance of VSC on another machine. In Atom it works simply with two commands:
create a list with all extensions
apm list --installed --bare > packages.list

Install all extensions from list
apm install --packages-file packages.list

I know you have the possibility to install via cli as well in VSC, but it is somewhat weird. I can list all the extensions and save them in a list:
code --list-extensions > extensions.list

But from that point on it's overcomplicated as I'm not able to install from a list. So, in a powershell I now use something like
foreach($line in get-content extensions.list) {code --install-extension $($line)}

But I'd wish there was a built-in method to install from a list, like in Atom. Please consider this in a future update.

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Feb 5, 2018
@octref octref added the feature-request Request for new features or functionality label Feb 5, 2018
@sandy081 sandy081 added this to the Backlog milestone Feb 6, 2018
@Nowaker
Copy link

Nowaker commented Feb 13, 2018

Linux/Mac:

cat extensions.list | xargs -L1 code --install-extension

@alexriedl
Copy link

I use this for windows cmd:
for /F "tokens=*" %%A in (extensions.list) do code --install-extension %%A

and this for bash:
<extensions.list xargs -I % code --install-extension %

@jcrben
Copy link

jcrben commented Mar 10, 2018

@Tyriar uses this script http://www.growingwiththeweb.com/2016/06/syncing-vscode-extensions.html

@andreysaksonov
Copy link

andreysaksonov commented May 24, 2018

I guess vscode-way of doing this is .vscode/extensions.json file in the workspace https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions
You can create empty workspace with this file, push it to your github and use it as bootstrap to install your favorite extensions

@jtkiley
Copy link

jtkiley commented Jun 9, 2018

I'd like to see this for the same reasons as @malorus (i.e. syncing across machines) with a couple of additions:

  1. Allow the command to read a file with a list of extensions that also supports comments. At a certain number of extensions, it's nice to break them down by category, especially for reviewing them periodically to see if they're still important.
  2. For each, check whether they are installed before reinstalling them. The reason is that it's nice to take a list like this, put it in a dotfiles repository, and then regularly run the command in a script so that extensions are just there (within a reasonable time) across machines once you commit the update to the dotfiles repository. Without the check, it's a lot of unnecessary work to keep reinstalling extensions daily (or at whatever interval a script would run). Similarly, it might be nice to have an option or another command that uninstalls any extensions that are not in the list.

@twk-b
Copy link

twk-b commented Oct 14, 2018

needed for onboarding new developers more quickly.

@Nowaker
Copy link

Nowaker commented Oct 14, 2018

@jtkiley Re 1:

cat extensions.list | grep -v '^#' | xargs -L1 code --install-extension

Any line that starts with # will get ignored.

@sandy081 sandy081 modified the milestones: Backlog, October 2018 Oct 16, 2018
@sandy081 sandy081 modified the milestones: October 2018, On Deck Oct 29, 2018
@lucmos
Copy link

lucmos commented Nov 9, 2018

I'd like to see this for the same reasons as @malorus (i.e. syncing across machines) with a couple of additions:

  1. Allow the command to read a file with a list of extensions that also supports comments. At a certain number of extensions, it's nice to break them down by category, especially for reviewing them periodically to see if they're still important.
  2. For each, check whether they are installed before reinstalling them. The reason is that it's nice to take a list like this, put it in a dotfiles repository, and then regularly run the command in a script so that extensions are just there (within a reasonable time) across machines once you commit the update to the dotfiles repository. Without the check, it's a lot of unnecessary work to keep reinstalling extensions daily (or at whatever interval a script would run). Similarly, it might be nice to have an option or another command that uninstalls any extensions that are not in the list.

I arrived here searching exactly for this: a method to sync extensions through a dotfile, like in sublime text.
The extensions installed and the names in this dotfile should be on a 1-1 correspondence.

I hope this feature will be implemented!

sandy081 added a commit that referenced this issue Jan 10, 2019
@sandy081 sandy081 removed this from the On Deck milestone Jan 10, 2019
@sandy081 sandy081 removed the feature-request Request for new features or functionality label Jan 10, 2019
@sandy081
Copy link
Member

Following command from @Nowaker looks to me a reasonable solution for this.

cat extensions.list | grep -v '^#' | xargs -L1 code --install-extension

Hence closing this.

@lucmos
Copy link

lucmos commented Jan 10, 2019

I still would like to be able to manage all the settings, extension, etc. using just an unique approach (to almost all applications) like YADM

Isn't the package manager of Sublime Text a successful example to follow?

sandy081 added a commit that referenced this issue Jan 10, 2019
@sandy081
Copy link
Member

@jtkiley
Copy link

jtkiley commented Jan 27, 2019

@Nowaker I finally got around to adding this to my dotfiles, and it works really nicely. Many thanks!

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions
Projects
None yet
Development

No branches or pull requests

11 participants