| name | jk |
| description | Jenkins CLI — query jobs, trigger builds, view logs, download artifacts, manage credentials and nodes. Load when working with Jenkins CI, checking build status, or troubleshooting pipelines. |
| updated | "2026-05-13T00:00:00.000Z" |
| related | ["codebases"] |
Jenkins CI CLI authority. Read-only by default; writes (job create, configure, credential create, run start) require explicit approval.
> Use `--json` for structured output, `--jq` for filtering. NEVER write (create jobs, start runs, modify config, manage credentials) without explicit user approval. Based on jk v0.0.33.
<agent_flags>
--json — JSON output for structured parsing
--yaml — YAML output
--jq <expr> — filter JSON with jq expression
-t, --template <tmpl> — format with Go template
-q, --quiet — suppress non-essential output
-c, --context <name> — use specific Jenkins context
</agent_flags>
<write_policy>
NEVER create jobs, start runs, modify config, manage credentials, or cordon nodes without explicit user approval.
Default: read-only. Before any write: ask "Should I execute this on Jenkins?" Proceed only on explicit yes.
Safety rules
- NEVER start runs without confirming job path and parameters.
- NEVER modify config.xml without showing current config first.
- NEVER create or delete credentials without confirming scope and ID.
- NEVER cordon/uncordon nodes without confirming node name.
- ALWAYS show the full command before executing writes.
</write_policy>
<dependency_check>
Before executing any jk command, verify the CLI is installed:
jk --version
Minimum version: 0.0.29 for jk job create, jk job config, jk job configure, jk job scan.
Skip silently if jk is not installed or not configured.
</dependency_check>
jk auth status
jk context ls
jk context use prod-jenkins
Environment: JK_CONTEXT overrides active context.
jk auth login https://jenkins.example.com --username alice --token <API_TOKEN>
jk auth login https://jenkins.example.com --name prod --username alice --token <TOKEN>
jk search --job-glob '*deploy*' --limit 10
jk job ls
jk job ls team/platform
jk job view team/app
jk run ls team/app
jk run view team/app 128
jk log team/app 128 --follow
jk run start team/app --follow
jk run start team/app -p KEY=value
jk run start team/app --wait --timeout 10m
jk artifact download team/app 128
jk artifact download team/app 128 -o ./artifacts
jk test report team/app 128
jk job config platform/services/auth-relay
jk job configure platform/services/auth-relay --script-path services/auth-relay/Jenkinsfile
jk job configure platform/services/auth-relay --file auth-relay.config.xml
jk job scan platform/services/auth-relay
jk job create auth-relay \
--folder platform/services \
--repo-owner org \
--repository repo-name \
--script-path services/auth-relay/Jenkinsfile \
--credentials bitbucket-ro \
--branch-strategy all
jk node ls
jk queue ls
jk cred ls
jk plugin ls
<quick_reference>
| Task | Command |
|---|
| Search jobs | jk search --job-glob '*deploy*' |
| List jobs | jk job ls |
| View job | jk job view team/app |
| List runs | jk run ls team/app |
| View run | jk run view team/app 128 |
| Follow logs | jk log team/app 128 --follow |
| Start run | jk run start team/app -p KEY=value |
| Download artifacts | jk artifact download team/app 128 |
| Test report | jk test report team/app 128 |
| Fetch config | jk job config team/app |
| List credentials | jk cred ls |
| List nodes | jk node ls |
| View queue | jk queue ls |
</quick_reference>
- Read-only by default. Ask before any write.
- ALWAYS `--json` when parsing output programmatically.
- Use `--jq` to extract specific fields from JSON output.
- Use job full path (folder/name) in references — not search URLs.
- Search before creating new jobs.
- Log build numbers and outcomes in dev-logs when monitoring CI.
<self_review>
<output_rules>Output in English. Preserve verbatim CLI commands, job paths, and build numbers.</output_rules>