IntelliJ IDEA: install plugins from command line
This is the workaround I found. To be clear: this is not what I was looking for, just the closest solution I found so far.
It is possible to download plugins for IntelliJ IDEA from the repository here: http://plugins.jetbrains.com/?idea_ce For example, here is the Scala plugin: http://plugins.jetbrains.com/plugin/1347?pr=idea_ce . Each version has a direct link.
Once downloaded, extract the zip file in ~/.IdeaIC13/config/plugins
(dependent on the platform and the version of IntelliJ you are running of course).
That's it. With a shaky combination of wget
and unzip
it is possible to install a plugin via the command line. Clearly not a great solution: for my use case (ie provisioning a workstation via Chef) I need to know in advance the URL to a specific plugin and I need to know the version of IntelliJ (to identify the config folder in the user's home).
Here is a one-liner to download/extract the latest version of a given plugin provided that you have jq
, bsdtar
, wget
and curl
in your PATH:
wget -qO- https://plugins.jetbrains.com/files/$(curl https://plugins.jetbrains.com/api/plugins/4415/updates | jq -r '.[0].file') | bsdtar -xvf- -C ~/.PhpStorm2018.3/config/plugins
Replace the numeric plugin ID and output directory as needed. Restarting the IDE will show downloaded plugin(s) as being installed.