Jenkins CLI

Pipelines & administration

Validate pipelines and manage plugins, credentials, users, and Jenkins itself.

Pipelines

jenkins pipeline validate --from-file Jenkinsfile
jenkins pipeline validate --from-file -
jenkins pipeline input-list team/deploy 42 -o json
jenkins pipeline input-submit team/deploy 42 approval --param ENV=production
jenkins pipeline input-abort team/deploy 42 approval

pipeline validate uses Jenkins' declarative pipeline model converter. The input commands list, approve, or abort pending Pipeline input actions.

Plugins

jenkins plugin list --active -o json
jenkins plugin get git -o yaml
jenkins plugin check-updates
jenkins plugin install git --version 5.7.0 --if-not-exists
jenkins plugin uninstall git --confirm --if-exists

Credentials and users

jenkins credential list --store system --domain _ --type SSH -o json
jenkins credential get deploy-key --store system --domain _ -o json
jenkins credential create --store system --domain _ --from-file credential.xml --if-not-exists
jenkins credential update deploy-key --store system --domain _ --from-file credential.xml
jenkins credential delete deploy-key --store system --domain _ --confirm --if-exists

jenkins user list -o json
jenkins user get admin -o json

System administration

jenkins system info -o json
jenkins system quiet-down
jenkins system cancel-quiet-down
jenkins system restart --safe --confirm
jenkins system run-script --from-file maintenance.groovy
jenkins system run-script --script 'println(Jenkins.instance.version)'

CLI updates

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

jenkins update works on macOS, Linux, and Windows. --check only reports; --yes installs without the Update now? [Y/n] prompt. jenkins version shows the latest release from the last cached check without contacting GitHub. The Updating section of the Installation page explains how the binary is replaced and how to turn off the update notice.

Plugin, credential, and system commands depend on Jenkins permissions; most system operations require Overall/Administer. system run-script executes Groovy in the Jenkins script console and should be tightly restricted.