I need a way to get a list of plugins so that I can use them with [docker jenkins](https://hub.docker.com/_/jenkins/) in the format `: ` ## 1. get the jenkins cli. The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call. ``` curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar ``` ## 2. create a groovy script. We need to create a groovy script to parse the information we receive from the jenkins API. This will output each plugin with its version. Save the following as `plugins.groovy`. ``` def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() plugins.each {println "${it.getShortName()}:${it.getVersion()}"} ``` ## 3. call the Jenkins API. Use jenkins-cli.jar to call the jenkins server where it is located (localhost:8080) in this case with the username and password you use for login and then output the results to plugins.txt ``` java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin: groovy = < plugins.groovy > plugins.txt ``` The output looks like this ``` trilead-api:1.0.6 gradle:1.36 cloudbees-folder:6.12 workflow-basic-steps:2.20 antisamy-markup-formatter:2.0 branch-api:2.5.6 jdk-tool:1.4 structs:1.20 handlebars:1.1.1 workflow-step-api:2.22 token-macro:2.12 ``` Enjoy!