GitHub CLI (Command Line Interface) is a powerful tool that allows you to interact with GitHub directly from your command line. It provides a seamless way to manage your repositories, issues, pull requests, and more without leaving your terminal. In this article, we will guide you through the process of installing the GitHub CLI extension in a custom folder.
Prerequisites
Before we begin, make sure you have the following requirements in place:
- Access to a command line interface (Terminal, Command Prompt, etc.)
- Git installed on your system
Step 1: Download GitHub CLI
To install the GitHub CLI extension, you first need to download it. Follow these steps:
- Open your preferred web browser and visit the GitHub CLI official website: https://cli.github.com/
- Scroll down to the "GitHub CLI" section and click on the download link for your operating system (Windows, macOS, or Linux)
- The download should start automatically. Once it's complete, proceed to the next step.
Step 2: Install GitHub CLI
Now that you have downloaded the GitHub CLI, let's install it on your system. Follow these instructions based on your operating system:
Windows
- Locate the downloaded
.exefile and double-click on it to run the installer. - Follow the on-screen instructions to complete the installation.
- Once the installation is finished, open the Command Prompt by pressing
Win + Rand typingcmdfollowed byEnter. - Type
gh --versionand pressEnterto verify that GitHub CLI is installed correctly. You should see the version number displayed.
macOS
- Locate the downloaded
.zipfile and double-click on it to extract the contents. - Open the Terminal application by going to
Applications > Utilities > Terminal. - Navigate to the extracted folder using the
cdcommand. For example, if the extracted folder is namedgh, you can usecd path/to/gh. - Type
./gh --versionand pressEnterto verify that GitHub CLI is installed correctly. You should see the version number displayed.
Linux
- Locate the downloaded
.tar.gzfile and extract the contents using the appropriate command. For example, you can usetar -xvf gh.tar.gz. - Open the Terminal application by pressing
Ctrl + Alt + T. - Navigate to the extracted folder using the
cdcommand. For example, if the extracted folder is namedgh, you can usecd path/to/gh. - Type
./gh --versionand pressEnterto verify that GitHub CLI is installed correctly. You should see the version number displayed.
Step 3: Install GitHub CLI Extension in a Custom Folder
By default, GitHub CLI installs its extensions in a predefined folder. However, you can choose to install the extension in a custom folder. Follow these steps:
- Decide on a custom folder where you want to install the GitHub CLI extension. For example, you can create a folder named
gh-extensionson your desktop. - Open your command line interface (Terminal, Command Prompt, etc.)
- Navigate to the custom folder using the
cdcommand. For example, if the custom folder is located on your desktop, you can usecd Desktop/gh-extensions. - Type the following command and press
Enterto install the GitHub CLI extension in the custom folder:gh extension install cli/cli - Wait for the installation to complete. Once finished, you will see a success message.
Congratulations! You have successfully installed the GitHub CLI extension in a custom folder. You can now use GitHub CLI to interact with GitHub from your command line, and the extension will be located in your chosen folder.
In this article, we walked you through the process of installing the GitHub CLI extension in a custom folder. We covered the steps to download and install GitHub CLI on Windows, macOS, and Linux. Then, we explained how to install the extension in a custom folder of your choice. Now you can take advantage of GitHub CLI's powerful features while keeping your extensions organized in a specific location.
References
| Website | Description |
|---|---|
| https://cli.github.com/ | Official website of GitHub CLI |