Now out of beta and available for everyone, GitHub CLI 1.0 brings GitHub to the terminal where developers can manage their own workflows.
GitHub users can now officially tap into a new command line interface with the release of GitHub CLI 1.0. Previously available in beta mode since February 2020, GitHub CLI lets developers work and stay within a terminal session to script and create their workflows without having to switch from one process to another.
SEE: 10 ways to prevent developer burnout (free PDF) (TechRepublic)
Using GitHub CLI 1.0, developers can perform the following tasks:
- Run an entire GitHub workflow via the terminal, from issues through releases.
- Call the GitHub API to script nearly any action and set a custom alias for any command.
- Connect to GitHub Enterprise Server (GHES) in addition to GitHub.com. You can use GitHub CLI with repositories hosted on GHES 2.20+, which GitHub said was the biggest request from beta users.
Since the release of the beta, developers used GitHub CLI to create more than 250,000 pull requests, perform more than 350,000 merges, and create more than 20,000 issues, according to GitHub. Now out of beta, CLI 1.0 is available to download for Windows, macOS, and Linux.
GitHub CLI offers a range of commands to manage your entire GitHub workflow.
To clone the repository with which you want to work, use the “gh repo clone owner/repo” command. To find the next item you need to work on, use the commands: “gh issue status” or “gh issue list–assignee [yourname].” When you’re finished adding a feature or fixing a bug, create your pull request using the “gh pr create” command.
A teammate can check your pull request using the “gh pr checkout [request number]” command, view the differences with the “gh pr diff,” command, and review the change via the “gh pr review” command.
After the pull request is approved, you can make sure your tests pass with the “gh pr checks” command. You can then merge it directly from the terminal with the “gh pr merge” command. In this case, GitHub CLI can even delete your branch locally and on GitHub.com following the merge.
Then when it’s time for your next release, use the “gh release create [tag name]” from the command line to make your creation accessible to everyone.
You can create aliases for any command in GitHub CLI with the “gh alias set” command. And you can access the GitHub API directly with the “gh api” command. As one example, you can share your aliases with a GitHub gist with the command “gh alias list | gh gist create.”
As a result of the GitHub CLI beta, GitHub said that more than 80 community contributors submitted requests, including the following: 1) Adding metadata to issue and pull request views, 2) Allowing the selection of blank templates, 3) Filtering issues by milestone, mentioned, and author, and 4) Aligning repo create to other create commands.
Based on the feedback received during the beta phase, GitHub added several features to CLI along the way, such as 1) creating and viewing repositories, 2) configuring GitHub CLI to use SSH and your preferred editor, 3) closing, reopening, and adding labels, assignees, and more to issues and pull requests, and 4) viewing the diff, review, and merge pull requests.
GitHub said that it has more features planned for upcoming versions of GitHub CLI, including support for editing issues and pull requests and the ability to add comments. To get started with GitHub CLI, consult the online manual for the full list of commands and watch the YouTube video demo posted by GitHub.
Source of Article