productivity
Jenkins CLI for AI Agents
Use the Jenkins CLI from KosmoKrator to call Jenkins tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Jenkins CLI Setup
Jenkins can be configured headlessly with `kosmokrator integrations:configure jenkins`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure jenkins --set api_token="$JENKINS_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor jenkins --json
kosmokrator integrations:status --json Credentials
Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_token | JENKINS_API_TOKEN | Secret secret | yes | API Token |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json kosmo integrations:jenkins jenkins_list_jobs '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs jenkins --json
kosmo integrations:docs jenkins.jenkins_list_jobs --json
kosmo integrations:schema jenkins.jenkins_list_jobs --json
kosmo integrations:search "Jenkins" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
jenkins.jenkins_list_jobs
List all Jenkins jobs. Returns job names, URLs, colors (build status), and basic metadata.
read - Parameters
- none
kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json kosmo integrations:jenkins jenkins_list_jobs '{}' --json jenkins.jenkins_get_job
Get detailed information about a specific Jenkins job, including description, last build, health reports, and parameters.
read - Parameters
- job_name
kosmo integrations:call jenkins.jenkins_get_job '{"job_name":"example_job_name"}' --json kosmo integrations:jenkins jenkins_get_job '{"job_name":"example_job_name"}' --json jenkins.jenkins_create_job
Create a new Jenkins job. Requires a job name and configuration.
write - Parameters
- name, mode, description, config
kosmo integrations:call jenkins.jenkins_create_job '{"name":"example_name","mode":"example_mode","description":"example_description","config":"example_config"}' --json kosmo integrations:jenkins jenkins_create_job '{"name":"example_name","mode":"example_mode","description":"example_description","config":"example_config"}' --json jenkins.jenkins_list_builds
List builds for a specific Jenkins job, including build numbers, results, durations, and timestamps.
read - Parameters
- job_name, status, per_page
kosmo integrations:call jenkins.jenkins_list_builds '{"job_name":"example_job_name","status":"example_status","per_page":1}' --json kosmo integrations:jenkins jenkins_list_builds '{"job_name":"example_job_name","status":"example_status","per_page":1}' --json jenkins.jenkins_get_build
Get detailed information about a specific Jenkins build, including result, duration, console output, artifacts, and change sets.
read - Parameters
- job_name, build_number
kosmo integrations:call jenkins.jenkins_get_build '{"job_name":"example_job_name","build_number":1}' --json kosmo integrations:jenkins jenkins_get_build '{"job_name":"example_job_name","build_number":1}' --json jenkins.jenkins_list_nodes
List all Jenkins nodes (agents), including name, offline status, and executor count.
read - Parameters
- none
kosmo integrations:call jenkins.jenkins_list_nodes '{}' --json kosmo integrations:jenkins jenkins_list_nodes '{}' --json jenkins.jenkins_get_current_user
Get the authenticated Jenkins user's profile information, including user ID, full name, and email.
read - Parameters
- none
kosmo integrations:call jenkins.jenkins_get_current_user '{}' --json kosmo integrations:jenkins jenkins_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
jenkins.jenkins_list_jobs 0 parameters
kosmo integrations:schema jenkins.jenkins_list_jobs --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
jenkins.jenkins_get_job 1 parameters
kosmo integrations:schema jenkins.jenkins_get_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
job_name | string | yes | The name of the Jenkins job. |
jenkins.jenkins_create_job 4 parameters
kosmo integrations:schema jenkins.jenkins_create_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name for the new Jenkins job. |
mode | string | no | Job type: freestyle, pipeline, maven, matrix, or multibranch. Default: freestyle. |
description | string | no | A description for the job. |
config | object | no | Job configuration as a structured object (e.g. SCM, builders, publishers). |
jenkins.jenkins_list_builds 3 parameters
kosmo integrations:schema jenkins.jenkins_list_builds --json | Parameter | Type | Required | Description |
|---|---|---|---|
job_name | string | yes | The name of the Jenkins job. |
status | string | no | Filter by build status: SUCCESS, FAILURE, UNSTABLE, ABORTED, IN_PROGRESS. |
per_page | integer | no | Number of builds to return. Default: 20. |
jenkins.jenkins_get_build 2 parameters
kosmo integrations:schema jenkins.jenkins_get_build --json | Parameter | Type | Required | Description |
|---|---|---|---|
job_name | string | yes | The name of the Jenkins job. |
build_number | integer | yes | The build number. |
jenkins.jenkins_list_nodes 0 parameters
kosmo integrations:schema jenkins.jenkins_list_nodes --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
jenkins.jenkins_get_current_user 0 parameters
kosmo integrations:schema jenkins.jenkins_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.