Jenkins CLI

Installation

Install the prebuilt Jenkins CLI binary or build it from source.

Installs the latest prebuilt binary for your OS and architecture. No Go toolchain required:

curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/jenkins-cli/main/install.sh | sh

Pin a version or change the install directory:

curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/jenkins-cli/main/install.sh | VERSION=0.2.7 sh
curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/jenkins-cli/main/install.sh | INSTALL_DIR=~/.local/bin sh

The install script supports macOS and Linux on amd64 and arm64. It installs to /usr/local/bin by default and uses sudo only when that directory is not writable.

Download a release manually

Prebuilt archives are attached to each GitHub Release. Download the archive for your platform, extract it, and put jenkins on your PATH. Windows builds ship as jenkins-cli_windows_amd64.zip containing jenkins.exe.

The install script expects assets named jenkins-cli_<os>_<arch>.tar.gz, where <os> is darwin or linux and <arch> is amd64 or arm64.

Build from source

The Go module lives in cli-go/ and declares Go 1.27 with a Go 1.27.2 toolchain:

git clone https://github.com/piyush-gambhir/jenkins-cli.git
cd jenkins-cli/cli-go && make install

make install installs the jenkins binary to your Go binary directory.

Verify

jenkins version

Updating

jenkins update installs the latest release on macOS, Linux, and Windows. It shows v<current> -> v<latest> and asks before installing; pass --yes to skip the prompt. jenkins update --check only reports (-o json for scripts).

jenkins update
jenkins update --yes
jenkins update --check -o json

The archive is verified against the release's checksums.txt (SHA-256) before the binary is replaced, and any failure leaves the current binary in place. On Windows the running jenkins.exe is renamed to jenkins.exe.old and deleted on a later start. If the binary's directory is not writable, re-run with sudo jenkins update (an Administrator terminal on Windows) or reinstall with the install script into a directory you own. A binary built with make install lives in your Go bin directory and is not replaced: update it with git pull && make install in your jenkins-cli/cli-go checkout.

Update notice

In an interactive terminal, jenkins checks GitHub at most once a day in the background and prints a notice on stderr after the command's output when a new release exists:

A new version of jenkins is available: v0.2.8 -> v0.2.9
Update with: jenkins update
Release notes: https://github.com/piyush-gambhir/jenkins-cli/releases/tag/v0.2.9

A command that finishes before the day's check answers waits for it at most 1 second (so at most once a day). The notice is skipped when stderr is not a terminal, CI is set, JENKINS_NO_UPDATE_NOTIFIER or NO_UPDATE_NOTIFIER is set, or --quiet is on. Turn it off with export JENKINS_NO_UPDATE_NOTIFIER=1.