mislav
released this
Please see our installation instructions for help with installation or upgrading.
Features
-
Add
gh releasecommands for managing GitHub Releases #1552 -
Add
gh pr checkscommand #1563 -
Add
gh gist list/view/editcommands #1699 -
Improve resolving the base repository for all commands #1706
Additionally,
gh pr createnow prompts for where to push the current branch, including an option to create a fork, instead of trying to guess the head repository or automatically fork in the background.Add
gh pr create --head <branch>flag to explicitly set the head branch for automation and opt out of any forking/pushing functionality. -
Add
gh config set prompt disabledconfig setting #1639 -
Add
gh help environmenthelp topic listing all supported environment variables #1696 -
Add support for PAGER environment variable to enable a terminal pager program such as
less, also supported through thepagerconfig option #1630 -
Add
gh auth login --webflag #1642
Bugs
-
pr merge --squash: add pull request title to the commit subject #1627 -
pr create: prepend body defaults to the selected template #1611 -
repo view: do not HTML-escape output #1657 -
issue list: fix misalignment due to Unicode and emoji characters #1677 -
Fix terminal color display under various color schemes #1631
-
Fix zsh completion script #1707
-
Fix opening the web browser under WSL #1708
Thanks
Thank you to all our open source contributors and everyone who has provided valuable feedback during the beta period! For specific shout-outs, as well as some examples of what's possible using GitHub CLI, check out our announcement post.
Assets
16
Features
-
New
gh authcommands for authentication: -
Add support for GitHub Enterprise Server #1517
- To get started, use
gh auth login - To clone a GHE repo:
gh repo clone example.com/owner/repo - Use
GH_HOSTenvironment variable to choose a default hostname for all commands
- To get started, use
-
Implement OAuth Device Authorization flow for github.com #1522
This enables authenticating to github.com when
ghis used on a machine that does not have a graphical web browser. The new flow enables opening a browser on a different machine to complete the authentication process. -
Publish repositories for Debian and RPM packages #1615
-
Add ability to create repositories from a repository template #1590
gh repo create <reponame> --template <owner>/<templaterepo> -
Enable using PAGER for
gh pr diffoutput #1534 -
Add
gh pr checkout --recurse-submodulesflag #1479 -
Add
gh pr close --delete-branchflag #1476 -
Allow omitting one's own username in
gh repo view <reponame>#1567 -
gh issue/pr viewnow include number and URL in machine-readable output #1580 -
Add
:branchplaceholder ingh api#1515 -
Support GraphQL
operationNamefield ingh api#1448
Bugs
-
Fix “TLS handshake timeout” on macOS #514
-
Fix
gh issues list --milestonefilter #1462 -
Fix color output on standard error on Windows #1579
-
Disallow
gh pr <command> --repo <repo>flag for commands that operate on the current branch #1585 -
Be transparent about which part of
gh pr createflow failed #1603 -
Fix detecting display width of common punctuation characters #1616
-
Filter bots out of
gh repo creditsoutput #1623
Assets
16
Features
- Enable custom color themes with the
GLAMOUR_STYLEenvironment variable #1411
Bugs
-
Fix printing network error in case for failed HTTP requests #1382
-
Fix creating gists from stdin with argument #1383
-
Correctly report HTTP and Markdown errors in
repo view#1403 -
Automatically adapt Markdown rendering for light terminal backgrounds #1402
Build
- Enable adding to GO_LDFLAGS without having to replace them all #1379
Tweaks
Assets
16
Features
-
Add support for “shell” aliases #1191
-
Add
--milestoneand--mentionfilters togh issue list#644 -
Add
--webflag togh issue/pr list#1282 -
Add
gh api --silentflag to avoid printing HTTP response #1283 -
Print issue/PR title in confirmation messages from
gh issue close/reopenandgh pr close/reopen#1337 -
Scriptability improvements for
gh issue list/view/createcommands #1343
Bugs
-
gh pr checkoutnow prevents flag injection togit checkoutvia maliciously crafted head branch name #1365 -
gh pr checkout OWNER:BRANCHnow avoids clashes with the default branch of a repository #1365 -
gh pr mergenow gracefully handles when the merged branch is auto-deleted on the server per repository settings #1279 -
Avoid crash in
gh issue close/reopenwhen issue number is invalid #1328 -
Support
hosts.ymlexisting whileconfig.ymldoes not #1304 -
Raise more informative filesystem path error after failing to read or create the config file #1295
-
Avoid warning about missing
read:orgOAuth scope if the authenticating token hasadmin:org#1359 -
Improve support for legacy issue and pull request template names #1366
Documentation
Assets
16
gh api --paginate
The api command now offers functionality to recursively fetch next pages of results until all results have been fetched:
# list all repositories owned by the authenticating user
$ gh api --paginate -XGET user/repos -f affiliation=owner | jq -r '.[].full_name'
# the same but in GraphQL
$ gh api --paginate graphql -f query='
query($endCursor: String) {
viewer {
repositories(first: 100, after: $endCursor, affiliations: [OWNER]) {
nodes {
nameWithOwner
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
' | jq -r '.data.viewer.repositories.nodes[].nameWithOwner'(#1222)
Fixes
-
Fix
pr createnot respecting template when editor was skipped #1243 -
Fix
pr checkout OWNER:BRANCHinvocation setting up upstream configuration in case maintainers are allowed to modify the pull request branch #1252 -
Fix
pr statusnot working in detached HEAD state #1155 -
Do not output ANSI colour escape sequences from
issue/pr/repo viewif standard output is redirected elsewhere #1187 -
Improve error reporting and exit status for mistyped command names #1221
-
Improve error reporting when someone might have forgotten to quote values with spaces #1147
Tweaks
Assets
16
gh api
gh now provides direct access to both the GitHub GraphQL and REST APIs. :owner and :repo can
be used as placeholders for the owner/repo you are running gh in.
$ gh api repos/:owner/:repo/releases
$ gh api graphql -F owner=':owner' -F name=':repo' -f query='
query($name: String!, $owner: String!) {
repository(owner: $owner, name: $name) {
releases(last: 3) {
nodes { tagName }
}
}
}
'(#1165, #909, #1093, #1115, #1148, #1114, #1150)
gh alias
If you want to type fewer characters when using gh, the new gh alias command allows you to set
up shortcuts. You can use sequential placeholders like $1 and $2 to insert arguments into alias
expansions.
For example, running gh alias set co 'pr checkout' now lets you run gh co instead of gh pr checkout.
Much like chocolate and red wine, this new feature pairs well with gh api:
$ gh alias set heart 'api -H Accept:application/vnd.github.squirrel-girl-preview+json repos/:owner/:repo/issues/$1/reactions --raw-field content=heart'
$ gh heart 123
In the above example, we've created the alias heart that takes one argument, an issue ID. It will
emoji react a heart onto the provided issue <3
Future alias support will allow shelling out to non-gh commands.
Respect GITHUB_TOKEN environment variable
You can now instruct gh to use a specific authentication token by setting the GITHUB_TOKEN environment variable. This enables using gh in non-interactive contexts such as CI jobs.
You may generate Personal Access Tokens here. It's recommended that the token has at least repo and read:org scopes.
(#976)
Split config
gh's configuration is now split into two files: config.yml and hosts.yml. Authentication
information goes in hosts.yml, so users are now free to add config.yml to their dotfiles
repositories.
This change means that gh will be migrating your config to the new format on first write; if you
want to get the new format you can either delete config.yml and re-authenticate or
run a gh config set command to trigger a write of the config.
(#1077)
Refreshed help docs
Our help docs got a spring cleaning both on the command line and in the manual. The output of gh help should be more legible and useful now.
(#1106, #1167, #1166, #998, #1059, #1126)
gist support
gh gist create is now supported. You can pass it a filename for posting or pipe something via STDIN. This actually shipped a little while ago but we didn't announce it. Now you know!
Polish
- Forward issue metadata via query parameters in
gh issue/pr create --webmode #992 gh repo clone myreponow assumes the authenticated user as default owner #861- Allow choosing "blank" template in
gh issue/pr create#950 - Validate the value of the
gh issue/pr list --limitflag #1157 - Initialize user's config file with commented-out examples #1158
Bugfixes
- Fix referring to loopback interface in OAuth flow #1014
- Fix showing "Authentication complete" notice after OAuth dance #1013
- Fix error while adding Milestone Metadata to PR during create #1124
Development
- Add docs about new triage rotation #1129
- Consistent PR lookup interface #1020
- Align color func declarations with go style #1143
- Bump project dependencies #1036
- Do not yet try and use gh from makefile bc of CI #999
- Update release doc content #1001
- Rename "master" to "trunk" in various links #1002
- Upgrade to Cobra 1.0 #916
- Update setup-go version #1140
- Use new httpmock API in repo_test.go #1122
- Redundant type slice-string #1160
- Remove duplicated words in PULL_REQUEST_TEMPLATE #1163
As always, THANK YOU! to our numerous community contributers <3
all the best,
vilmibm and the whole CLI team
Assets
16
pr diff, pr review, pr merge, pr ready
This release expands the GitHub pull request work flow with the ability to view pull request diffs,
review pull requests, and merge pull requests.
$ gh pr checkout 123
$ gh pr diff
$ gh pr review --approve -b "lgtm"
$ gh pr merge
Both gh pr review and gh pr merge feature interactive modes by default.
You can also now mark a draft pull request as ready for review with gh pr ready.
( #885, #873, #960, #962, #899, #982 )
Linux manpages
We are now packaging man pages with our linux releases #915. Thanks @mtfurlan!
Bugfixes
- Preserve CODEOWNERS reviewers in
pr create#912 - Reduce latency when resolving assignees, reviewers, labels on create via flags #908
- Fix re-authentication not correctly reloading config file #943
- Avoid crash in
pr viewwith reviewers #975
Development
- Fix and tweak for site build #958
- Fix lint errors #978
- Fix linter in CI #996
- Enable linting for pull requests #988
Documentation
- Add description default private for repo create #891
- Change source installation docs to avoid suggesting to change PATH #923
- Cosmetic about short descriptions #964
We on the CLI team hope that folks are as good as can be in these times.
best,
Assets
16
0.8.0
This release features new functionality as well as bug fixes. The new functionality largely focuses on making it easier to work with pull requests.
pull request and issue metadata
When creating pull requests and issues you can now select Add Metadata in the final prompt to assign reviewers, labels, and more. This metadata can also be added with flags instead of interactively. See gh help pr create or gh help issue create for more information.
pull request and issue state management
For example, you can now run:
gh pr close 123
gh pr reopen 123
to manage a pull request's state.
Features
Bugfixes
- Fix parsing some issue template names #879
- Fix pr status -R crash with closed PR on the default branch #880
- Fix the help docs on subcommands #889
- Show "Awaiting triage" for empty project state #836
- Fix gh updater mechanism for unauthenticated users #821
- Ask for
read:orgOAuth scope, warn for outdated tokens #786 - Hide closed/merged PRs from default branch #842
Development
- Parallelism-safe mechanism for stubbing HTTP responses #874
- Upgrade to Go 1.14 in CI #881
- Add command line syntax doc #862
- Update README #828
- Update documentation site on release #813
- Help goreleaser find the correct git tag during release #820
- totally inelegant approach to hopefully stopping flakey tests #852
- RFC: Make
RunCommandless brittle #856
...also there is a fun hidden command now. see if you can find it :3
Have a great day!
-vilmibm
Assets
16
gh config
The big theme of this release is the new gh config command that gives you control over two aspects of gh usage: defaulting to preferring SSH git remotes and setting a preferred editor. To learn more check out the manual!
New Stuff
gh config#728, #814, #810, #816- Support NO_COLOR environment variable to disable color #742
- Show issue state in
issue viewandpr view#667 - Add relevant metadata to
pr view#748 - Add relevant metadata to
issue view#745 - Accept clone directory as argument to
repo clone#721, #727
Bug Fixes
- Fix
pr createfinding the right commits afterrepo fork#731, #752 - Improve
completioncommand #761 - Avoid race conditions when interacting with the spinner #778
Documentation
- Improve
issue/pr/repo viewdocumentation #764
Dev/release stuff
- Check code with golangci-lint on push #734
- Appease linter that warns about redundant type in composite literals #779
- Avoid intermittent CI failures while setting up Go #780
Thanks to all our community contributors in this release! <3
Assets
16
- Avoid crash for auto-forking scenario in
pr create#726