A skill that lets AI agents interact with Jenkins over SSH using the Jenkins CLI. Once configured, you can ask the AI to trigger builds, tail console output, manage jobs, nodes, plugins, credentials, views, and run Groovy scripts — all without leaving your opencode session.
- SSH access to a Jenkins instance with the CLI enabled on port 2222
- Your SSH public key added to your Jenkins user account
- opencode.ai with skills support
mkdir -p ~/.config/opencode/my-skills
git clone https://github.com/YOUR_USERNAME/jenkins-skill ~/.config/opencode/my-skills/jenkinsCopy the example config and fill in your values:
cd ~/.config/opencode/my-skills/jenkins
cp references/ssh_config.example ssh_configEdit ssh_config and replace the placeholders:
Host jenkins
HostName <jenkins-host-or-ip>
Port 2222
User <your-username>
Run this from the skill directory:
ssh -F ssh_config jenkins who-am-iYou should see your Jenkins username and permissions. If it hangs or errors, check that your SSH key is registered with Jenkins and the host/port are correct.
Add the following to the bash permissions block in your opencode.json:
"bash": {
"*": "ask",
"ssh jenkins *": "allow"
}This lets the AI run Jenkins CLI commands without prompting for confirmation each time.
Once installed, just describe what you want in natural language. Example prompts:
- "Trigger the
deploy-prodjob and tail the logs" - "Show me the last 50 lines of console output for the
build-apijob" - "List all failing jobs"
- "Disable the
nightly-testsjob until Monday" - "Run this Groovy script on Jenkins and show me the output"
- "What plugins are installed and which ones are out of date?"
- "Restart Jenkins safely after the current builds finish"
ssh_configis gitignored — your hostname, port, and username stay local- Secrets in credentials are redacted by the Jenkins CLI when exported as XML
- The
ssh jenkins *permission allows any Jenkins CLI command — scope your user's Jenkins permissions appropriately