KosmoKrator

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.

7 functions 6 read 1 write API token auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_token JENKINS_API_TOKEN Secret secret yes API Token

Call Jenkins Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:jenkins jenkins_list_jobs '{}' --json

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Jenkins.

jenkins.jenkins_list_jobs

Read read

List all Jenkins jobs. Returns job names, URLs, colors (build status), and basic metadata.

Parameters
none

Generic CLI call

kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_list_jobs '{}' --json

jenkins.jenkins_get_job

Read read

Get detailed information about a specific Jenkins job, including description, last build, health reports, and parameters.

Parameters
job_name

Generic CLI call

kosmo integrations:call jenkins.jenkins_get_job '{"job_name":"example_job_name"}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_get_job '{"job_name":"example_job_name"}' --json

jenkins.jenkins_create_job

Write write

Create a new Jenkins job. Requires a job name and configuration.

Parameters
name, mode, description, config

Generic CLI call

kosmo integrations:call jenkins.jenkins_create_job '{"name":"example_name","mode":"example_mode","description":"example_description","config":"example_config"}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_create_job '{"name":"example_name","mode":"example_mode","description":"example_description","config":"example_config"}' --json

jenkins.jenkins_list_builds

Read read

List builds for a specific Jenkins job, including build numbers, results, durations, and timestamps.

Parameters
job_name, status, per_page

Generic CLI call

kosmo integrations:call jenkins.jenkins_list_builds '{"job_name":"example_job_name","status":"example_status","per_page":1}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_list_builds '{"job_name":"example_job_name","status":"example_status","per_page":1}' --json

jenkins.jenkins_get_build

Read read

Get detailed information about a specific Jenkins build, including result, duration, console output, artifacts, and change sets.

Parameters
job_name, build_number

Generic CLI call

kosmo integrations:call jenkins.jenkins_get_build '{"job_name":"example_job_name","build_number":1}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_get_build '{"job_name":"example_job_name","build_number":1}' --json

jenkins.jenkins_list_nodes

Read read

List all Jenkins nodes (agents), including name, offline status, and executor count.

Parameters
none

Generic CLI call

kosmo integrations:call jenkins.jenkins_list_nodes '{}' --json

Provider shortcut

kosmo integrations:jenkins jenkins_list_nodes '{}' --json

jenkins.jenkins_get_current_user

Read read

Get the authenticated Jenkins user's profile information, including user ID, full name, and email.

Parameters
none

Generic CLI call

kosmo integrations:call jenkins.jenkins_get_current_user '{}' --json

Provider shortcut

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

List all Jenkins jobs. Returns job names, URLs, colors (build status), and basic metadata.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_list_jobs --json
ParameterTypeRequiredDescription
No parameters.

jenkins.jenkins_get_job

Get detailed information about a specific Jenkins job, including description, last build, health reports, and parameters.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_get_job --json
ParameterTypeRequiredDescription
job_name string yes The name of the Jenkins job.

jenkins.jenkins_create_job

Create a new Jenkins job. Requires a job name and configuration.

Operation
Write write
Schema command
kosmo integrations:schema jenkins.jenkins_create_job --json
ParameterTypeRequiredDescription
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

List builds for a specific Jenkins job, including build numbers, results, durations, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_list_builds --json
ParameterTypeRequiredDescription
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

Get detailed information about a specific Jenkins build, including result, duration, console output, artifacts, and change sets.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_get_build --json
ParameterTypeRequiredDescription
job_name string yes The name of the Jenkins job.
build_number integer yes The build number.

jenkins.jenkins_list_nodes

List all Jenkins nodes (agents), including name, offline status, and executor count.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_list_nodes --json
ParameterTypeRequiredDescription
No parameters.

jenkins.jenkins_get_current_user

Get the authenticated Jenkins user's profile information, including user ID, full name, and email.

Operation
Read read
Schema command
kosmo integrations:schema jenkins.jenkins_get_current_user --json
ParameterTypeRequiredDescription
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.