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.

Jenkins CLI Setup

Jenkins can be configured headlessly with `kosmokrator integrations:configure jenkins`.

Install, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
none
Generic call
kosmo integrations:call jenkins.jenkins_list_jobs '{}' --json
Shortcut
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 read
Parameters
job_name
Generic call
kosmo integrations:call jenkins.jenkins_get_job '{"job_name":"example_job_name"}' --json
Shortcut
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 write
Parameters
name, mode, description, config
Generic call
kosmo integrations:call jenkins.jenkins_create_job '{"name":"example_name","mode":"example_mode","description":"example_description","config":"example_config"}' --json
Shortcut
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 read
Parameters
job_name, status, per_page
Generic call
kosmo integrations:call jenkins.jenkins_list_builds '{"job_name":"example_job_name","status":"example_status","per_page":1}' --json
Shortcut
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 read
Parameters
job_name, build_number
Generic call
kosmo integrations:call jenkins.jenkins_get_build '{"job_name":"example_job_name","build_number":1}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call jenkins.jenkins_list_nodes '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call jenkins.jenkins_get_current_user '{}' --json
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 0 parameters
Schema command
kosmo integrations:schema jenkins.jenkins_list_jobs --json
ParameterTypeRequiredDescription
No parameters.
jenkins.jenkins_get_job 1 parameters
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 4 parameters
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 3 parameters
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 2 parameters
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 0 parameters
Schema command
kosmo integrations:schema jenkins.jenkins_list_nodes --json
ParameterTypeRequiredDescription
No parameters.
jenkins.jenkins_get_current_user 0 parameters
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.