Daniel
Daniel

Reputation: 309

Automating Installation of VS Code Plugins

I'm using VS Code with Ubuntu. I have a shell script to automate the installation of my development tools. I can install VS Code but I'm having trouble automating the installation of VS Code plugins e.g. the Python plugin

Is there an easy way to do this with a shell script?

Upvotes: 8

Views: 3654

Answers (2)

csaar
csaar

Reputation: 560

After installing VSCode, it provides a command line interface. So you can simply install an extension like this:

code --install-extension ms-python.python

If you have multiple extensions to install, you could create your own extension and bundle them in the "extensionPack" section (package.json), link.

Upvotes: 7

Jha Nitesh
Jha Nitesh

Reputation: 388

VSCode provides a command-line interface [LINK].

I am sharing how I automate installing VSCode and extensions on my mac.

1: Create a file setup-vscode into a specific directory. Include a list of extensions.

2: Go to the directory where setup-vscode located. simply type ./setup-vscode in your terminal.

#! /bin/sh
brew bundle --file=- <<EOF
  cask "visual-studio-code"
EOF

export PATH="$HOME/env:$PATH"

code --install-extension aaron-bond.better-comments
code --install-extension anseki.vscode-color
code --install-extension bierner.markdown-mermaid
code --install-extension CoenraadS.bracket-pair-colorizer
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension Gruntfuggly.todo-tree
code --install-extension HookyQR.beautify
code --install-extension kddejong.vscode-cfn-lint
code --install-extension markskelton.one-dark-pro-italic
code --install-extension ms-python.python
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension naumovs.color-highlight
code --install-extension oderwat.indent-rainbow
code --install-extension Prisma.vscode-graphql
code --install-extension vscodevim.vim
code --install-extension vscode-icons-team.vscode-icons

Upvotes: 0

Related Questions