Open In App

How To List All The Jenkins Plugins Configured In CLI ?

Last Updated : 12 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Jenkins is an open-source automation server that plays an important role in Continuous Integration and Continuous Deployment (CI/CD) in the software development life cycle (SDLC). Jenkins plugins are the extensions that will enhance the functionalities of Jenkins like source code management, building, testing, artifact management, notifications, monitoring, security, logging, scripting, automation, cloud integration, and many more.

What is Command-Line-Interface (CLI)?

A Command Line Interface (CLI) is a text-based interface that allows users to interact with a computer or software with the help of commands and scripts in a specific syntax. When a user types instructions into a terminal or console in a CLI, the system outputs text in response. Typically, the user enters precise commands and parameters, and the system carries out the required action while text-based feedback or results are provided.

Understanding the Dynamics and Impact of Installed Plugins

  • Functionality: Jenkins plugins extend its core functionality, allowing users to customize and enhance their Jenkins instance according to their specific needs. Knowing which plugins are installed enables users to understand the capabilities available to them and effectively utilize them to optimize their Jenkins workflows.
  • Security: Plugins can introduce security vulnerabilities if they are outdated or have known security issues. By keeping track of installed plugins, users can ensure they are promptly updated to the latest secure versions, minimizing the risk of security breaches.
  • Compatibility: Plugins may have dependencies on other plugins or specific versions of Jenkins. Knowing which plugins are installed helps users maintain compatibility between different components of their Jenkins environment, preventing conflicts and ensuring smooth operation.
  • Troubleshooting: When issues arise within Jenkins, knowing the installed plugins can help in diagnosing the problem. Users can identify whether a malfunction is caused by a specific plugin, facilitating targeted troubleshooting and resolution.
  • Performance: Some plugins may have a significant impact on Jenkins’s performance. By monitoring installed plugins, users can identify resource-intensive plugins and optimize their usage to improve overall system performance.

To More Continuous Integration and Continuous Deployment (CI/CD).

Limitations Of Direct CLI Commands

  • It only provides basic information about installed plugins, and their names or versions, but it lacks of details on metadata, dependencies, or compatibility information.
  • Typically do not offer dependency resolution capabilities. The user needs to manually track and install required dependencies for plugins.
  • Browsing available plugins and configuration will be difficult due to nongraphical user interface (GUI) interactions.
  • If there are any issues related to plugins, CLI commands may not offer comprehensive error messages or logging capabilities, making troubleshooting more challenging compared to Jenkins Web.
  • Users should be familiar with command-line syntax in order to use CLI more efficiently.

Step-By-Step Process To List All Jenkins Plugins Configured In CLI

Step 1: Access the Jenkins server and download the Jenkins-cli.jar file.

  • To access Jenkins CLI, first, we need to download the Jenkins-cli.jar file.
  • Open the terminal or command prompt and login to the Jenkins server.
  • Use this below command to download jenkins-cli.jar

sudo wget http://your.jenkins.url/ jnlpJars/jenkins-cli.jar

Download  jenkins-cli.jar

Step 2 : Access Jenkins dashboard and get API token.

  • Login to the Jenkins web interface.
  • Go to configure under user profile (right end side).

Configure

  • Scroll down to the “API Token” section and generate a new token.

Generate new tokenCopy this generated token

Step 3 : Authentication with API token.

  • Go to Jenkins instillation path. i.e. /var/lib/jenkins
  • Use this below command for authentication.

java -jar jenkins-cli.jar -s http://your.jenkins.url/ -auth username:API_token

authentication-(1)

Step 4 : List all Jenkins plugins using the below command.

java -jar jenkins-cli.jar -s http://your.jenkins.url/ -auth username:API_token list-plugins

listplugins-(1)

Jenkins Plugins – FAQ’s

Do I Need To Install Jenkins CLI Separately?

No, Jenkins has a built-in CLI, In order to interact we need to download jenkins-cli.jar file on the machine and give proper authentication like API token or SSH.

How do I know if my Jenkins server requires authentication for CLI?

If your Jenkins server is configured with security (username/password or API token), you will be prompted for credentials when running CLI commands.

Can I run Jenkins CLI commands from any machine?

Yes, If you have network access to the Jenkins server. You need to download the Jenkins CLI JAR file on the machine from where you want to run the commands.

How to update the list of plugins if new ones are installed?

You can rerun the list-plugins command. It fetches the latest information from the Jenkins server and displays the updated list.

Are there any other useful Jenkins CLI commands?

Yes, there are many Jenkins CLI commands for various tasks. The available commands you can find in Jenkins CLI under Manage Jenkins option.

Example: build, console, connect-node, copy-job, list-jobs etc…



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads