{"id":15297913,"url":"https://github.com/kairyou/jenkins-cli","last_synced_at":"2026-02-12T08:22:12.086Z","repository":{"id":256896551,"uuid":"856675916","full_name":"kairyou/jenkins-cli","owner":"kairyou","description":"Cross-platform CLI tool for triggering Jenkins builds. Written in Rust for high performance.","archived":false,"fork":false,"pushed_at":"2026-02-11T13:35:48.000Z","size":1127,"stargazers_count":160,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T21:41:12.497Z","etag":null,"topics":["automation","ci-cd","cli","devops","jenkins","jenkins-api","jenkins-pipeline","rust"],"latest_commit_sha":null,"homepage":"https://xhl.me","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kairyou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-13T01:57:20.000Z","updated_at":"2026-02-11T15:12:29.000Z","dependencies_parsed_at":"2024-10-25T09:47:16.116Z","dependency_job_id":"799e926d-93c1-4159-9be1-e539cf403cde","html_url":"https://github.com/kairyou/jenkins-cli","commit_stats":{"total_commits":80,"total_committers":1,"mean_commits":80.0,"dds":0.0,"last_synced_commit":"7dbfe0dd29056676413a2c9b49c077637f8e4fc2"},"previous_names":["kairyou/jenkins-cli"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/kairyou/jenkins-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2Fjenkins-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2Fjenkins-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2Fjenkins-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2Fjenkins-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kairyou","download_url":"https://codeload.github.com/kairyou/jenkins-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairyou%2Fjenkins-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","ci-cd","cli","devops","jenkins","jenkins-api","jenkins-pipeline","rust"],"created_at":"2024-09-30T20:01:02.748Z","updated_at":"2026-02-12T08:22:12.080Z","avatar_url":"https://github.com/kairyou.png","language":"Rust","funding_links":[],"categories":["Rust","Jenkins-Tools"],"sub_categories":[],"readme":"# jenkins-cli\n\nCross-platform CLI tool for triggering Jenkins builds. Written in Rust for high performance.\n\n[中文文档](README_zh.md)\n\n## Features\n\n- Fast and efficient Jenkins job deployment\n- Intuitive command-line interface with real-time console output\n- Support for multiple Jenkins services, project filtering\n- Common Jenkins operations support (e.g., triggering builds)\n- High performance and cross-platform compatibility (Mac, Windows, Linux)\n- Remembers last build parameters for quick re-runs\n\n### Demo\n\n![Demo](./assets/demo.gif)\n\n## Installation\n\nTo install the Jenkins CLI tool, use one of the following methods:\n\n```bash\nbash \u003c(curl -fsSL https://raw.githubusercontent.com/kairyou/jenkins-cli/main/scripts/install.sh)\n```\n\nOr use EdgeOne mirror (if GitHub is inaccessible)\n\n```bash\nbash \u003c(curl -fsSL https://jenkins-cli.xhl.io/scripts/install.sh)\n```\n\nIf you have Rust and Cargo installed, you can install Jenkins CLI directly from crates.io:\n\n```bash\ncargo install jenkins\n```\n\nAlternatively, you can download the binary file from the [Releases page](https://github.com/kairyou/jenkins-cli/releases).\n\n## Usage\n\nAfter setting up the configuration file (see [Configuration](#configuration) section), you can simply run:\n\n```bash\njenkins\n```\n\nThis command will:\n\n1. Prompt you to select a Jenkins service (if multiple are configured)\n2. Display a list of available projects\n3. Select a project and set build parameters\n4. Trigger the build and show real-time console output\n\nCtrl+C behavior:\n- During selection: go back to the previous step\n- During queue/build: confirm whether to cancel\n- Press twice quickly: force exit\n\nYou can also use command line arguments:\n\n```bash\n# Run with Jenkins project URL - Deploy project directly without selection\njenkins -U http://jenkins.example.com:8081/job/My-Job/ -u username -t api_token\n\n# Run with Jenkins server URL - Show project list for selection and deploy\njenkins -U http://jenkins.example.com:8081 -u username -t api_token\n\n# Run with Jenkins auth cookie (e.g. jwt_token) - Use only when API token is not accepted\njenkins -U http://jenkins.example.com:8081 --cookie \"jwt_token=your-jwt\"\n```\n\nAvailable command line options:\n- `-U, --url \u003cURL\u003e`: Jenkins server URL or project URL\n- `-u, --user \u003cUSER\u003e`: Jenkins username\n- `-t, --token \u003cTOKEN\u003e`: Jenkins API token\n- `-c, --cookie \u003cCOOKIE\u003e`: Jenkins auth cookie (e.g. jwt_token=...)\n\n## Configuration\n\nCreate a file named `.jenkins.toml` in your home directory with the following content:\n\n```toml\n# $HOME/.jenkins.toml\n[config]\n# locale = \"en-US\" # (optional), default auto detect, e.g. zh-CN, en-US\n# enable_history = false # (optional), default true\n# check_update = false # (optional), default true\n# timeout = 30 # (optional), HTTP request timeout in seconds, default 30\n\n[[jenkins]]\nname = \"SIT\"\nurl = \"https://jenkins-sit.example.com\"\nuser = \"your-username\"\ntoken = \"your-api-token\"\n# includes = []\n# excludes = []\n\n# [[jenkins]]\n# name = \"PROD\"\n# url = \"https://jenkins-prod.example.com\"\n# user = \"your-username\"\n# token = \"your-api-token\"\n# includes = [\"frontend\", \"backend\"]\n# excludes = [\"test\"]\n```\n\n### Configuration Options\n\n- `config`: Global configuration section\n  - `locale`: Set language (optional), default auto detect, e.g. \"zh-CN\", \"en-US\"\n  - `enable_history`: Remember last build parameters (optional), default true, set to false to disable\n  - `check_update`: Automatically check for updates (optional), default true, set to false to disable\n  - `timeout`: HTTP request timeout in seconds (optional), default 30\n- `jenkins`: Service configuration section (supports multiple services)\n  - `name`: Service name (e.g., \"SIT\", \"UAT\", \"PROD\")\n  - `url`: Jenkins server URL\n  - `user`: Your Jenkins user ID\n  - `token`: Your Jenkins API token\n  - `includes`: List of strings or regex patterns to include projects (optional)\n  - `excludes`: List of strings or regex patterns to exclude projects (optional)\n  - `enable_history`: Remember build parameters (optional), overrides global setting if specified\n  - `cookie`: Optional, Jenkins auth cookie (e.g. jwt_token=...). Sends a Cookie header when set.\n  - `cookie_refresh`: Optional, cookie auto-update configuration (updates the `cookie` value)\n    - `url`: Refresh endpoint URL\n    - `method`: HTTP method, default \"POST\"\n    - `request`: Optional, request parameters (replaces `${cookie.\u003cname\u003e}` placeholders with values from the `cookie` field):\n      - `headers`: Optional, extra request headers (for example `X-Client-Id = \"your-client-id\"`)\n      - `query`: URL query parameters\n      - `form`: x-www-form-urlencoded body parameters\n      - `json`: JSON body payload (supports string/number/boolean/object/array)\n    - `cookie_updates`: Optional, cookie updates extracted from the response (written back to the `cookie` field):\n      - `body.json:\u003cpath\u003e`: JSON body path, e.g. `body.json:data.refreshToken`\n      - `header:\u003cname\u003e`: Response header name, e.g. `header:X-JWT-Token`\n      - `body.regex:\u003cpattern\u003e`: Regex against response body, use capture group 1, e.g. `body.regex:token=([\\\\w.-]+)`\n\n### Cookie Authentication (Optional)\n\nMost users should use `user` + `token`. Cookie auth is an optional fallback for setups that do not accept API tokens.\n\nNote: If you have an extra endpoint to refresh cookie values, configure `cookie_refresh` to call it and write back to `cookie`; otherwise you can ignore `cookie_refresh`.\n\n```toml\n[[jenkins]]\nname = \"Cookie-Refresh\"\nurl = \"https://jenkins.example.com\"\ncookie = \"jwt_token=your-jwt\"\n\n[jenkins.cookie_refresh]\nurl = \"https://auth.example.com/api/refresh-token\"\nmethod = \"POST\"\n# Pick one request style:\n# request.query = { refreshToken = \"${cookie.jwt_token}\" } # send via query params\nrequest.json = { refreshToken = \"${cookie.jwt_token}\" } # send via JSON body\ncookie_updates = { jwt_token = \"body.json:data.refreshToken\" }\n```\n\nLogin API example (token returned in JSON body):\n\n```toml\n[[jenkins]]\nname = \"Login-Refresh\"\nurl = \"https://jenkins.example.com\"\n\n[jenkins.cookie_refresh]\nurl = \"https://auth.example.com/api/auth/login\"\nmethod = \"POST\"\n# Optional custom headers:\n# request.headers = { X-Client-Id = \"your-client-id\" }\nrequest.json = { username = \"your-username\", password = \"your-encrypted-password\", remember = true }\ncookie_updates = { jwt_token = \"body.json:data.token\" }\n```\n\n### Project Filtering\n\nYou can use `includes` or `excludes` to filter projects:\n\n- `includes: [\"frontend\", \"backend\", \"^api-\"]` # Include projects containing [frontend, backend, api-]\n- `excludes: [\"test\", \"dev\", \".*-deprecated$\"]` # Exclude projects containing [test, dev, *-deprecated]\n\nNote: Regex patterns are case-sensitive unless specified otherwise (e.g., `(?i)` for case-insensitive matching).\n\n### Username and API Token\n\nYour Jenkins username is typically the same as your login username for the Jenkins web interface.\n\nTo generate an API token:\n\n1. Log in to your Jenkins server\n2. Click on your name in the top right corner\n3. Click on `Configure` in the left sidebar\n4. In the `API Token` section, click `Add new Token`\n5. Give your token a name and click \"Generate\"\n6. Copy the generated token and paste it into your `.jenkins.toml` file\n\nNote: Keep your API token secure. Do not share it or commit it to version control.\n\n## TODOs\n\n- [x] Support multiple Jenkins services\n- [x] Support string and text parameter types\n- [x] Support choice parameter type\n- [x] Support boolean parameter type\n- [x] Support password parameter type\n- [x] Auto-detect current directory's git branch\n- [x] Remember last selected project and build parameters\n- [x] i18n support (fluent)\n- [x] Automatically check for updates\n\n## Stargazers over time\n[![Stargazers over time](https://starchart.cc/kairyou/jenkins-cli.svg?variant=adaptive)](https://starchart.cc/kairyou/jenkins-cli)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairyou%2Fjenkins-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkairyou%2Fjenkins-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairyou%2Fjenkins-cli/lists"}