A GitHub CLI-style interface for Jenkins, enabling operations teams to manage jobs, runs, logs, and admin tasks directly from the terminal. Integrates with existing Jenkins pipelines and workflows, reducing reliance on the web UI for routine operations.
git clone https://github.com/avivsinai/jenkins-cli.gitjk is a cross-platform CLI tool that brings GitHub CLI's familiar command structure to Jenkins automation. It enables developers and operators to inspect runs, stream logs, manage credentials, and administer Jenkins controllers without relying on the web UI. The tool supports context-aware authentication across multiple Jenkins controllers, scriptable output in JSON/YAML with jq and templating support, and discovery-first job filtering with parameter grouping. Job provisioning focuses on Bitbucket-backed Multibranch Pipeline creation, raw config.xml inspection, and Jenkinsfile path management. Key platform operations include node cordoning, credential management, queue inspection, and plugin visibility.
[{"step":"Install the Jenkins CLI tool. If using a package manager, run `brew install jenkins-cli` (macOS) or `scoop install jenkins-cli` (Windows). Alternatively, download the JAR from your Jenkins instance at `https://<JENKINS_URL>/jnlpJars/jenkins-cli.jar`.","tip":"Ensure you have Java 8+ installed. The CLI uses the same authentication as the web UI, so configure your credentials once and reuse them across sessions."},{"step":"Configure the Jenkins instance URL and authentication. Run `jenkins-cli config set instance https://jenkins.company.com` and `jenkins-cli config set user <USERNAME> --password <API_TOKEN>`.","tip":"Generate an API token in Jenkins under 'User Settings' > 'Configure' > 'API Token'. Store it securely or use environment variables for automation."},{"step":"Execute commands directly from the terminal. Use `list-jobs`, `trigger-build`, `get-logs`, or `pause-job` based on your needs. Combine with shell tools like `grep`, `jq`, or `awk` for advanced filtering.","tip":"Use `--help` with any command to see available options. For example, `jenkins-cli trigger-build --help` shows how to pass parameters or wait for build completion."},{"step":"Integrate with scripts or CI/CD pipelines. For example, use the CLI in a GitHub Actions workflow to trigger Jenkins jobs or fetch logs after a deployment.","tip":"Wrap CLI commands in scripts to standardize operations. For instance, create a `jenkins-ops.sh` script with functions for common tasks like `deploy-prod` or `rollback`."},{"step":"Monitor and debug builds. Use `get-logs` with `--tail` to stream logs in real-time, or `get-build-info` to check build status and artifacts.","tip":"For large logs, use `--max-lines` to limit output or pipe to `less` for easier navigation. Combine with `grep` to filter for errors or warnings."}]
Trigger and rerun Jenkins jobs directly from the terminal with human-readable or JSON output
Discover and filter jobs across folders using glob patterns and result-based filtering
Create and configure Bitbucket-backed Multibranch Pipeline jobs programmatically
Stream build logs and download filtered artifact sets during CI/CD pipelines
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/avivsinai/jenkins-cliCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the Jenkins CLI to [COMMAND] for [JENKINS_INSTANCE_URL]. For example: 'List all active jobs with their last build status', 'Trigger a build for [JOB_NAME] with parameters [PARAM1=value1, PARAM2=value2]', 'Fetch logs for the latest run of [JOB_NAME] and extract errors', or 'Pause a job [JOB_NAME] and wait for confirmation'. Include the --depth flag if needed to control API response size.
``` $ jenkins-cli --instance https://jenkins.company.com list-jobs --depth 1 Active Jobs: 1. backend-unit-tests (last build: SUCCESS #142, duration: 4m 12s) 2. frontend-build (last build: FAILURE #89, duration: 2m 45s) 3. security-scan (last build: SUCCESS #203, duration: 12m 3s) 4. deploy-prod (last build: SUCCESS #45, duration: 8m 15s) $ jenkins-cli --instance https://jenkins.company.com trigger-build backend-unit-tests --params BRANCH=main,ENV=staging Build triggered successfully! Build URL: https://jenkins.company.com/job/backend-unit-tests/143/ Queue position: 2 $ jenkins-cli --instance https://jenkins.company.com get-logs backend-unit-tests 143 --tail 50 [2024-05-15 14:32:18] INFO: Starting test execution [2024-05-15 14:32:22] INFO: Test suite 'AuthServiceTest' completed [2024-05-15 14:32:23] ERROR: Test 'UserControllerTest.loginTest' failed: NullPointerException [2024-05-15 14:32:24] INFO: Test execution completed with 1 failure ``` The Jenkins CLI provides a streamlined way to interact with Jenkins without using the web interface. The commands above demonstrate how to list jobs with their status, trigger a parameterized build, and fetch logs with error extraction. This is particularly useful for operations teams who need to quickly diagnose issues or manage builds during incidents.
IronCalc is a spreadsheet engine and ecosystem
Get more done every day with Microsoft Teams – powered by AI
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan