{"id":2036,"date":"2021-12-22T13:53:55","date_gmt":"2021-12-22T13:53:55","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2036"},"modified":"2022-03-04T12:52:47","modified_gmt":"2022-03-04T12:52:47","slug":"jenkins-commands-lines-reference-from-jenkins","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/jenkins-commands-lines-reference-from-jenkins\/","title":{"rendered":"Jenkins commands lines reference from jenkins using jenkins-cli.jar"},"content":{"rendered":"\n<p>You can access various features in Jenkins through a command-line tool. See&nbsp;<a href=\"https:\/\/www.jenkins.io\/redirect\/cli\" target=\"_blank\" rel=\"noopener\">the documentation<\/a>&nbsp;for more details of this feature. To get started, download&nbsp;<a href=\"http:\/\/13.235.81.87:8080\/jnlpJars\/jenkins-cli.jar\">jenkins-cli.jar<\/a>, and run it as follows:<\/p>\n\n\n\n<pre id=\"example\" class=\"wp-block-preformatted\">java -jar <a href=\"http:\/\/13.235.81.87:8080\/jnlpJars\/jenkins-cli.jar\">jenkins-cli.jar<\/a> -s http:\/\/13.235.81.87:8080\/ -webSocket help<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Available Commands<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/add-job-to-view\">add-job-to-view<\/a><\/td><td>Adds jobs to view.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/build\">build<\/a><\/td><td>Builds a job, and optionally waits until its completion.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/cancel-quiet-down\">cancel-quiet-down<\/a><\/td><td>Cancel the effect of the &#8220;quiet-down&#8221; command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/clear-queue\">clear-queue<\/a><\/td><td>Clears the build queue.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/connect-node\">connect-node<\/a><\/td><td>Reconnect to a node(s)<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/console\">console<\/a><\/td><td>Retrieves console output of a build.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/copy-job\">copy-job<\/a><\/td><td>Copies a job.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/create-credentials-by-xml\">create-credentials-by-xml<\/a><\/td><td>Create Credential by XML<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/create-credentials-domain-by-xml\">create-credentials-domain-by-xml<\/a><\/td><td>Create Credentials Domain by XML<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/create-job\">create-job<\/a><\/td><td>Creates a new job by reading stdin as a configuration XML file.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/create-node\">create-node<\/a><\/td><td>Creates a new node by reading stdin as a XML configuration.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/create-view\">create-view<\/a><\/td><td>Creates a new view by reading stdin as a XML configuration.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/declarative-linter\">declarative-linter<\/a><\/td><td>Validate a Jenkinsfile containing a Declarative Pipeline<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-builds\">delete-builds<\/a><\/td><td>Deletes build record(s).<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-credentials\">delete-credentials<\/a><\/td><td>Delete a Credential<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-credentials-domain\">delete-credentials-domain<\/a><\/td><td>Delete a Credentials Domain<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-job\">delete-job<\/a><\/td><td>Deletes job(s).<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-node\">delete-node<\/a><\/td><td>Deletes node(s)<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/delete-view\">delete-view<\/a><\/td><td>Deletes view(s).<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/disable-job\">disable-job<\/a><\/td><td>Disables a job.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/disable-plugin\">disable-plugin<\/a><\/td><td>Disable one or more installed plugins.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/disconnect-node\">disconnect-node<\/a><\/td><td>Disconnects from a node.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/enable-job\">enable-job<\/a><\/td><td>Enables a job.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/enable-plugin\">enable-plugin<\/a><\/td><td>Enables one or more installed plugins transitively.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-credentials-as-xml\">get-credentials-as-xml<\/a><\/td><td>Get a Credentials as XML (secrets redacted)<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-credentials-domain-as-xml\">get-credentials-domain-as-xml<\/a><\/td><td>Get a Credentials Domain as XML<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-gradle\">get-gradle<\/a><\/td><td>List available gradle installations<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-job\">get-job<\/a><\/td><td>Dumps the job definition XML to stdout.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-node\">get-node<\/a><\/td><td>Dumps the node definition XML to stdout.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/get-view\">get-view<\/a><\/td><td>Dumps the view definition XML to stdout.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/groovy\">groovy<\/a><\/td><td>Executes the specified Groovy script.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/groovysh\">groovysh<\/a><\/td><td>Runs an interactive groovy shell.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/help\">help<\/a><\/td><td>Lists all the available commands or a detailed description of single command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/import-credentials-as-xml\">import-credentials-as-xml<\/a><\/td><td>Import credentials as XML. The output of &#8220;list-credentials-as-xml&#8221; can be used as input here as is, the only needed change is to set the actual Secrets which are redacted in the output.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/install-plugin\">install-plugin<\/a><\/td><td>Installs a plugin either from a file, an URL, or from update center.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/keep-build\">keep-build<\/a><\/td><td>Mark the build to keep the build forever.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-changes\">list-changes<\/a><\/td><td>Dumps the changelog for the specified build(s).<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-credentials\">list-credentials<\/a><\/td><td>Lists the Credentials in a specific Store<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-credentials-as-xml\">list-credentials-as-xml<\/a><\/td><td>Export credentials as XML. The output of this command can be used as input for &#8220;import-credentials-as-xml&#8221; as is, the only needed change is to set the actual Secrets which are redacted in the output.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-credentials-context-resolvers\">list-credentials-context-resolvers<\/a><\/td><td>List Credentials Context Resolvers<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-credentials-providers\">list-credentials-providers<\/a><\/td><td>List Credentials Providers<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-jobs\">list-jobs<\/a><\/td><td>Lists all jobs in a specific view or item group.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/list-plugins\">list-plugins<\/a><\/td><td>Outputs a list of installed plugins.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/mail\">mail<\/a><\/td><td>Reads stdin and sends that out as an e-mail.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/offline-node\">offline-node<\/a><\/td><td>Stop using a node for performing builds temporarily, until the next &#8220;online-node&#8221; command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/online-node\">online-node<\/a><\/td><td>Resume using a node for performing builds, to cancel out the earlier &#8220;offline-node&#8221; command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/quiet-down\">quiet-down<\/a><\/td><td>Quiet down Jenkins, in preparation for a restart. Don\u2019t start any builds.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/reload-configuration\">reload-configuration<\/a><\/td><td>Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/reload-job\">reload-job<\/a><\/td><td>Reload job(s)<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/remove-job-from-view\">remove-job-from-view<\/a><\/td><td>Removes jobs from view.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/replay-pipeline\">replay-pipeline<\/a><\/td><td>Replay a Pipeline build with edited script taken from standard input<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/restart\">restart<\/a><\/td><td>Restart Jenkins.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/restart-from-stage\">restart-from-stage<\/a><\/td><td>Restart a completed Declarative Pipeline build from a given stage.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/safe-restart\">safe-restart<\/a><\/td><td>Safely restart Jenkins.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/safe-shutdown\">safe-shutdown<\/a><\/td><td>Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/session-id\">session-id<\/a><\/td><td>Outputs the session ID, which changes every time Jenkins restarts.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/set-build-description\">set-build-description<\/a><\/td><td>Sets the description of a build.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/set-build-display-name\">set-build-display-name<\/a><\/td><td>Sets the displayName of a build.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/set-external-build-result\">set-external-build-result<\/a><\/td><td>Set external monitor job result.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/shutdown\">shutdown<\/a><\/td><td>Immediately shuts down Jenkins server.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/stop-builds\">stop-builds<\/a><\/td><td>Stop all running builds for job(s)<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/update-credentials-by-xml\">update-credentials-by-xml<\/a><\/td><td>Update Credentials by XML<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/update-credentials-domain-by-xml\">update-credentials-domain-by-xml<\/a><\/td><td>Update Credentials Domain by XML<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/update-job\">update-job<\/a><\/td><td>Updates the job definition XML from stdin. The opposite of the get-job command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/update-node\">update-node<\/a><\/td><td>Updates the node definition XML from stdin. The opposite of the get-node command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/update-view\">update-view<\/a><\/td><td>Updates the view definition XML from stdin. The opposite of the get-view command.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/version\">version<\/a><\/td><td>Outputs the current version.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/wait-node-offline\">wait-node-offline<\/a><\/td><td>Wait for a node to become offline.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/wait-node-online\">wait-node-online<\/a><\/td><td>Wait for a node to become online.<\/td><\/tr><tr><td><a href=\"http:\/\/13.235.81.87:8080\/cli\/command\/who-am-i\">who-am-i<\/a><\/td><td>Reports your credential and permissions.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_63502\"><iframe loading=\"lazy\"  id=\"_ytid_57032\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_63502\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>You can access various features in Jenkins through a command-line tool. See&nbsp;the documentation&nbsp;for more details of this feature. To get started, download&nbsp;jenkins-cli.jar, and run it as follows: java -jar jenkins-cli.jar&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[42],"tags":[145],"class_list":["post-2036","post","type-post","status-publish","format-standard","hentry","category-jenkins","tag-jenkins"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2036"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2036\/revisions"}],"predecessor-version":[{"id":26161,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2036\/revisions\/26161"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}