Control Jenkins from the command line. Manage jobs, builds, pipelines, nodes, credentials, views, plugins, and system administration — without leaving your terminal.
A powerful CLI that brings the full Jenkins workflow to your terminal with an intuitive, consistent interface.
List, trigger, enable, disable, and delete jobs. Supports parameterized builds and folder navigation.
jenkins-cli jobs build my-pipeline -p BRANCH=mainStream logs in real-time, watch builds with desktop notifications, download artifacts, and force kill stuck builds.
jenkins-cli builds watch my-pipeline lastManage build agents — list nodes, view details, take agents offline for maintenance, and bring them back online.
jenkins-cli nodes offline my-agent -m "Maintenance"List installed plugins, check for available updates, and keep your Jenkins instance up to date.
jenkins-cli plugins list -uView server info, check your identity, perform safe restarts, and manage quiet mode from the terminal.
jenkins-cli system restart --safeBasic auth with API tokens, OAuth2 browser login with PKCE, or bearer tokens for SSO and CI/CD pipelines.
jenkins-cli auth loginNamed profiles to manage multiple Jenkins servers with separate credentials. Switch with a flag or set a default.
jenkins-cli -p images jobs listReplay pipeline builds with modified Jenkinsfiles, view stage status, and fetch per-stage logs.
jenkins-cli pipeline stages my-pipelineList, inspect, create, and delete credentials. Supports username-password, secret text, SSH keys, and certificates.
jenkins-cli credentials listCreate and manage views to organize your Jenkins dashboard. Add or remove jobs from views.
jenkins-cli view create my-viewBuilt-in MCP server lets AI assistants manage Jenkins directly. Zero-install via npx with auto-configuration.
npx @philipkram/jenkins-cli-mcpMultiple installation methods to fit your workflow. Pick whichever suits you best.
brew install PhilipKram/tap/jenkins-cli
# Requires Go 1.22+ go install github.com/PhilipKram/jenkins-cli@latest
Download pre-built binaries for Linux, macOS, and Windows from the releases page.
Available for amd64 and arm64.
git clone https://github.com/PhilipKram/Jenkins-CLI.git cd Jenkins-CLI go build -o jenkins-cli .
Three flexible auth methods. Basic auth is the default — run jenkins-cli configure to get started.
Configure your Jenkins URL, username, and API token. Generate a token from Jenkins → Your Name → Configure → API Token.
# Interactive setup (prompts for URL, user, token) jenkins-cli configure # OAuth2 login (opens browser with PKCE) jenkins-cli auth login \ --client-id YOUR_CLIENT_ID \ --auth-url https://your-idp.com/authorize \ --token-url https://your-idp.com/token # Set a bearer token for SSO/CI jenkins-cli auth token eyJhbGciOi... # Check auth status jenkins-cli auth status
Username + API token. The simplest setup for most Jenkins servers. Run jenkins-cli configure.
Browser-based login with PKCE for Jenkins instances using GitHub, GitLab, or OpenID Connect OAuth2 plugins.
For SSO providers, CI/CD pipelines, or manual token management. Set interactively or pass directly.
Comprehensive coverage of Jenkins features organized into intuitive command groups.
Global Flags:
-p, --profile Configuration profile ·
--json JSON output ·
--timeout Request timeout (default: 30s) ·
--retries Max retries (default: 3)
Common patterns for day-to-day Jenkins usage, straight from the terminal.
Trigger builds, monitor progress, and view logs — all without opening the Jenkins web UI.
# List all jobs jenkins-cli jobs list # Trigger a parameterized build jenkins-cli jobs build my-pipeline \ -p BRANCH=main -p ENV=staging # Trigger and wait for completion (with desktop notification) jenkins-cli jobs build my-pipeline --wait --follow # Watch a build until completion jenkins-cli builds watch my-pipeline last # Stream console output in real time jenkins-cli builds log my-pipeline 42 -f # Get build data as JSON jenkins-cli builds list my-pipeline --json | jq '.[0]'
Monitor builds across jobs, check the queue, and manage running builds without the web UI.
# Watch a build until completion (with desktop notification) jenkins-cli builds watch my-pipeline last --timeout 30m # View pipeline stages jenkins-cli pipeline stages my-pipeline last # Get logs for a specific stage jenkins-cli pipeline stages my-pipeline 42 --logs "Build" # Force kill a stuck build jenkins-cli builds kill my-pipeline 42 -y # Download build artifacts jenkins-cli builds artifacts my-pipeline last --download # Download only JAR files jenkins-cli builds artifacts my-pipeline 42 --download --filter "*.jar"
Manage nodes, check system health, perform safe restarts, and handle plugin updates.
# Check server info jenkins-cli system info jenkins-cli system whoami # Manage credentials jenkins-cli credentials list jenkins-cli credentials create --type username-password # Take a node offline for maintenance jenkins-cli nodes offline build-agent-01 -m "Disk cleanup" # Enter quiet mode, then safe restart jenkins-cli system quiet-down jenkins-cli system restart --safe # Self-upgrade to latest version jenkins-cli upgrade
Configuration stored in ~/.jenkins-cli/config.json with 0600 permissions.
| Variable | Description |
|---|---|
| JENKINS_URL | Jenkins server URL |
| JENKINS_USER | Username for basic auth |
| JENKINS_TOKEN | API token for basic auth |
| JENKINS_BEARER_TOKEN | Bearer token (overrides auth type to bearer) |
| JENKINS_INSECURE | Skip TLS certificate verification |
| JENKINS_PROFILE | Select a named configuration profile |
| Method | Setup |
|---|---|
| basic | jenkins-cli configure |
| oauth2 | jenkins-cli auth login |
| bearer | jenkins-cli auth token |
| Shell | Command |
|---|---|
| bash | jenkins-cli completion bash |
| zsh | jenkins-cli completion zsh |
| fish | jenkins-cli completion fish |
# Quick setup with basic auth jenkins-cli configure # Manage multiple Jenkins servers with profiles jenkins-cli configure --profile images --url https://jenkins.example.com/images jenkins-cli configure --profile helm --url https://jenkins.example.com/helm jenkins-cli profile use images jenkins-cli -p helm jobs list # Or use environment variables (basic auth) export JENKINS_URL="https://jenkins.example.com" export JENKINS_USER="your-username" export JENKINS_TOKEN="your-api-token" export JENKINS_PROFILE="images" # Generate shell completions jenkins-cli completion zsh > "${fpath[1]}/_jenkins-cli"
Built-in Model Context Protocol server lets AI assistants like Claude manage your Jenkins servers directly. Zero-install via npx.
// Add to your MCP client configuration (Claude Code, Claude Desktop, etc.) { "mcpServers": { "jenkins-cli": { "command": "npx", "args": ["-y", "@philipkram/jenkins-cli-mcp"] } } }
{
"mcpServers": {
"jenkins-images": {
"command": "npx",
"args": ["-y", "@philipkram/jenkins-cli-mcp"],
"env": { "JENKINS_PROFILE": "images" }
},
"jenkins-helm": {
"command": "npx",
"args": ["-y", "@philipkram/jenkins-cli-mcp"],
"env": { "JENKINS_PROFILE": "helm" }
}
}
}
| Category | Tools |
|---|---|
| Jobs | job_list, job_view, job_build, job_enable, job_disable |
| Builds | build_list, build_view, build_log, build_last, build_stop, build_artifacts |
| Pipeline | pipeline_validate, pipeline_stages, pipeline_stage_log |
| Nodes | node_list, node_view |
| Queue | queue_list, queue_cancel |
| Credentials | credential_list, credential_view |
| Views | view_list |
| System | system_info |
| Multibranch | multibranch_branches, multibranch_scan, multibranch_scan_log |
| Config | config_status, config_set, profile_list, profile_switch, profile_delete |
| Resource | URI Pattern |
|---|---|
| Build Log | jenkins:///{job}/{number}/log |
| Job Config | jenkins:///{job}/config.xml |
| System Log | jenkins:///system/log |
| Prompt | Description |
|---|---|
| diagnose_build_failure | Analyze build logs for failure causes |
| review_job_config | Review config against best practices |
| summarize_build_history | Analyze build trends and health |
| validate_jenkinsfile | Validate syntax and best practices |
# Register with Claude Code jenkins-cli mcp install # Register with Claude Desktop jenkins-cli mcp install --client claude-desktop # Register per profile jenkins-cli mcp install --profile images --name jenkins-images jenkins-cli mcp install --profile helm --name jenkins-helm