Getting Started with Jenkins CLI
To begin, log into your Jenkins portal and navigate to Manage Jenkins. Scroll down to the Tools and Actions section and click on Jenkins CLI.
Displaying CLI Help
Use the following command to display the Jenkins CLI help information:Installing the Jenkins CLI
On your Jenkins host, open a terminal and download the Jenkins CLI JAR with the command below:Even though you are operating directly on the Jenkins host, authentication is still required for CLI operations.
Authenticating with Jenkins
To authenticate via the CLI, follow these steps:- Log in to your Jenkins portal.
- Click on your username and select Configure.
- Scroll down to API Tokens.
- If you do not have an API token, click Add New Token to generate one.

Working with Jobs Using the CLI
Listing Jobs
To see the available jobs, run:test1. To further explore, let’s create a new job.
Creating a New Job
- In the Jenkins portal, create a new CI/CD pipeline job. For example, name it Test2.
- Select the Pipeline option and click OK.
- In the job configuration, scroll down and click Try Sample Pipeline, then choose Hello World.
- Click Save to finalize the setup.


Building a Job
Now, build the newly created job using:Ensure that you monitor the Jenkins job status in the portal to troubleshoot any issues with job execution.
Summary
This guide demonstrated how to:- Download and install the Jenkins CLI.
- Authenticate to Jenkins using an API token.
- List available jobs and build a specific job using CLI commands.