Releases: cli/cli
GitHub CLI 2.23.0
What's New
repo fork
: Add--default-branch-only
flag by @jsoref in #6983repo edit
: Add visibility warning by @tuananhlai and @samcoe in #6980
What's Changed
secret set
: Fix setting Codespaces user secrets by @joshmgross in #6923secret set
: Fix setting Dependabot org secrets by @samcoe in #6941secret set
: Fix multiline values when reading from .env file by @mislav in #6932run
: Fix integer overflow error when more than 255 run attempts by @samcoe in #6935extension browse
: Improve usability and accessibility by @vilmibm in #6584issue/pr edit
: Fix adding/removing projects using flags by @samcoe in #6955codespace delete
: Default to authenticated user by @luanzeba in #6944codespace create
: Default to using current repo by @rneatherway in #6596repo set-default
: Fix interactive mode not showing all remotes by @despreston in #6969GH_DEBUG
: Fix API logging corrupting response bodies by @mislav in #6976pr create
/repo fork
: Avoid implicitly fetching when adding a new git remote by @mislav in #6990- Sanitize ANSII control characters returned from the server by @samcoe in #6916, #6956
- Disable gh update checker in our precompiled binaries by @mislav in #6977
- Disallow update checker delaying the gh process by @mislav in #6978
- Bump github.com/cli/oauth from 1.0.0 to 1.0.1 by @dependabot in #6948
- Bump microsoft/setup-msbuild from 1.1.3 to 1.3.1 by @dependabot in #6973
Full Changelog: v2.22.1...v2.23.0
GitHub CLI 2.22.1
What's Changed
- Fix
gh issue edit
andgh pr edit
for GitHub Enterprise Server by @mislav in #6921 - Add
--reviewer
flag completion by @benjlevesque in #6873 - Rename
--confirm
flag to--yes
for various destructive commands by @damiensedgwick in #6915 - Fix race conditions in invoker_test by @cmbrose in #6905
New Contributors
- @benjlevesque made their first contribution in #6873
Full Changelog: v2.22.0...v2.22.1
GitHub CLI 2.22.0
What's New
-
Add all-new Projects support to issue and PR commands by @qoega @samcoe in #6735 #6907
Commands like
gh issue create --project mytitle
now work with all-new GitHub Projects, not just with “Projects (classic)” as it was before. However, an additional OAuth scope is needed to interact with new Projects. To enable this, run:gh auth refresh -h github.com -s project
-
extension create
now makes the initial git commit by @mntlty in #6833
What's Changed
pr list/view
: fix JSON export payloads forreviewers
andmergedBy
by @mislav in #6881repo set-default
: support bare git repos by @mislav in #6880gh api
: warn against Windows absolute paths by @kevhlee in #6895repo delete
: change confirmation flag to--yes
by @damiensedgwick in #6911- Codespaces:
- Fix typo in has_uncommitted_changes for codespaces by @jkeech in #6812
- Create centralized Codespaces RPC invoker by @dmgardiner25 in #6657
- Rebuild container using gRPC client by @dmgardiner25 in #6830
- Start SSH server with gRPC client by @dmgardiner25 in #6838
- Use gRPC client to notify codespace of activity by @dmgardiner25 in #6870
- Codespaces create: Fix missing billable owner notice for individuals by @RyanJamesCaldwell in #6891
- Half close port forwarding connections to fix hangs by @cmbrose in #6888
- avoid panic when bad default given to Select by @vilmibm in #6831
search
: migrate search commands to new table printer and add headers by @samcoe in #6869- Use AuthToken function to retrieve AuthToken instead of GetOrDefault by @samcoe in #6878
- Fix flakey TestUpdateProjectV2Items by @mislav in #6909
- Bump the
oauth
library by @mislav in #6885
New Contributors
- @jkeech made their first contribution in #6812
- @qoega made their first contribution in #6735
- @RyanJamesCaldwell made their first contribution in #6891
- @azu made their first contribution in #6903
Full Changelog: v2.21.2...v2.22.0
GitHub CLI 2.21.2
What's Changed
- docs: update codespace installation instructions by @levenleven in #6781
- Bump github.com/mattn/go-isatty from 0.0.16 to 0.0.17 by @dependabot in #6794
- Bump github.com/gdamore/tcell/v2 from 2.5.3 to 2.5.4 by @dependabot in #6798
- Handle erase operation in auth git-credential command by @samcoe in #6805
- select base repo correctly when only one remote by @vilmibm in #6803
New Contributors
- @levenleven made their first contribution in #6781
Full Changelog: v2.21.1...v2.21.2
GitHub CLI 2.21.1
GitHub CLI 2.21.0
What's New
Selecting a default repository
When running a gh command for the first time in a local git repository that has multiple git remotes, gh used to interactively ask Which should be the base repository?
so that the user may choose the git remote to default to when making queries to GitHub repositories. This had several problems:
- Some users did not fully understand what they are being asked to choose;
- The term “base repository” isn't an established GitHub term, except in the context of Pull Requests;
- Once chosen, the only way to undo or change the choice made was to manually edit
.git/config
in the local repository.
The new behavior is as follows:
- gh commands in a repository with multiple remotes will now error out until a default has been chosen.
- The new
gh repo set-default
command can be used to select a default, view the selected value, or undo the selection altogether.
Thank you @bchadwic and @vilmibm! #4859 #6738
Internal git operations are now always authenticated
Previously, it could be confusing that a properly authenticated gh repo clone <repo>
command could fail with a prompt for GitHub password. The underlying reason was that gh repo clone
would shell out to git clone <url>
, and from then on the authentication was entirely up to git's own credential management. If git wasn't set up to authenticate to GitHub, this could result in a generic password prompt, which appeared as if it was coming from gh
.
The best general solution for setting up git to use credentials from GitHub CLI is to run gh auth setup-git
. However, in this release, gh ensures that all underlying git operations are authenticated by gh, even if git on its own wasn't configured with a credential helper.
The way this works is by injecting extra configuration arguments when shelling out to git:
git -c credential.helper='!gh auth git-credential' clone <url>
The gh api
command now accepts nested JSON parameters
The gh api
command is similar to the popular curl
tool, but with JSON encoding & parsing support and with built-in GitHub authentication. Sending JSON POST parameters was as easy as:
gh api <endpoint> -f 'param1=value1' -f 'param2=value2'
Now there is also a way to send nested JSON objects and arrays via a special brackets syntax when specifying field names:
gh api <endpoint> -f 'head[branch][name]=main'
gh api <endpoint> -f 'labels[]=bug' -f 'labels[]=priority-1'
Other goodies
- Add
issue lock/unlock
andpr lock/unlock
commands by @chemotaxis in #5333 release create
: add--verify-tag
flag by @luanzeba in #6632release create
: add--exclude-pre-releases
flag by @owenvoke in #6625repo create
: prompt for repository owner in interactive mode by @twelvelabs in #6578repo edit
: add--allow-update-branch
flag by @browniebroke in #6706extension upgrade
: show version change information by @despreston in #6647- Codespaces: Use
-R
for--repo
shorthand and deprecate-r
by @cmbrose in #6725 codespace create
: allow setting display name for the new codespace by @despreston in #6739alias list
: change output format to YAML by @ptforness in #6603- JSON export improvements:
- Add
author
information inpr list
JSON output by @hirasawayuki in #5049 - Add
isDraft
tosearch prs
json options, matchingpr view
by @mgabeler-lee-6rs in #6704 - Expose commit SHA in PR reviews JSON export by @mislav in #6646
- Add
What's Changed
ap
: avoid sending empty JSON body when no params for a non-GET request by @mislav in #6775release
: more resilient release creation and asset management by @mislav in #6667pr create
: exclude the current user from potential reviewers by @nsmag in #6464codespace ports
: use new domain in URLs of forwarded ports by @jshorty in #6705- Document installing GitHub CLI in Codespaces by @mislav in #6653
- docs: Update installation instructions for WinGet by @vegerot in #6716
- Update Cobra and make use of its new command grouping by @mislav in #6589
- Update go-gh to v1.0.0 by @samcoe in #6618
- Bump mislav/bump-homebrew-formula-action from 1 to 2 by @dependabot in #6634
- Upgrade to Go 1.19 by @mislav in #6723
- Use Prompter in
pr
package by @vilmibm in #6451 - Use Prompter in
release
command by @vilmibm in #6711 - Linter fixes by @samcoe in #6722
- Bump goreleaser/goreleaser-action from 3 to 4 by @dependabot in #6727
- Fix signing Windows exe on release by @mislav in #6776
New Contributors
- @luanzeba made their first contribution in #6632
- @twelvelabs made their first contribution in #6578
- @vegerot made their first contribution in #6716
- @ptforness made their first contribution in #6603
Full Changelog: v2.20.2...v2.21.0
GitHub CLI 2.20.2
What's Changed
Full Changelog: v2.20.1...v2.20.2
GitHub CLI 2.20.1
What's Changed
- Update security policy by @maclarel in #6587
- Fix releasing ARM64 binaries for windows by @samcoe in #6605
- Fix listing repositories for a named GitHub user by @mislav in #6608
- Fix commands not properly refreshing the terminal screen by @samcoe in #6607
New Contributors
Full Changelog: v2.20.0...v2.20.1
GitHub CLI 2.20.0
What's New
-
New
gh extension browse
command by @vilmibm in #6530List, filter, and install available gh extensions from GitHub.com using an interactive interface:
-
New
gh extension search
command by @vilmibm in #6567Search GitHub.com repositories that have the
gh-extension
topic.
What's Changed
- Internal: add instructions for adding protocol buffers by @jungaretti in #6568
Full Changelog: v2.19.0...v2.20.0
GitHub CLI 2.19.0
What's New
-
Support explicitly marking a Release as "Latest" by @mislav in #6538
Example:
gh release create v1.3.0 --latest --target=main --notes "" gh release create v1.2.1 --latest=false --target=1.2-stable --notes ""
-
New
gh issue develop
command for managing branches linked to an issue by @Bestra in #6254Example:
gh issue develop 123 --checkout #=> remotely generates a branch linked to issue #123 and checks it out locally
-
Add
gh release download --output
flag for downloading a single asset by @lpessoa in #6410Example:
gh release download --archive=tar.gz --output - | tar xz
-
run list
: addnumber
field to JSON export by @mislav in #6494 -
repo list --topic
flag now accepts multiple topics by @kratisto in #6539 -
codespace rebuild
: perform incremental rebuild by default, add--full
for full rebuild by @jungaretti in #6551 -
extension upgrade --force
overrides the pinned state of extensions by @mntlty in #6513
What's Changed
pr create -R <repo> -H <branch>
: enable use from outside of a local git repo by @mislav in #6527codespace ssh
: avoid timing out waiting for the codespace to start by @ctaylor4874 in #6544release create
: avoid duplicate release when uploading assets by @mislav in #6493extension create
: upgrade template foractions/checkout@v3
by @swfz in #6543tablerow
template helper: fix measuring available width whenGH_FORCE_TTY=100%
and output redirection are used #6524- Document the
hyperlink
template helper by @mislav in #6537 - Fix NO_COLOR setting not respected in gh upgrade notice by @dojutsu-user in #6510
gpg-key add
: explain in error message how to convert keys into ASCII-armored format for uploading by @BakaFT in #6528repo list
: fix listing when belonging to org with IP Allow list by @mislav in #6552auth
: fix setting up git credential helper for some Windows paths by @mislav in #6558- Auth error messsage in Actions now suggests using
github.token
instead ofsecrets.GITHUB_TOKEN
by @jsoref in #6535 - Dogfood the
term
package from go-gh library by @mislav in #6421 - Improve resolving SSH hostname aliases from git remotes by @mislav in cli/go-gh#84
- Normalize the
Time-Zone
headers in tests by @mislav in #6556 - Refactor the git client by @samcoe in #6525 #6474
- Add support for the internal
garage.github.com
host by @mislav in #6478 - Bump microsoft/setup-msbuild from 1.0.3 to 1.1.3 by @dependabot in #6480
New Contributors
- @Bestra made their first contribution in #6254
- @dojutsu-user made their first contribution in #6510
- @ctaylor4874 made their first contribution in #6544
- @swfz made their first contribution in #6543
- @kratisto made their first contribution in #6539
- @BakaFT made their first contribution in #6528
Full Changelog: v2.18.1...v2.19.0