agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/jenkins-cli/SKILL.md

jenkins-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform Jenkins operations using the jenkins-cli.

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the CLI setup and command format below when constructing all jenkins-cli commands.

    line 8
  2. Distinctive:

    Update the table below with your Jenkins server URLs and auth file paths:

    line 12
  3. Distinctive:

    If the target server is unclear, ask the user before running any command.

    line 19
  4. Very specific:

    All commands must be run from the working directory's root (where jenkins-cli/ directory exists).

    line 26
  5. Very specific:

    If the jenkins-cli/ directory does not exist yet, or jenkins-cli.jar or the auth file for the target server is missing, inform the user …

    line 30
  6. Very specific:

    Create the directory jenkins-cli in the working directory's root.

    line 32
  7. Very specific:

    Create an auth file for each server you intend to use, with your credentials in this exact format: username:api-token

    line 34
  8. Very specific:

    Always use jenkins-cli.jar for all Jenkins operations.

    line 134
  9. Distinctive:

    NEVER target a server not listed in the instance table above.

    line 135
  10. Distinctive:

    Update the instance table with your actual Jenkins URLs before using this skill.

    line 136
  11. Distinctive:

    If a job name, parameter, or folder path references an unfamiliar environment, stop and ask the user before running.

    line 137
  12. Distinctive:

    NEVER run commands in the "Never run" table above without explicit user instruction.

    line 138

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Jenkins CLI Skill

Use the CLI setup and command format below when constructing all jenkins-cli commands.

Instances

Update the table below with your Jenkins server URLs and auth file paths:

EnvironmentServer URLAuth File
Productionhttps://<your-jenkins-prod-url>jenkins-cli/prod.auth
Staginghttps://<your-jenkins-staging-url>jenkins-cli/staging.auth

If the target server is unclear, ask the user before running any command.

CLI Setup

  • JAR File: jenkins-cli/jenkins-cli.jar (working directory's root)
  • Auth Files: one per server — see instance table above. File contents format: username:api-token

All commands must be run from the working directory's root (where jenkins-cli/ directory exists).

Prerequisites (one-time setup by user)

If the jenkins-cli/ directory does not exist yet, or jenkins-cli.jar or the auth file for the target server is missing, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

  1. Create the directory jenkins-cli in the working directory's root.
  2. Download the JAR from <YOUR_JENKINS_URL>/jnlpJars/jenkins-cli.jar and save it as jenkins-cli/jenkins-cli.jar.
  3. Create an auth file for each server you intend to use, with your credentials in this exact format: username:api-token
    • jenkins-cli/prod.auth
    • jenkins-cli/staging.auth

Command Format

java -jar jenkins-cli/jenkins-cli.jar -s <SERVER_URL> -auth @<AUTH_FILE> [command]

Example (production):

java -jar jenkins-cli/jenkins-cli.jar -s https://<your-jenkins-prod-url> -auth @jenkins-cli/prod.auth who-am-i

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
who-am-iVerify auth and show permissions
versionShow Jenkins version
list-jobs [folder]List all jobs (optionally in a folder/view)
get-job <job>Dump job config XML to stdout
console <job> [build#]Get console output of a build; build# accepts integers or Jenkins specifiers like lastSuccessfulBuild, lastBuild, lastFailedBuild
list-changes <job> [build#]Show changelog for a build; build# must be an integer — specifiers like lastSuccessfulBuild are not accepted
get-node <node>Dump node config XML
get-view <view>Dump view config XML
list-pluginsList installed plugins
session-idShow current session ID
export-configurationExport Jenkins config as YAML
check-configurationValidate YAML configuration
declarative-linterValidate a Declarative Jenkinsfile (reads from stdin)
list-credentials <store>List credentials in a store
get-credentials-as-xml <store> <domain> <id>Get credential XML (secrets redacted)
get-credentials-domain-as-xml <store> <domain>Get credentials domain XML
list-credentials-context-resolversList credentials context resolvers
list-credentials-providersList credentials providers
help [command]List all commands or describe one command
reload-job <job>Reload job config from disk (read-only, no state change)

Build operations (confirm if job looks like production)

CommandDescription
build <job> [-s] [-v] [-p key=val]Trigger a build (-s waits, -v streams output)
stop-builds <job>Stop all running builds for a job
keep-build <job> <build#>Mark a build to keep forever
set-build-description <job> <build#> <desc>Set build description
set-build-display-name <job> <build#> <name>Set build display name
set-next-build-number <job> <number>Set next build number
replay-pipeline <job> [build#]Replay a pipeline with edited script from stdin
restart-from-stage <job> <build#> <stage>Restart a Declarative Pipeline from a given stage

Job / view management (ask user before running)

CommandDescription
create-job <job>Create a new job (XML from stdin)
update-job <job>Update job config (XML from stdin)
copy-job <src> <dst>Copy a job
enable-job <job>Enable a job
disable-job <job>Disable a job
create-view <view>Create a new view (XML from stdin)
update-view <view>Update view config (XML from stdin)
add-job-to-view <view> <job>Add a job to a view
remove-job-from-view <view> <job>Remove a job from a view
connect-node <node>Reconnect a node
disconnect-node <node>Disconnect a node
offline-node <node>Take a node offline temporarily
online-node <node>Bring a node back online
create-node <node>Create a new node (XML from stdin)
update-node <node>Update node config (XML from stdin)
reload-configurationReload all config from disk
reload-jcasc-configurationReload JCasC YAML config

Never run — requires explicit human approval

CommandReason
delete-job <job>Irreversible deletion
delete-node <node>Irreversible deletion
delete-view <view>Irreversible deletion
delete-credentials ...Irreversible deletion
delete-credentials-domain ...Irreversible deletion
clear-queueCancels all queued builds
quiet-down / cancel-quiet-downAffects all builds instance-wide
restart / safe-restartRestarts Jenkins for all users
shutdown / safe-shutdownShuts down Jenkins for all users
delete-builds <job> <range>Irreversible deletion of build records
apply-configurationApplies YAML config changes to the entire Jenkins instance
groovy / groovyshArbitrary code execution on Jenkins master
install-plugin / enable-plugin / disable-pluginModifies Jenkins instance globally
import-credentials-as-xml / update-credentials-by-xmlModifies stored credentials
mailSends email to real recipients
supportGenerates and may upload diagnostic bundles

Rules

  • Always use jenkins-cli.jar for all Jenkins operations. Do not use curl or other HTTP clients against the Jenkins REST API.
  • NEVER target a server not listed in the instance table above. If asked to run against an unfamiliar server URL, stop and ask the user to confirm.
  • Update the instance table with your actual Jenkins URLs before using this skill.
  • If a job name, parameter, or folder path references an unfamiliar environment, stop and ask the user before running.
  • NEVER run commands in the "Never run" table above without explicit user instruction.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.