Jenkins has a built-in command line client interface that allows you to access Jenkins from a script or from your shell. This is convenient for automation of routine tasks, bulk updates, trouble diagnosis, and so on.
This interface is accessed via the Jenkins CLI client, which is distributed inside
jenkins.war as a jar file. See
//yourserver.com/cli for where to download the CLI jar file. a Java JAR file distributed with Jenkins.
Obtaining the CLI client
You can download the JAR file for the client from the URL "
/cli" on your Jenkins server, e.g.
In theory, the CLI jar JAR is dependent on the version of Jenkins, but in practice, we expect to be able to retain compatibility between different versions of Jenkins. In case of problems, just re-download the latest JAR from your Jenkins server.
Running a CLI command
The general syntax is as follows (the design is similar to tools like svn/git):
java -jar jenkins-cli.jar -s yourserver.https://jenkins.example.com help [command]
Detailed description More detailed help for individiual commands can be obtained providing command name or visiting command page in Jenkins UI.
found by adding the command name after
The same information is available via the web UI, by clicking on a command name on the Jenkins CLI page.
Extending the CLI
Plugins installed on Jenkins server can add custom CLI commands. See writing CLI commands for more details.