Sublime Forum

Install plugins from command line

#1

Hi,

I don’t seem to see a way to install plugins from command-line, instead of from inside ST. I think this feature will be greatly useful when setup new dev environment via script with a set of pre-selected plugins.
For example in Mac I can write a script that can set up a whole dev environment, where I use ‘brew cask’ to install ST3, then a number of other commands to install the plugin set.
In addition, I can copy a saved Setting file into the newly installed ST3

0 Likes

#2
  1. Write a JSON file to {DATA}/Packages/User/Package Control.sublime-settings containing:

    {
        "installed_packages": ["Package 1", "Package 2"]
    }
    
  2. Download https://packagecontrol.io/Package%20Control.sublime-package into {DATA}/Installed Packages/.

  3. Start Sublime Text

You can find the location of the data directory at the beginning of http://www.sublimetext.com/docs/3/revert.html.

3 Likes

#3

Following the paths listed on:

  1. http://www.sublimetext.com/docs/3/revert.html

For git repositories you can clone them on the Sublime Text Packages folder using the command:

 git clone http://repo.url

You can also create a master repository within all the packages you want to as git submodules. Then you just need to clone them with:

git clone --recursive http://repo.url

I did one where you can install everything at once, including Package Control, in a Sublime Text fresh install. You can look into the install instructions at:

  1. https://github.com/evandrocoan/SublimeTextStudio#installation

Currently I am working on it to allow automatic updates from my fork’s upstream, and also create a new channels from a set of git repositories listed.

0 Likes

#4

Thank you, it’s really helpful.
I remember MS Visual Studio Code have this support built-in - there provided some command line that will figure out the path for you.

0 Likes