## Using the CLI client 

While the SSH-based CLI is fast and covers most needs, there may be situations where the CLI client distributed with Jenkins is a better fit. For example, the default transport for the CLI client is HTTP which means no additional ports need to be opened in a firewall for its use. 

## Downloading the client 

The CLI client can be downloaded directly from a Jenkins master at the URL /jnlpJars/jenkins- cli.jar , in effect JENKINS_URL/jnlpJars/jenkins-cli.jar 

While a CLI .jar  can be used against different versions of Jenkins, should any compatibility issues arise during use, please re-download the latest .jar  file from the Jenkins master. 

## Using the client 

The general syntax for invoking the client is as follows: 

java -jar jenkins-cli.jar [-s JENKINS_URL] [global options...] command [command options...] [arguments...] 

The JENKINS_URL  can be specified via the environment variable $JENKINS_URL . Summaries of other general options can be displayed by running the client with no arguments at all. 

## Client connection modes 

There are three basic modes in which the 2.54+ / 2.46.2+ client may be used, selectable by global option: -http ; -ssh ; and -remoting . 

## HTTP connection mode 

This is the default mode as of 2.54 and 2.46.2, though you may pass the -http  option explicitly for clarity. 

Authentication is preferably with an -auth  option, which takes a username:apitoken  argument. Get your API token from /me/configure : 

java -jar jenkins-cli.jar [-s JENKINS_URL] -auth kohsuke:abc1234ffe4a command ... 

(Actual passwords are also accepted, but this is discouraged.) 

You can also precede the argument with @  to load the same content from a file: 

