$ jenkins

Manage Jenkins CI/CD
from the command line.

Trigger builds, stream console logs, and manage jobs, nodes, plugins, credentials, pipelines, and views — all without leaving the terminal.

MIT License macOS · Linux · Windows Go 1.21+

Install

Pick whichever fits — the install script handles platform detection and PATH setup.

Recommended — install script
curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/jenkins-cli/main/install.sh | sh
Via Go
go install github.com/piyush-gambhir/jenkins-cli@latest
Build from source
git clone https://github.com/piyush-gambhir/jenkins-cli.git
cd jenkins-cli
go build -o jenkins .
sudo mv jenkins /usr/local/bin/
From releases

Download a prebuilt binary for your platform from the releases page and place it on your PATH.

Quick start

Authenticate once, then operate.

# 1. Authenticate (saves a profile to ~/.config/jenkins-cli/)
jenkins login

# 2. Show server status
jenkins status

# 3. List jobs
jenkins job list
jenkins job list --recursive --status FAILURE

# 4. Trigger a build
jenkins build trigger my-pipeline

# 5. Stream console logs in real time
jenkins build logs my-pipeline --latest --follow

# 6. List nodes / build agents
jenkins node list

# 7. Pipe JSON to jq
jenkins job list -o json | jq '.[].name'

Authentication

CLI flags > environment variables > saved profile.

Interactive login
jenkins login
jenkins login --name staging
Environment variables
export JENKINS_URL=https://jenkins.example.com
export JENKINS_USERNAME=admin
export JENKINS_TOKEN=your-api-token
Multiple profiles
jenkins login                              # saves as default
jenkins login --name staging               # save a named profile
jenkins config use-profile prod            # switch active profile
jenkins job list --profile staging         # one-off override

Commands

Each group has its own --help for full flag and example documentation.

Top-level groups
jenkins jobCreate, list, get, configure, delete jobs
jenkins buildTrigger, list, get, abort builds; stream logs
jenkins pipelinePipeline-aware build operations
jenkins nodeManage build agents (list, enable, disable)
jenkins pluginList, install, and update plugins
jenkins credentialInspect credential stores
jenkins viewManage Jenkins views
jenkins folderManage folders and nested jobs
jenkins userList and inspect users
jenkins configView/set configuration, manage profiles
jenkins statusServer connection status and info
jenkins whoamiShow currently authenticated user
jenkins loginInteractive authentication setup
jenkins versionPrint CLI version
jenkins updateSelf-update to the latest release
Common build operations
# Trigger a build with parameters
jenkins build trigger my-pipeline --param ENV=staging --param VERSION=1.2.3

# List the last 10 builds for a job
jenkins build list my-pipeline --limit 10

# Get the latest build's status
jenkins build get my-pipeline --latest -o json

# Stream logs for a specific build number
jenkins build logs my-pipeline --build 42 --follow

# Abort a running build
jenkins build abort my-pipeline --latest
Output formats
jenkins job list                  # table (default)
jenkins job list -o json          # JSON
jenkins job list -o yaml          # YAML
Full reference on github.com/piyush-gambhir/jenkins-cli ↗