How to get the version of installed plugins via terminal?

Hi!

I’m working in a script to get some information about IntelliJ installation. I was able to get all plugins installed, looking at the plugin’s folder.
Now I want to get the version of the installed plugin, I tried to look to other folders and documentation but didn’t found anything :confused:
Is possible to get the version of the installed plugins, via a script?

EDIT:
Adding more information, e.g. in VSCode is possible to run code --list-extensions --show-versions to get version of installed extensions (plugins) or in the folder it has the version in the name of the plugin folder.

Could you please explain your use case? And why you collect this information outside of the IDE?

Sure, I’m working in an enterprise solution to get information about dev environment from devs in the company, to understand better tools that are being used, versions, etc…
So, it is a script that runs by default on users machine. It already exists, I’m now checking how to get those kind of information about IDEs and plugins.

1 Like

While this is mostly used internally only, this library should help inspecting plugins: intellij-plugin-verifier/intellij-plugin-structure at master · JetBrains/intellij-plugin-verifier · GitHub

This might be interesting as well as an out-of-the-box solution to manage IDEs JetBrains IDE Services – Elevating Developer Productivity to Enterprise Scale

2 Likes

You can also extract the plugins version string from their META-INF/plugin.xml file. This will work for most (all?) third-party plugins. For each plugin lib folder find the nameOfThePlugin.jar file (the other jar files are dependencies and, optionally, the searchableOptions jar), then read the version from META-INF/plugin.xml.

You could also develop a small plugin for that. This plugin would simply export the list of installed plugin.

find the nameOfThePlugin.jar file […]

That is not the true always. The plugin “main” JAR file can have an arbitrary name (and will).

thanks! Where I can find those .jars?

The basic structure is explained here Plugin Content | IntelliJ Platform Plugin SDK

1 Like

Sure, this is not exactly the name of the plugin, but you can put some intelligence in your code :slight_smile: Normalize names, filter jars containing a plugin.xml that looks like a JB plugin…

1 Like

@afucher - I’m looking to do something very similar. By chance, is your work/code for this somewhere in OSS? I’d love to take a look and leverage what you’ve done as a starting point/inspiration. :folded_hands: