Hey all,
I’ve been letting an AI agent (Claude Code, in my case) make non-trivial changes in our repos, and the missing piece was always the same: how does it know whether the change actually built and passed CI? Without that loop, the agent is flying blind — it makes a change, I push, I babysit Jenkins, I paste the failed log back in, it tries again. That’s not an agent, that’s me with extra steps.
So the real ask was: give the agent a clean way to trigger a build, wait for it, fetch the failed stage log, and reason about it — without handing it credentials. Existing options weren’t great for that. jenkins-cli.jar is built for admins, the REST API + curl works but every interaction is five lines of plumbing, and Blue Ocean URLs need parsing. I wanted something an agent could call with one short command and get useful output back.
That turned into jkit (GitHub - ysmaoui/jkit: a cli for interacting with jenkins pipeline jobs and build · GitHub) — a small Go CLI that’s gh for Jenkins. Turns out once you have it, you stop opening the web UI for yourself either.
jkit run my-app --wait --log # trigger, wait, stream
jkit status my-app # recent builds
jkit log my-app -f # tail live build log
jkit diagnose my-app # summarize the failure
jkit lint # validate ./Jenkinsfile
A few things I leaned into because of the agent use case (and that turned out to be nice for humans too):
- Auth stays out of the agent’s hands —
jkit auth loginonce, token lives in~/.config/jkit/config.yml, the agent just callsjkitand never sees the credential. No env vars in prompts, no token in tool arguments, no risk of it ending up in a transcript or pasted into a chat. - Zero-config — resolves the job from
.jkit.yml, thengit remote origin, then the directory name. The agent doesn’t need to be told which job to look at. - Paste any URL — classic or Blue Ocean. Host, job path, build number all extracted. So when CI posts a link, you (or the agent) can hand it straight back.
jkit diagnose URL— one-shot failure summary: failed stage, error excerpts, params, triggering commits. This is the command that closes the feedback loop — most failures are diagnosable from this one output.- JSON output everywhere —
--jsonon every command, composes withjqand structured tool calls. - Multi-host —
--hostflag plus aliases in config, for the classic “we have three Jenkinses” setup.
Repo also ships a small Claude Code skill bundle in agents/ — basically a SKILL.md reference, a /jenkins-monitor URL slash command, and a sub-agent that does failure triage. Drop it into ~/.claude/ and the agent knows how to use jkit without you prompting it.
Pre-built binaries for Linux / macOS / Windows on amd64 + arm64 on the releases page. go install github.com/ysmaoui/jkit@latest also works.
It’s early — v0.2.0, expect breaking changes before 1.0. Most useful feedback at this stage: workflows it doesn’t cover, output that’s awkward to parse, anything that breaks on your Jenkins version.
(Note on the name: I originally shipped this as jk but renamed to jkit after publishing — there’s already an avivsinai/jenkins-cli project that ships a jk binary. Same idea, different angle. Worth a look if you want a more admin-leaning Jenkins CLI with broader feature coverage.)
Repo: GitHub - ysmaoui/jkit: a cli for interacting with jenkins pipeline jobs and build · GitHub
Docs: jkit/docs at main · ysmaoui/jkit · GitHub
Curious what people think.