<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CLI Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/cli/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/cli/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 21 Feb 2026 07:13:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Understanding Command-Line: Use Cases, Architecture, and Getting Started Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/understanding-command-line-use-cases-architecture-and-getting-started-guide/</link>
					<comments>https://www.scmgalaxy.com/tutorials/understanding-command-line-use-cases-architecture-and-getting-started-guide/#respond</comments>
		
		<dc:creator><![CDATA[Vijay K]]></dc:creator>
		<pubDate>Sat, 14 Jun 2025 12:20:00 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[CommandLine]]></category>
		<category><![CDATA[CommandLineInterface]]></category>
		<category><![CDATA[OperatingSystem]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ShellScripting]]></category>
		<category><![CDATA[SystemAdministration]]></category>
		<category><![CDATA[TechBasics]]></category>
		<category><![CDATA[terminal]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=12757</guid>

					<description><![CDATA[<p>What is Command-Line? The command-line refers to a text-based interface used to interact with a computer&#8217;s operating system or software [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/understanding-command-line-use-cases-architecture-and-getting-started-guide/">Understanding Command-Line: Use Cases, Architecture, and Getting Started Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="683" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-96-1024x683.png" alt="" class="wp-image-12763" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-96-1024x683.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-96-300x200.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-96-768x512.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-96.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">What is Command-Line?</h3>



<p class="wp-block-paragraph">The <strong>command-line</strong> refers to a text-based interface used to interact with a computer&#8217;s operating system or software by typing commands. It is an alternative to <strong>graphical user interfaces (GUIs)</strong>, where users interact with the system via icons, buttons, and menus. The command-line interface (CLI) allows users to input commands directly, providing a way to perform tasks and execute programs.</p>



<p class="wp-block-paragraph">The command-line is usually accessed through a <strong>terminal</strong> or <strong>shell</strong>, which is a program that processes user commands. Popular examples of command-line interfaces include <strong>Bash</strong> (used in Linux and macOS), <strong>Command Prompt</strong> (Windows), and <strong>PowerShell</strong> (Windows). These interfaces interpret the user&#8217;s typed commands and communicate with the operating system to perform the desired actions, such as file management, system configuration, or running programs.</p>



<h3 class="wp-block-heading">Key Features of Command-Line:</h3>



<ol class="wp-block-list">
<li><strong>Text-based Input and Output</strong>: Users type text commands, and the system responds with text output.</li>



<li><strong>Power and Flexibility</strong>: The command-line provides direct access to system functions, often with greater flexibility and power than a GUI.</li>



<li><strong>Automation</strong>: The command-line is ideal for automating repetitive tasks with scripts or batch files.</li>



<li><strong>System Interaction</strong>: It allows low-level interaction with the operating system, enabling users to modify system configurations, manage files, and control running processes.</li>
</ol>



<p class="wp-block-paragraph">The command-line is favored by system administrators, developers, and power users for its efficiency, speed, and ability to handle complex tasks in a streamlined manner.</p>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">What are the Major Use Cases of Command-Line?</h3>



<p class="wp-block-paragraph">The command-line interface (CLI) has been a core tool in <strong>system administration</strong>, <strong>software development</strong>, and <strong>automation</strong> for many years. Here are some of the major use cases of the command-line:</p>



<h4 class="wp-block-heading">1. <strong>System Administration</strong></h4>



<p class="wp-block-paragraph">System administrators use the CLI to manage and configure computer systems. With the command-line, they can perform tasks like:</p>



<ul class="wp-block-list">
<li><strong>File management</strong> (copying, moving, deleting files, and directories).</li>



<li><strong>Process management</strong> (monitoring and controlling running processes).</li>



<li><strong>Network configuration</strong> (setting up network interfaces, checking connectivity).</li>



<li><strong>User management</strong> (creating, modifying, or deleting users).</li>
</ul>



<p class="wp-block-paragraph">For example, on Linux systems, commands like <code>ls</code>, <code>cp</code>, <code>ps</code>, and <code>useradd</code> allow admins to manage files, monitor processes, and create new users.</p>



<h4 class="wp-block-heading">2. <strong>Automation and Scripting</strong></h4>



<p class="wp-block-paragraph">The command-line is often used to automate tasks through <strong>shell scripting</strong>. Scripts are collections of commands that can be executed in sequence. This allows repetitive tasks to be automated, improving efficiency.</p>



<ul class="wp-block-list">
<li><strong>Bash scripting</strong> (for Linux/macOS) and <strong>batch scripting</strong> (for Windows) allow users to write scripts for file backups, software installation, system updates, and more.</li>
</ul>



<p class="wp-block-paragraph">For example, a simple Bash script to backup files could look like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
#!/bin/bash
cp -r /home/user/data /backup/location

</pre></div>


<h4 class="wp-block-heading">3. <strong>Development and Debugging</strong></h4>



<p class="wp-block-paragraph">Developers frequently use the CLI to run compilers, build tools, version control systems, and debuggers. Tools like <strong>Git</strong>, <strong>Docker</strong>, <strong>npm</strong>, and <strong>make</strong> are all accessed through the command-line interface.</p>



<ul class="wp-block-list">
<li><strong>Git</strong> is a distributed version control system, and commands like <code>git commit</code>, <code>git pull</code>, and <code>git push</code> are run through the command-line to manage code repositories.</li>



<li><strong>Docker</strong> allows developers to build, run, and manage containers using commands such as <code>docker build</code> and <code>docker run</code>.</li>
</ul>



<h4 class="wp-block-heading">4. <strong>Remote System Access</strong></h4>



<p class="wp-block-paragraph">The command-line is often used to interact with remote systems, especially for managing servers or cloud infrastructure. Tools like <strong>SSH</strong> (Secure Shell) allow users to connect to and control remote servers through the CLI.</p>



<ul class="wp-block-list">
<li>Administrators can use the <code>ssh</code> command to access a server and perform tasks remotely:</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
ssh user@remote-server-ip

</pre></div>


<h4 class="wp-block-heading">5. <strong>Package Management and Software Installation</strong></h4>



<p class="wp-block-paragraph">Most operating systems provide package management tools that allow users to install, update, and remove software via the command-line.</p>



<ul class="wp-block-list">
<li>On Linux, tools like <strong>apt</strong> (for Debian-based systems) and <strong>yum</strong> (for Red Hat-based systems) are commonly used:</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
sudo apt install package-name

</pre></div>


<ul class="wp-block-list">
<li>On macOS, <strong>Homebrew</strong> is a popular package manager accessed via the terminal.</li>
</ul>



<h4 class="wp-block-heading">6. <strong>Text Processing</strong></h4>



<p class="wp-block-paragraph">The command-line is commonly used to manipulate text files. Tools like <code>grep</code>, <code>awk</code>, <code>sed</code>, and <code>sort</code> allow users to search, filter, modify, and sort large text files efficiently.</p>



<p class="wp-block-paragraph">For example:</p>



<ul class="wp-block-list">
<li><code>grep</code> is used to search for patterns within files:</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
grep &quot;search_term&quot; file.txt

</pre></div>


<h4 class="wp-block-heading">7. <strong>Networking and Connectivity</strong></h4>



<p class="wp-block-paragraph">The CLI is essential for troubleshooting network issues, managing network services, and testing network connections. Commands like <code>ping</code>, <code>ifconfig</code>, <code>netstat</code>, and <code>curl</code> are used to manage and test network settings.</p>



<p class="wp-block-paragraph">For example:</p>



<ul class="wp-block-list">
<li><code>ping</code> checks connectivity to a remote server:</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
ping google.com

</pre></div>


<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">How Command-Line Works Along with Architecture?</h3>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="683" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-97-1024x683.png" alt="" class="wp-image-12764" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-97-1024x683.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-97-300x200.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-97-768x512.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2025/06/image-97.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">The command-line operates within the architecture of an <strong>operating system</strong>. The basic flow of how the command-line works involves interaction with the operating system through <strong>shells</strong>, <strong>processes</strong>, and <strong>commands</strong>.</p>



<h4 class="wp-block-heading">1. <strong>Shells and Command Interpreters</strong></h4>



<p class="wp-block-paragraph">The command-line interface is provided by <strong>shells</strong>, which are programs that interpret the user’s commands and send them to the operating system. Popular shells include:</p>



<ul class="wp-block-list">
<li><strong>Bash</strong> (Bourne Again Shell) – commonly used in Linux and macOS.</li>



<li><strong>PowerShell</strong> – used in Windows for more advanced scripting and management.</li>



<li><strong>Command Prompt</strong> – the traditional CLI for Windows.</li>
</ul>



<p class="wp-block-paragraph">The shell reads the input from the user, interprets the command, and passes it to the operating system for execution.</p>



<h4 class="wp-block-heading">2. <strong>Processes and Task Management</strong></h4>



<p class="wp-block-paragraph">Once a command is entered in the command-line interface, it is translated into a process that is executed by the operating system. The operating system manages the process lifecycle, which includes:</p>



<ul class="wp-block-list">
<li><strong>Launching the Process</strong>: When a user runs a command, the shell creates a process and assigns resources to it (CPU time, memory).</li>



<li><strong>Managing Execution</strong>: The operating system manages the execution of the process, allocating resources and handling system calls.</li>



<li><strong>Process Termination</strong>: After the command completes its task, the process terminates, and the operating system frees up resources.</li>
</ul>



<h4 class="wp-block-heading">3. <strong>File System Interaction</strong></h4>



<p class="wp-block-paragraph">When commands are executed, they often interact with the <strong>file system</strong> to access, modify, or manage files. For example:</p>



<ul class="wp-block-list">
<li><strong>File management commands</strong>: <code>ls</code>, <code>cd</code>, <code>cp</code>, <code>mv</code> are used to navigate and manipulate files.</li>



<li><strong>Piping and Redirection</strong>: Outputs from one command can be redirected to files or passed as input to other commands. This allows for efficient data manipulation using a sequence of commands.</li>
</ul>



<p class="wp-block-paragraph">For example, <code>ls | grep "example"</code> lists all files and filters the output using <code>grep</code> to search for the term &#8220;example&#8221;.</p>



<h4 class="wp-block-heading">4. <strong>Environment Variables and Configurations</strong></h4>



<p class="wp-block-paragraph">The shell also makes use of <strong>environment variables</strong> that store system-wide or user-specific configuration settings. These variables control the behavior of the operating system and applications.</p>



<ul class="wp-block-list">
<li>Examples: <code>PATH</code>, <code>HOME</code>, <code>USER</code>, and <code>SHELL</code>.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">Basic Workflow of Command-Line</h3>



<p class="wp-block-paragraph">The basic workflow of using the command-line interface involves several steps to execute tasks. Here’s a typical sequence of actions in a command-line-based workflow:</p>



<ol class="wp-block-list">
<li><strong>Open the Terminal or Command Prompt</strong>
<ul class="wp-block-list">
<li>On Linux/macOS, open a terminal emulator like <strong>GNOME Terminal</strong> or <strong>iTerm</strong>.</li>



<li>On Windows, open <strong>Command Prompt</strong> or <strong>PowerShell</strong>.</li>
</ul>
</li>



<li><strong>Enter Commands</strong>
<ul class="wp-block-list">
<li>Type a command into the terminal window. This can be a file operation, network request, system configuration, or software management command.</li>



<li>For example: <code>ls -l</code></li>



<li>This lists files in the current directory in long format.</li>
</ul>
</li>



<li><strong>Execute the Command</strong>
<ul class="wp-block-list">
<li>Press <strong>Enter</strong> to execute the command. The system processes the command, interacts with the underlying resources (files, processes, network), and displays the results.</li>
</ul>
</li>



<li><strong>View Output</strong>
<ul class="wp-block-list">
<li>The output from the command is displayed in the terminal. This can be text output, error messages, or results.</li>
</ul>
</li>



<li><strong>Chain Commands (Piping and Redirection)</strong>
<ul class="wp-block-list">
<li>You can combine multiple commands using <strong>pipes</strong> (<code>|</code>) and <strong>redirection</strong> (<code>&gt;</code>, <code>&gt;&gt;</code>). For example: <code>ps aux | grep "myapp"</code></li>



<li>This command lists all running processes and filters them to find &#8220;myapp&#8221;.</li>
</ul>
</li>



<li><strong>Use Scripts for Automation</strong>
<ul class="wp-block-list">
<li>To automate tasks, create scripts that contain a series of commands. Save the script as a <code>.sh</code> (Linux/macOS) or <code>.bat</code> (Windows) file and run it directly in the terminal.</li>
</ul>
</li>



<li><strong>Exit the Terminal</strong>
<ul class="wp-block-list">
<li>When you’re done, type <code>exit</code> or press the <strong>close</strong> button to exit the terminal or command prompt.</li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity">



<h3 class="wp-block-heading">Step-by-Step Getting Started Guide for Command-Line</h3>



<p class="wp-block-paragraph">To get started with the command-line interface, follow these steps:</p>



<h4 class="wp-block-heading">Step 1: <strong>Access the Command-Line</strong></h4>



<ul class="wp-block-list">
<li><strong>Linux/macOS</strong>: Open the terminal application.</li>



<li><strong>Windows</strong>: Open <strong>Command Prompt</strong> or <strong>PowerShell</strong>.</li>
</ul>



<h4 class="wp-block-heading">Step 2: <strong>Learn Basic Commands</strong></h4>



<p class="wp-block-paragraph">Begin by learning some basic commands:</p>



<ul class="wp-block-list">
<li><strong>Linux/macOS</strong>:
<ul class="wp-block-list">
<li><code>ls</code>: List files in the current directory.</li>



<li><code>cd</code>: Change the directory.</li>



<li><code>pwd</code>: Print the working directory.</li>



<li><code>cp</code>: Copy files.</li>



<li><code>rm</code>: Remove files.</li>
</ul>
</li>



<li><strong>Windows</strong>:
<ul class="wp-block-list">
<li><code>dir</code>: List files in the directory.</li>



<li><code>cd</code>: Change the directory.</li>



<li><code>cls</code>: Clear the screen.</li>



<li><code>copy</code>: Copy files.</li>



<li><code>del</code>: Delete files.</li>
</ul>
</li>
</ul>



<h4 class="wp-block-heading">Step 3: <strong>Navigate the File System</strong></h4>



<p class="wp-block-paragraph">Use commands like <code>cd</code> to navigate through directories and <code>ls</code> (Linux/macOS) or <code>dir</code> (Windows) to list the contents of directories.</p>



<h4 class="wp-block-heading">Step 4: <strong>Run a Simple Command</strong></h4>



<p class="wp-block-paragraph">Try a simple command, such as listing the files in the current directory:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
ls

</pre></div>


<h4 class="wp-block-heading">Step 5: <strong>Experiment with File Operations</strong></h4>



<p class="wp-block-paragraph">Try creating, moving, or deleting files using commands like <code>touch</code>, <code>mv</code>, <code>rm</code> (Linux/macOS) or <code>echo</code>, <code>move</code>, <code>del</code> (Windows).</p>



<h4 class="wp-block-heading">Step 6: <strong>Write a Script</strong></h4>



<p class="wp-block-paragraph">Create a simple shell script (Linux/macOS) or batch script (Windows) to automate a series of commands. Save the script with <code>.sh</code> (Linux/macOS) or <code>.bat</code> (Windows) and run it.</p>



<p class="wp-block-paragraph">Example script for Linux/macOS:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
#!/bin/bash
echo &quot;Hello, World!&quot;

</pre></div>


<h4 class="wp-block-heading">Step 7: <strong>Explore Advanced Features</strong></h4>



<p class="wp-block-paragraph">Once you’re comfortable with basic commands, explore more advanced features such as:</p>



<ul class="wp-block-list">
<li><strong>Piping and redirection</strong>.</li>



<li><strong>Background processes</strong>.</li>



<li><strong>Environment variables</strong>.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity">



<p class="wp-block-paragraph">The command-line is a powerful tool for interacting with your system, automating tasks, and gaining deeper control over your environment. Mastering the CLI will enhance your ability to perform complex tasks quickly and efficiently, making you more proficient as a developer, system administrator, or power user.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/understanding-command-line-use-cases-architecture-and-getting-started-guide/">Understanding Command-Line: Use Cases, Architecture, and Getting Started Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/understanding-command-line-use-cases-architecture-and-getting-started-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Complete guide to use Jenkins CLI / Command line &#124; Jenkins Tutorials</title>
		<link>https://www.scmgalaxy.com/tutorials/complete-guide-to-use-jenkins-cli-command-line/</link>
					<comments>https://www.scmgalaxy.com/tutorials/complete-guide-to-use-jenkins-cli-command-line/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Sun, 08 Jan 2017 08:37:19 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[CLI / Command line]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Jenkins CLI / Command line]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Jenkins Command line Guide]]></category>
		<category><![CDATA[Jenkins Command line Tutorials]]></category>
		<category><![CDATA[Jenkins Tutorials]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2017/01/08/complete-guide-to-use-jenkins-cli-command-line/</guid>

					<description><![CDATA[<p>Complete guide to use Jenkins CLI / Command line? Run Jenkins build from command is very simple in Linux system. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/complete-guide-to-use-jenkins-cli-command-line/">Complete guide to use Jenkins CLI / Command line | Jenkins Tutorials</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img decoding="async" class="size-full wp-image-2959 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/01/complete-guide-to-use-jenki.png" alt="jenkins-cli-command-line" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/01/complete-guide-to-use-jenki.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2017/01/complete-guide-to-use-jenki-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></div>
<div>Complete guide to use Jenkins CLI / Command line?</div>
<div></div>
<div>Run Jenkins build from command is very simple in Linux system. If you are using using windows, gitbash is a recommended which has bash shell in built. You can use windows command line as well. Jenkins has support to command line client that allows you to access Jenkins from command line.</div>
<div></div>
<div><strong>To Trigger Jenkins build from command line some prerequisite are there</strong></div>
<div></div>
<div>Jenkins service is running.</div>
<div>Enable security option under “Configure Global Security”</div>
<div></div>
<div>Go to jenkins dashboard in Home page ( e.g http://localhost:8080/ ) -&gt; Manage Jenkins</div>
<div>-&gt; Configure Global Security -&gt; Click on “Enable security” checkbox</div>
<div></div>
<div>
<p>You can also configure “Access Control” and “Authorization” option in Global Security page.</p>
<div><strong>Download Jenkins-cli.jar</strong></div>
<div>Download Jenkins-cli.jar from http://&lt;your_jenkins_server_url&gt;/jnlpJars/jenkins-cli.jar. (Here &lt;your_jenkins_server_url&gt; is your respective Jenkins server URL (development or staging))</div>
<div>Go to http://&lt;your_jenkins_server_url&gt;/cli and build your command by following the instructions there.</div>
</div>
<div></div>
<div><strong>How to login to Jenkins using commands</strong></div>
<div>If your Jenkins requires authentication, use &#8211;username and &#8211;password or &#8211;password-file options to specify the credentials. To avoid doing this for every command, you can also use the login CLI command once (with the same credentials parameters), and after that you may use other commands without specifying credentials.</div>
<div></div>
<div>Whenever the CLI tries to to connect to the Jenkins server, it offers the before mentioned SSH keys. When the user has those keys but don&#8217;t want use them to authenticate, preventing being prompted by the key&#8217;s password, it&#8217;s possible to use the -noKeyAuth argument. This way the CLI will never try to use the SSH keys available. failure to authenticate by itself does not constitute a fatal error. It will instead try to execute the command anyway, as the anonymous user.</div>
<div></div>
<div></div>
<div><strong>Login Jenkins using username and Password</strong></div>
<div>Jenkins allow us to trigger Jenkins build with any specific user, For that we have to pass username and password in command line.</div>
<div>$ java -jar &#8220;/tmp/kitchen/cache/jenkins-cli.jar&#8221; -s http://localhost:8080 who-am-i &#8211;username jenkins &#8211;password foobar</div>
<div>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword</div>
<div></div>
<div><strong>Login Jenkins using public keys</strong></div>
<div>Starting 1.419 (which will be out July 4th), Jenkins CLI supports authentication based on the SSH key pair. Just like CloudBees DEV@cloud (or GitHub, or other similar sites), you interactively login from the web UI, then associate your public keys with your user account. Then CLI will silently authenticates itself using your ~/.ssh/id_rsa, ~/.ssh/id_dsa, or ~/.ssh/identity.</div>
<div>https://help.github.com/articles/generating-an-ssh-key/</div>
<div></div>
<div><strong>Login Jenkins using private keys</strong></div>
<div>You can also pass the priate key as follows</div>
<div>To use the -i option the syntax is as follows:</div>
<div>$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</div>
<div>$ java -jar jenkins-cli.jar [-s JENKINS_URL] [-i PRIVATE_KEY] command [options&#8230;] [arguments&#8230;]</div>
<div>For compatibility reasons, unless you use the -i option,</div>
<div></div>
<div><strong>Login Jenkins using initialAdminPassword</strong></div>
<div>try user &#8220;admin&#8221; and password from &#8220;Jenkins\secrets\initialAdminPassword&#8221;</div>
<div>java -jar jenkins-cli.jar -s http://localhost:8080 who-am-i &#8211;username admin &#8211;password fe3f1e1624ea4be8873b7a35e28b24be</div>
<div></div>
<div><strong>Login Jenkins using passphrase</strong></div>
<div>Go to http://jenkins-serer:8085/user/admin/configure and set the passphrase in &#8220;SSH Public Keys&#8221; and use the same passphrase with jenkins commands.</div>
<div></div>
<div><strong>E.g 1 &#8211; Getting help</strong></div>
<div>The list of the available commands depends on the server you are talking to. Visit https://jenkins.example.com/cli or use &#8216;help&#8217; command to list them all:</div>
<div>&gt; java -jar jenkins-cli.jar -s https://jenkins.example.com help [command]</div>
<div></div>
<div><strong>E.g 2 &#8211; Run Jenkins Build From Command Line</strong></div>
<div>&gt; java -jar jenkins-cli.jar -s http://&lt;jenkins server&gt;/ build build-name [-c] [-f] [-p] [-r N] [-s] [-v] [-w]</div>
<div></div>
<div>build-name : Name of the job to build</div>
<div>-c  : Check for SCM changes before starting the build, and if there&#8217;s no change, exit without doing a build</div>
<div>-f  : Follow the build progress. Like -s only interrupts are not passed through to the build.</div>
<div>-p  : Specify the build parameters in the key=value format.</div>
<div>-s  : Wait until the completion/abortion of the command. Interrupts are passed through to the build.</div>
<div>-v  : Prints out the console output of the build. Use with -s</div>
<div>-w  : Wait until the start of the command</div>
<div></div>
<div>Example  &#8211; java -jar jenkins-cli.jar -s http://localhost:8080/ build &#8216;my-project-build&#8217; &#8211;username roop &#8211;password roop</div>
<div></div>
<div><strong>E.g 3 &#8211; List all jobs under the view: tools</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ list-jobs tools</div>
<div></div>
<div><strong>E.g 4 &#8211; Get the configuration of the job: template</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ get-job template &gt; template.xml</div>
<div></div>
<div><strong>E.g 5 &#8211; Create a new job based on the configuration</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ create-job new_job_name &lt; new_job_name.xml</div>
<div></div>
<div><strong>E.g 6 &#8211; Run groovy script</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ groovy scripts/add_job_to_view.groovy</div>
<div>If there are any parameters in the script, just as:</div>
<div>import jenkins.model.*</div>
<div></div>
<div>if (args.length != 2 ) {</div>
<div>  println &#8220;Error on arguments!&#8221;</div>
<div>}</div>
<div>def jobName  = args[0] ?: &#8216;a_job&#8217;</div>
<div>def viewName = args[1] ?: &#8216;a_view&#8217;</div>
<div></div>
<div>println jobName + &#8216; &#8216; + viewName</div>
<div></div>
<div>def v = Jenkins.instance.getView(viewName)</div>
<div>def i = Jenkins.instance.getItemByFullName(jobName)</div>
<div>if (v &amp;&amp; i) {</div>
<div>  v.add(i)</div>
<div>}</div>
<div></div>
<div>pass the parameters as:</div>
<div></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ groovy scripts/add_job_to_view.groovy JOB_NAME VIEM_NAME</div>
<div></div>
<div><strong>E.g 7 &#8211; Build a job</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ build new_job_name</div>
<div></div>
<div><strong>E.g 8 &#8211; Diable a job</strong></div>
<div>$ java -jar jenkins-cli.jar -s http://jenkins/ disable-job new_job_name</div>
<div></div>
<div><strong>E.g 8 &#8211; Passing parameters when triggering a job build</strong></div>
<div>Job parameters are a very handy concept. Perhaps you&#8217;ve only ever used Jenkins or another CI system to automatically run builds when a remote SCM/git repo changes. You can also trigger builds manually from within Jenkins. And whilst you&#8217;re doing that, your job can prompt for parameters to the build.</div>
<div></div>
<div>For example, we have a job named similar to &#8220;Deploy XYZ App&#8221;. It has the git repo hardcoded in the job like a normal build, but when you press &#8220;Build&#8221;, it shows a list of options: string fields, drop-down lists, etc.</div>
<div></div>
<div>When the job runs, you can use these values anywhere within your job&#8217;s configuration. Its very cool.</div>
<div></div>
<div>But how to pass those same parameters via the CLI? You use the -p key=value flag for each parameter you want to pass.</div>
<div></div>
<div>So our finished product might look like:</div>
<div>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;Deploy XYZ App&#8217; -i ~/.ssh/id_rsa -s -v -p target_env=api.cloudfoundry.com -p branch=master</div>
<div></div>
<div><strong>Commons problems</strong></div>
<div>Operation timed out</div>
<div>$ java -jar jenkins-cli.jar -s YOUR_SERVER_URL help</div>
<div>Exception in thread &#8220;main&#8221; java.net.ConnectException: Operation timed out</div>
<div>at java.net.PlainSocketImpl.socketConnect(Native Method)</div>
<div>at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)</div>
<div>at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)</div>
<div>at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)</div>
<div>at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)</div>
<div>at java.net.Socket.connect(Socket.java:529)</div>
<div>at java.net.Socket.connect(Socket.java:478)</div>
<div>at java.net.Socket.&lt;init&gt;(Socket.java:375)</div>
<div>at java.net.Socket.&lt;init&gt;(Socket.java:189)</div>
<div>at hudson.cli.CLI.&lt;init&gt;(CLI.java:97)</div>
<div>at hudson.cli.CLI.&lt;init&gt;(CLI.java:82)</div>
<div>at hudson.cli.CLI._main(CLI.java:250)</div>
<div>at hudson.cli.CLI.main(CLI.java:199)</div>
<div>Check that the JNLP port is opened if you are using a firewall on your server. You can configure its value in Jenkins configuration. By default it is set to use a random port.</div>
<div></div>
<div>java.io.IOException: No X-Jenkins-CLI2-Port</div>
<div>java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, Server, X-Content-Type-Options, Connection, X-You-Are-In-Group, X-Hudson, X-Permission-Implied-By, Date, X-Jenkins-Session, X-You-Are-Authenticated-As, X-Required-Permission, Set-Cookie, Expires, Content-Length, Content-Type]</div>
<div>at hudson.cli.CLI.getCliTcpPort(CLI.java:284)</div>
<div>at hudson.cli.CLI.&lt;init&gt;(CLI.java:128)</div>
<div>at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)</div>
<div>at hudson.cli.CLI._main(CLI.java:473)</div>
<div>at hudson.cli.CLI.main(CLI.java:384)</div>
<div>Suppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: <a href="http://citest.gce.px/cli" target="_blank" rel="noopener">http://citest.gce.px/cli</a></div>
<div>at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)</div>
<div>at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)</div>
<div>at hudson.cli.FullDuplexHttpStream.&lt;init&gt;(FullDuplexHttpStream.java:78)</div>
<div>at hudson.cli.CLI.connectViaHttp(CLI.java:152)</div>
<div>at hudson.cli.CLI.&lt;init&gt;(CLI.java:132)</div>
<div>&#8230; 3 more</div>
<div>Solution: Go to Manage Jenkins -&gt; Configure Global Security -&gt; &#8220;TCP port for JNLP agents&#8221;: choose fixed or random</div>
<div></div>
<div><strong>Reference</strong></div>
<div><a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI" target="_blank" rel="noopener">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI</a></div>
<div><a href="http://lifuzu.com/blog/2014/04/24/playing-with-jenkins-create-job/" target="_blank" rel="noopener">http://lifuzu.com/blog/2014/04/24/playing-with-jenkins-create-job/</a></div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/complete-guide-to-use-jenkins-cli-command-line/">Complete guide to use Jenkins CLI / Command line | Jenkins Tutorials</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/complete-guide-to-use-jenkins-cli-command-line/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Docker Command line Reference &#124; Docker Tutorial &#124; Docker Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/docker-commands-line-reference/</link>
					<comments>https://www.scmgalaxy.com/tutorials/docker-commands-line-reference/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 15 Jul 2016 17:50:41 +0000</pubDate>
				<category><![CDATA[CONTAINERS]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Containers]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Docker Command line]]></category>
		<category><![CDATA[Docker Command line Reference]]></category>
		<category><![CDATA[Docker Guide]]></category>
		<category><![CDATA[Docker Tutorial]]></category>
		<category><![CDATA[Reference]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2016/07/15/docker-commands-line-reference/</guid>

					<description><![CDATA[<p>One liner to stop all of Docker containers: &#62; docker stop $(docker ps -a -q) One liner to remove all [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/docker-commands-line-reference/">Docker Command line Reference | Docker Tutorial | Docker Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3037 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2016/07/docker-commands-line-refere.png" alt="" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2016/07/docker-commands-line-refere.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2016/07/docker-commands-line-refere-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></div>
<div><strong>One liner to stop all of Docker containers:</strong></div>
<div>&gt; docker stop $(docker ps -a -q)</div>
<div></div>
<div><strong>One liner to remove all of Docker containers:</strong></div>
<div>&gt; docker rm $(docker ps -a -q)</div>
<div>OR</div>
<div>&gt; docker rm $(docker images -q)</div>
<div>OR</div>
<div>&gt; docker rmi $(docker images -q)</div>
<div></div>
<div></div>
<div><strong>In case of error message Get http:///var/run/docker.sock/v1.14/containers/json?all=1: dial unix /var/run/docker.sock: permission denied</strong></div>
<div>&gt; sudo docker rm $(sudo docker ps -a -q)</div>
<div></div>
<div></div>
<div><strong>To only stop exited containers and delete only non-tagged images.:</strong></div>
<div>&gt; docker ps &#8211;filter &#8216;status=Exited&#8217; -a | xargs docker stop</div>
<div>&gt; docker images &#8211;filter &#8220;dangling=true&#8221; -q | xargs docker rmi</div>
<div></div>
<div><strong>Remove all containers that aren&#8217;t currently running:</strong></div>
<div>&gt; docker rm $(docker ps -a -q -f &#8220;status=exited*&#8221;)</div>
<div></div>
<div><strong>if not the volumes will not be delete !!! (like if you are using a mysql docker image) and all the volumes will be orphans !</strong></div>
<div>&gt; sudo docker rm -f -v $(sudo docker ps -a -q)</div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/docker-commands-line-reference/">Docker Command line Reference | Docker Tutorial | Docker Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/docker-commands-line-reference/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Know About Jenkins CLI &#124; Jenkins CLI Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/</link>
					<comments>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Mon, 10 Feb 2014 04:16:10 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[About Jenkins CLI]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Jenkins CLI]]></category>
		<category><![CDATA[Jenkins CLI Guide]]></category>
		<category><![CDATA[Jenkins CLI Instructions]]></category>
		<category><![CDATA[Jenkins CLI Reference]]></category>
		<category><![CDATA[Jenkins CLI Tutorial]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Understand Jenkins CLI]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2014/02/10/know-about-jenkins-cli/</guid>

					<description><![CDATA[<p>Running CLI java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;] Getting help java -jar jenkins-cli.jar -s yourserver.com help [command] How [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/">Know About Jenkins CLI | Jenkins CLI Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3748 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli.png" alt="jenkins-cli" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p><strong>Running CLI</strong><br />
java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;]</p>
<p><strong>Getting help</strong><br />
java -jar jenkins-cli.jar -s yourserver.com help [command]</p>
<p><strong>How to download jenkins-cli.jar?</strong><br />
The best place to download the Jenkins CLI jar is from your own Jenkins server. This means you’ll have the matching CLI version. Visit the /cli endpoint, such as http://yourserver.com/cli, and it will give you a link to download the jar (the /jnlpJars/jenkins-cli.jar endpoint). Download that jar.</p>
<p><strong>Running commands against a secure Jenkins (basic auth or ssh keys)</strong></p>
<p>If your Jenkins is secured, and it probably is so that you control who can create jobs, run jobs, view results, then the command above may fail and ask for credentials.<br />
You have two options: provide &#8211;username &amp; &#8211;password options to every command or provide -i option and provide the path to the ssh private key that matches the public key you provided to your user account.<br />
For example:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword<br />
$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</p>
<p><strong>Passing parameters when triggering a job build</strong><br />
To pass those same parameters via the CLI? You use the -p key=value flag for each parameter you want to pass.</p>
<p>So our finished product might look like:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;Deploy XYZ App&#8217; -i ~/.ssh/id_rsa -s -v -p target_env=api.cloudfoundry.com -p branch=master</p>
<p>How to get all commands for Jenkins CLI-<br />
Run &gt; <a href="http://yourserver.com/cli">http://yourserver.com/cli</a></p>
<p><strong>java -jar <a href="http://fmsscm.corp.intuit.net/qbo-qa/jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a> -s http://fmsscm.corp.intuit.net/qbo-qa/ help</strong></p>
<h2>Available Commands</h2>
<ul type="disc">
<li><strong>build</strong>: Builds a job, and optionally waits until its completion.</li>
<li><strong>cancel-quiet-down</strong>: Cancel the effect of the &#8220;quiet-down&#8221; command.</li>
<li><strong>clear-queue</strong>: Clears the build queue</li>
<li><strong>connect-node</strong>: Reconnect to a node</li>
<li><strong>console</strong>: Retrieves console output of a build</li>
<li><strong>copy-job</strong>: Copies a job.</li>
<li><strong>create-job</strong>: Creates a new job by reading stdin as a configuration XML file.</li>
<li><strong>create-node</strong>: Creates a new node by reading stdin as a XML configuration.</li>
<li><strong>delete-builds</strong>: Deletes build record(s).</li>
<li><strong>delete-job</strong>: Deletes a job</li>
<li><strong>delete-node</strong>: Deletes a node</li>
<li><strong>disable-job</strong>: Disables a job</li>
<li><strong>disconnect-node</strong>: Disconnects from a node</li>
<li><strong>enable-job</strong>: Enables a job</li>
<li><strong>get-job</strong>: Dumps the job definition XML to stdout</li>
<li><strong>get-node</strong>: Dumps the node definition XML to stdout</li>
<li><strong>groovy</strong>: Executes the specified Groovy script.</li>
<li><strong>groovysh</strong>: Runs an interactive groovy shell.</li>
<li><strong>help</strong>: Lists all the available commands.</li>
<li><strong>install-plugin</strong>: Installs a plugin either from a file, an URL, or from update center.</li>
<li><strong>install-tool</strong>: Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build.</li>
<li><strong>keep-build</strong>: Mark the build to keep the build forever.</li>
<li><strong>list-changes</strong>: Dumps the changelog for the specified build(s).</li>
<li><strong>list-jobs</strong>: Lists all jobs in a specific view or item group.</li>
<li><strong>list-plugins</strong>: Outputs a list of installed plugins.</li>
<li><strong>login</strong>: Saves the current credential to allow future commands to run without explicit credential information.</li>
<li><strong>logout</strong>: Deletes the credential stored with the login command.</li>
<li><strong>mail</strong>: Reads stdin and sends that out as an e-mail.</li>
<li><strong>offline-node</strong>: Stop using a node for performing builds temporarily, until the next &#8220;online-node&#8221; command.</li>
<li><strong>online-node</strong>: Resume using a node for performing builds, to cancel out the earlier &#8220;offline-node&#8221; command.</li>
<li><strong>quiet-down</strong>: Quiet down Jenkins, in preparation for a restart. Don’t start any builds.</li>
<li><strong>reload-configuration</strong>: Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.</li>
<li><strong>restart</strong>: Restart Jenkins</li>
<li><strong>safe-restart</strong>: Safely restart Jenkins</li>
<li><strong>safe-shutdown</strong>: Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.</li>
<li><strong>session-id</strong>: Outputs the session ID, which changes every time Jenkins restarts</li>
<li><strong>set-build-description</strong>: Sets the description of a build.</li>
<li><strong>set-build-display-name</strong>: Sets the displayName of a build</li>
<li><strong>set-build-parameter</strong>: Update/set the build parameter of the current build in progress</li>
<li><strong>set-build-result</strong>: Sets the result of the current build. Works only if invoked from within a build.</li>
<li><strong>set-external-build-result</strong>: Set external monitor job result.</li>
<li><strong>set-next-build-number</strong>: Set build number to be used for next build.</li>
<li><strong>shutdown</strong>: Immediately shuts down Jenkins server</li>
<li><strong>update-job</strong>: Updates the job definition XML from stdin. The opposite of the get-job command</li>
<li><strong>update-node</strong>: Updates the node definition XML from stdin. The opposite of the get-node command</li>
<li><strong>version</strong>: Outputs the current version.</li>
<li><strong>wait-node-offline</strong>: Wait for a node to become offline</li>
<li><strong>wait-node-online</strong>: Wait for a node to become online</li>
<li><strong>who-am-i</strong>: Reports your credential and permissions</li>
</ul>
<p><strong>Reference –</strong><br />
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI</a><br />
<a href="http://stackoverflow.com/questions/18199355/jenkins-cli-authentication">http://stackoverflow.com/questions/18199355/jenkins-cli-authentication</a><br />
<a href="http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins">http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/">Know About Jenkins CLI | Jenkins CLI Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understand Jenkins CLI &#124; Jenkins CLI Reference</title>
		<link>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/</link>
					<comments>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Mon, 10 Feb 2014 04:16:10 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[About Jenkins CLI]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Jenkins CLI]]></category>
		<category><![CDATA[Jenkins CLI Guide]]></category>
		<category><![CDATA[Jenkins CLI Instructions]]></category>
		<category><![CDATA[Jenkins CLI Reference]]></category>
		<category><![CDATA[Jenkins CLI Tutorial]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Understand Jenkins CLI]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2014/02/10/know-about-jenkins-cli-2/</guid>

					<description><![CDATA[<p>Running CLI java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;] Getting help java -jar jenkins-cli.jar -s yourserver.com help [command] How [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/">Understand Jenkins CLI | Jenkins CLI Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3751 size-full" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1.png" alt="jenkins-cli" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p><strong>Running CLI</strong><br />
java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;]</p>
<p><strong>Getting help</strong><br />
java -jar jenkins-cli.jar -s yourserver.com help [command]</p>
<p><strong>How to download jenkins-cli.jar?</strong><br />
The best place to download the Jenkins CLI jar is from your own Jenkins server. This means you’ll have the matching CLI version. Visit the /cli endpoint, such as http://yourserver.com/cli, and it will give you a link to download the jar (the /jnlpJars/jenkins-cli.jar endpoint). Download that jar.</p>
<p><strong>Running commands against a secure Jenkins (basic auth or ssh keys)</strong></p>
<p>If your Jenkins is secured, and it probably is so that you control who can create jobs, run jobs, view results, then the command above may fail and ask for credentials.<br />
You have two options: provide &#8211;username &amp; &#8211;password options to every command or provide -i option and provide the path to the ssh private key that matches the public key you provided to your user account.<br />
For example:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword<br />
$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</p>
<p><strong>Passing parameters when triggering a job build</strong><br />
To pass those same parameters via the CLI? You use the -p key=value flag for each parameter you want to pass.</p>
<p>So our finished product might look like:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;Deploy XYZ App&#8217; -i ~/.ssh/id_rsa -s -v -p target_env=api.cloudfoundry.com -p branch=master</p>
<p>How to get all commands for Jenkins CLI-<br />
Run &gt; <a href="http://yourserver.com/cli">http://yourserver.com/cli</a></p>
<p><strong>java -jar <a href="http://fmsscm.corp.intuit.net/qbo-qa/jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a> -s http://fmsscm.corp.intuit.net/qbo-qa/ help</strong></p>
<h2>Available Commands</h2>
<ul type="disc">
<li><strong>build</strong>: Builds a job, and optionally waits until its completion.</li>
<li><strong>cancel-quiet-down</strong>: Cancel the effect of the &#8220;quiet-down&#8221; command.</li>
<li><strong>clear-queue</strong>: Clears the build queue</li>
<li><strong>connect-node</strong>: Reconnect to a node</li>
<li><strong>console</strong>: Retrieves console output of a build</li>
<li><strong>copy-job</strong>: Copies a job.</li>
<li><strong>create-job</strong>: Creates a new job by reading stdin as a configuration XML file.</li>
<li><strong>create-node</strong>: Creates a new node by reading stdin as a XML configuration.</li>
<li><strong>delete-builds</strong>: Deletes build record(s).</li>
<li><strong>delete-job</strong>: Deletes a job</li>
<li><strong>delete-node</strong>: Deletes a node</li>
<li><strong>disable-job</strong>: Disables a job</li>
<li><strong>disconnect-node</strong>: Disconnects from a node</li>
<li><strong>enable-job</strong>: Enables a job</li>
<li><strong>get-job</strong>: Dumps the job definition XML to stdout</li>
<li><strong>get-node</strong>: Dumps the node definition XML to stdout</li>
<li><strong>groovy</strong>: Executes the specified Groovy script.</li>
<li><strong>groovysh</strong>: Runs an interactive groovy shell.</li>
<li><strong>help</strong>: Lists all the available commands.</li>
<li><strong>install-plugin</strong>: Installs a plugin either from a file, an URL, or from update center.</li>
<li><strong>install-tool</strong>: Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build.</li>
<li><strong>keep-build</strong>: Mark the build to keep the build forever.</li>
<li><strong>list-changes</strong>: Dumps the changelog for the specified build(s).</li>
<li><strong>list-jobs</strong>: Lists all jobs in a specific view or item group.</li>
<li><strong>list-plugins</strong>: Outputs a list of installed plugins.</li>
<li><strong>login</strong>: Saves the current credential to allow future commands to run without explicit credential information.</li>
<li><strong>logout</strong>: Deletes the credential stored with the login command.</li>
<li><strong>mail</strong>: Reads stdin and sends that out as an e-mail.</li>
<li><strong>offline-node</strong>: Stop using a node for performing builds temporarily, until the next &#8220;online-node&#8221; command.</li>
<li><strong>online-node</strong>: Resume using a node for performing builds, to cancel out the earlier &#8220;offline-node&#8221; command.</li>
<li><strong>quiet-down</strong>: Quiet down Jenkins, in preparation for a restart. Don’t start any builds.</li>
<li><strong>reload-configuration</strong>: Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.</li>
<li><strong>restart</strong>: Restart Jenkins</li>
<li><strong>safe-restart</strong>: Safely restart Jenkins</li>
<li><strong>safe-shutdown</strong>: Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.</li>
<li><strong>session-id</strong>: Outputs the session ID, which changes every time Jenkins restarts</li>
<li><strong>set-build-description</strong>: Sets the description of a build.</li>
<li><strong>set-build-display-name</strong>: Sets the displayName of a build</li>
<li><strong>set-build-parameter</strong>: Update/set the build parameter of the current build in progress</li>
<li><strong>set-build-result</strong>: Sets the result of the current build. Works only if invoked from within a build.</li>
<li><strong>set-external-build-result</strong>: Set external monitor job result.</li>
<li><strong>set-next-build-number</strong>: Set build number to be used for next build.</li>
<li><strong>shutdown</strong>: Immediately shuts down Jenkins server</li>
<li><strong>update-job</strong>: Updates the job definition XML from stdin. The opposite of the get-job command</li>
<li><strong>update-node</strong>: Updates the node definition XML from stdin. The opposite of the get-node command</li>
<li><strong>version</strong>: Outputs the current version.</li>
<li><strong>wait-node-offline</strong>: Wait for a node to become offline</li>
<li><strong>wait-node-online</strong>: Wait for a node to become online</li>
<li><strong>who-am-i</strong>: Reports your credential and permissions</li>
</ul>
<p><strong>Reference –</strong><br />
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI</a><br />
<a href="http://stackoverflow.com/questions/18199355/jenkins-cli-authentication">http://stackoverflow.com/questions/18199355/jenkins-cli-authentication</a><br />
<a href="http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins">http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/">Understand Jenkins CLI | Jenkins CLI Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Maven CLI Options Reference &#8211; Command Line &#124; Maven Command Line Cheatsheet</title>
		<link>https://www.scmgalaxy.com/tutorials/maven-cli-options-reference-command-line/</link>
					<comments>https://www.scmgalaxy.com/tutorials/maven-cli-options-reference-command-line/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 12 Sep 2013 10:06:42 +0000</pubDate>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Command line options]]></category>
		<category><![CDATA[Maven CLI]]></category>
		<category><![CDATA[Maven CLI Options]]></category>
		<category><![CDATA[Maven CLI Options Description]]></category>
		<category><![CDATA[Maven CLI Options Guide]]></category>
		<category><![CDATA[Maven CLI Options Instructions]]></category>
		<category><![CDATA[Maven CLI Options Reference]]></category>
		<category><![CDATA[Maven CLI Options Tutorial]]></category>
		<category><![CDATA[Maven CLI Reference]]></category>
		<category><![CDATA[Maven Command Line Cheatsheet]]></category>
		<category><![CDATA[Options]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Understand Maven CLI Options]]></category>
		<category><![CDATA[Useful Maven CLI Options]]></category>
		<category><![CDATA[Useful Maven Commands]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2013/09/12/maven-cli-options-reference-command-line/</guid>

					<description><![CDATA[<p>Maven CLI Options Reference Options Description -am,--also-make If project list is specified, also build projects required by the list -amd,--also-make-dependents [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/maven-cli-options-reference-command-line/">Maven CLI Options Reference &#8211; Command Line | Maven Command Line Cheatsheet</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3739 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/09/maven-cli-options-reference.png" alt="maven-cli-options-reference" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/09/maven-cli-options-reference.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2013/09/maven-cli-options-reference-300x200.png 300w" sizes="auto, (max-width: 600px) 100vw, 600px" /></h2>
<h2>Maven CLI Options Reference<a name="Maven_CLI_Options_Reference"></a></h2>
<table class="zebra-striped" border="1">
<tbody>
<tr class="a">
<th><strong>Options</strong></th>
<th><strong>Description</strong></th>
</tr>
<tr class="b">
<td><code>-<a name="am"></a>am,--<a name="also-make"></a>also-make</code></td>
<td>If project list is specified, also build projects required by the list</td>
</tr>
<tr class="a">
<td><code>-<a name="amd"></a>amd,--<a name="also-make-dependents"></a>also-make-dependents</code></td>
<td>If project list is specified, also build projects that depend on projects on the list</td>
</tr>
<tr class="a">
<td>&#8211;<a name="B"></a>B,&#8211;<a name="batch-mode"></a>batch-mode</td>
<td>Run in non-interactive (batch) mode</td>
</tr>
<tr class="a">
<td><code>-<a name="C"></a>C,--<a name="strict-checksums"></a>strict-checksums</code></td>
<td>Fail the build if checksums don&#8217;t match</td>
</tr>
<tr class="b">
<td><code>-<a name="c"></a>c,--<a name="lax-checksums"></a>lax-checksums</code></td>
<td>Warn if checksums don&#8217;t match</td>
</tr>
<tr class="a">
<td><code>-<a name="cpu"></a>cpu,--<a name="check-plugin-updates"></a>check-plugin-updates</code></td>
<td>Ineffective, only kept for backward compatibility</td>
</tr>
<tr class="b">
<td><code>-<a name="D"></a>D,--<a name="define"></a>define &lt;arg&gt;</code></td>
<td>Define a system property</td>
</tr>
<tr class="a">
<td><code>-<a name="e"></a>e,--<a name="errors"></a>errors</code></td>
<td>Produce execution error messages</td>
</tr>
<tr class="b">
<td><code>-<a name="emp"></a>emp,--<a name="encrypt-master-password"></a>encrypt-master-password &lt;arg&gt;</code></td>
<td>Encrypt master security password</td>
</tr>
<tr class="a">
<td><code>-<a name="ep"></a>ep,--<a name="encrypt-password"></a>encrypt-password &lt;arg&gt;</code></td>
<td>Encrypt server password</td>
</tr>
<tr class="b">
<td><code>-<a name="f"></a>f,--<a name="file"></a>file &lt;arg&gt;</code></td>
<td>Force the use of an alternate POM file (or directory with pom.xml).</td>
</tr>
<tr class="a">
<td><code>-<a name="fae"></a>fae,--<a name="fail-at-end"></a>fail-at-end</code></td>
<td>Only fail the build afterwards; allow all non-impacted builds to continue</td>
</tr>
<tr class="b">
<td><code>-<a name="ff"></a>ff,--<a name="fail-fast"></a>fail-fast</code></td>
<td>Stop at first failure in reactorized builds</td>
</tr>
<tr class="a">
<td><code>-<a name="fn"></a>fn,--<a name="fail-never"></a>fail-never</code></td>
<td>NEVER fail the build, regardless of project result</td>
</tr>
<tr class="b">
<td><code>-<a name="gs"></a>gs,--<a name="global-settings"></a>global-settings &lt;arg&gt;</code></td>
<td>Alternate path for the global settings file</td>
</tr>
<tr class="a">
<td><code>-<a name="h"></a>h,--<a name="help"></a>help</code></td>
<td>Display help information</td>
</tr>
<tr class="b">
<td><code>-<a name="l"></a>l,--<a name="log-file"></a>log-file &lt;arg&gt;</code></td>
<td>Log file to where all build output will go.</td>
</tr>
<tr class="a">
<td><code>-<a name="llr"></a>llr,--<a name="legacy-local-repository"></a>legacy-local-repository</code></td>
<td>Use Maven 2 Legacy Local Repository behaviour, ie no use of _maven.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true</td>
</tr>
<tr class="b">
<td><code>-<a name="N"></a>N,--<a name="non-recursive"></a>non-recursive</code></td>
<td>Do not recurse into sub-projects</td>
</tr>
<tr class="a">
<td><code>-<a name="npr"></a>npr,--<a name="no-plugin-registry"></a>no-plugin-registry</code></td>
<td>Ineffective, only kept for backward compatibility</td>
</tr>
<tr class="b">
<td><code>-<a name="npu"></a>npu,--<a name="no-plugin-updates"></a>no-plugin-updates</code></td>
<td>Ineffective, only kept for backward compatibility</td>
</tr>
<tr class="a">
<td><code>-<a name="nsu"></a>nsu,--<a name="no-snapshot-updates"></a>no-snapshot-updates</code></td>
<td>Suppress SNAPSHOT updates</td>
</tr>
<tr class="b">
<td><code>-<a name="o"></a>o,--<a name="offline"></a>offline</code></td>
<td>Work offline</td>
</tr>
<tr class="a">
<td><code>-<a name="P"></a>P,--<a name="activate-profiles"></a>activate-profiles &lt;arg&gt;</code></td>
<td>Comma-delimited list of profiles to activate</td>
</tr>
<tr class="b">
<td><code>-<a name="pl"></a>pl,--<a name="projects"></a>projects &lt;arg&gt;</code></td>
<td>Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.</td>
</tr>
<tr class="a">
<td><code>-<a name="q"></a>q,--<a name="quiet"></a>quiet</code></td>
<td>Quiet output &#8211; only show errors</td>
</tr>
<tr class="b">
<td><code>-<a name="rf"></a>rf,--<a name="resume-from"></a>resume-from &lt;arg&gt;</code></td>
<td>Resume reactor from specified project</td>
</tr>
<tr class="a">
<td><code>-<a name="s"></a>s,--<a name="settings"></a>settings &lt;arg&gt;</code></td>
<td>Alternate path for the user settings file</td>
</tr>
<tr class="b">
<td><code>-<a name="T"></a>T,--<a name="threads"></a>threads &lt;arg&gt;</code></td>
<td>Thread count, for instance 2.0C where C is core multiplied</td>
</tr>
<tr class="a">
<td><code>-<a name="t"></a>t,--<a name="toolchains"></a>toolchains &lt;arg&gt;</code></td>
<td>Alternate path for the user toolchains file</td>
</tr>
<tr class="b">
<td><code>-<a name="U"></a>U,--<a name="update-snapshots"></a>update-snapshots</code></td>
<td>Forces a check for updated releases and snapshots on remote repositories</td>
</tr>
<tr class="a">
<td><code>-<a name="up"></a>up,--<a name="update-plugins"></a>update-plugins</code></td>
<td>Ineffective, only kept for backward compatibility</td>
</tr>
<tr class="b">
<td><code>-<a name="V"></a>V,--<a name="show-version"></a>show-version</code></td>
<td>Display version information WITHOUT stopping build</td>
</tr>
<tr class="a">
<td><code>-<a name="v"></a>v,--<a name="version"></a>version</code></td>
<td>Display version information</td>
</tr>
<tr class="b">
<td><code>-<a name="X"></a>X,--<a name="debug"></a>debug</code></td>
<td>Produce execution debug output</td>
</tr>
</tbody>
</table>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/maven-cli-options-reference-command-line/">Maven CLI Options Reference &#8211; Command Line | Maven Command Line Cheatsheet</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/maven-cli-options-reference-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
