Skip to main content

CLI tool for Jenkins. List jobs, check builds, view logs, trigger builds.

Project description

zenkins

CLI tool for Jenkins. List jobs, check builds, view logs, trigger builds.

Install

uv tool install zenkins

Setup

Run zenkins init to get started. If no config file exists, it creates one with placeholder values:

url = "http://your-jenkins.example.com"
user = "your-username"
token = "your-api-token"

The config file location depends on your OS:

OS Path
Linux ~/.config/zenkins/config.toml
macOS ~/Library/Application Support/zenkins/config.toml
Windows %APPDATA%\zenkins\config.toml

Edit the file with your Jenkins URL, username, and API token, then run zenkins init again to verify connectivity.

Creating an API token

  1. Log in to your Jenkins instance
  2. Click your username (top right) → Configure
  3. Scroll to API TokenAdd new Token
  4. Give it a name, click Generate, and copy the token

The token is shown only once — paste it into config.toml right away.

Usage

zenkins jobs                        # List all jobs with status
zenkins status <job>                # Show last build info
zenkins builds <job>                # List recent builds
zenkins builds <job> -n 5           # List last 5 builds
zenkins log <job>                   # Show console output (last build)
zenkins log <job> 42                # Show console output for build #42
zenkins queue                       # Show build queue
zenkins build <job>                 # Trigger a build
zenkins failures <job>              # Show failing tests (last build)
zenkins failures <job> 42           # Show failing tests for build #42
zenkins failures <job> 40..45       # Failure summary across build range
zenkins failures <job> -n 10        # Failure summary for last 10 builds
zenkins artifacts <job> -l          # List artifacts (last build)
zenkins artifacts <job> 42 -d ./out # Download artifacts to directory
zenkins artifacts <job> --glob "*.xml" # Download matching artifacts
zenkins artifacts <job> -n 3 --glob "*.png" -l  # List PNGs from last 3 builds

Folder jobs use / syntax: zenkins builds ci/main, zenkins failures ci/main -n 5.

The failures command queries both JUnit/NUnit and Robot Framework test results, grouping them into persistent, intermittent, and one-off failures when using range or -n syntax.

Library usage

import zenkins

s = zenkins.client()
resp = s.get("http://jenkins.example.com/api/json")

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zenkins-0.4.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zenkins-0.4.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file zenkins-0.4.0.tar.gz.

File metadata

  • Download URL: zenkins-0.4.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zenkins-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e213247785d8f9ec58c1bdd53a8d3f557e2ac83bfa42efffad02a5e0ac1b7aed
MD5 dde3cc0ba2779c7bacbb033db427b303
BLAKE2b-256 76ee67ef5f956c47a4e9e4244a39c10df21ce4406cd0be063b34f164fb8ccf07

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenkins-0.4.0.tar.gz:

Publisher: publish.yml on vivainio/zenkins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zenkins-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: zenkins-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zenkins-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0292f90686da9eb1436cba930057d4cd24514b63f026793ac73438c42fcf442c
MD5 836daf4c72f908cb5bd6149b235e0f41
BLAKE2b-256 39e38b30816f8262735b86a42554c4d7f182045bdae3f349c4b91e1ff68c6d01

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenkins-0.4.0-py3-none-any.whl:

Publisher: publish.yml on vivainio/zenkins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page