Hello and welcome back to the command line. This is a doozy of a release, so strap in.
Precompiled extensions
We've made a significant change to gh's extension system. Now, extension authors can work in a precompiled language like Go and ship pre-compiled binaries of their extensions via release assets.
For a full tour of this new support, check out our demo video.
We've added scaffolding and helpers to make it a first class experience when working in Go, though of course any compiled binaries will work just fine as long as they are uploaded to a release with the expected naming scheme.
To assist with releasing precompiled extensions (Go or otherwise), we've created an action that helps automates the building and release process.
To get started, run gh extension create.
- fix binary extensions on windows by @vilmibm in #4717
- binary extension migration by @vilmibm in #4588
- make extension create binary aware by @vilmibm in #4718
- Extensions create
💅 by @mislav in #4802
go-gh
We've open sourced a small Go library called go-gh. Its goal is to make it easer for extension authors to take advantage of some gh features directly in Go code. Check out the repository to learn more or watch the precompiled extension demo.
New repo create interface
The gh repo create command now has distinct usages for creating a repository from scratch and creating one from a local git repository.
Create a new repository on GitHub from scratch and clone it locally with
$ gh repo create myrepo --public --cloneUpload an existing local repository with
$ gh repo create myrepo --source=path/to/repo --publicBreaking Changes:
gh repo createwill not behave differently inside a local git repository.gh repo createwill only prompt interactively when run with no arguments. Otherwise, all arguments should be passed explicitly.
For more information, see gh help repo create
Codespaces updates
- Fix
codespace codecommand under WSL by @mislav in #4747 - Inherit API endpoint configuration from the Codespaces environment by @marwan-at-work in #4723
- Remove the default value from idle-timeout by @reybard in #4756
- Support listing and removing user Codespaces secrets by @joshmgross in #4714
- Support setting user Codespaces secrets by @joshmgross in #4699
- Add idle_timeout_minutes as possible cs create param by @reybard in #4741
- Adds a timeout context to the ssh waiter to prevent indefinite hanging by @reybard in #4635
- Rename errors from Live Share to generic codespace by @josebalius in #4705
- Add prebuild availability status to create codespaces by @adnamalin in #4737
Other new features
- Add command
gh auth setup-gitfor setting up gh-cli as git cred helper by @despreston in #4246 - Add
gh config listby @meiji163 in #4729 - Add new flag
gh secret set --no-storeto print the encoded secret by @sguzmanm in #4423 - Adding release download for
.zipand.tar.gzarchives by @lpessoa in #4489 gh repo renameby @pxrth9 in #4450
Bugfixes
- Ignore scope suggestions for http 422 by @despreston in #4809
pr diffcolor output fixes by @mislav in #4833- PR merge should, after switching branches, pull by @pxrth9 in #4748
- Don't swallow duplicate SSH key error by @despreston in #4807
gh pr mergefails to delete remote branch if$PWDis not a git repository by @pxrth9 in #4769- Fix up bug in RemoveEntry and add tests for
config_mapby @samcoe in #4784 - Escape workflow information when generating URLs by @samcoe in #4760
- Confirm name change before creating a repo with special characters by @bchadwic in #4562
- encode
gh browseoutput URL by @bchadwic in #4663 - add base repo resolution to
gh repo archiveby @meiji163 in #4654 - add base repo resolution to
gh repo deleteby @meiji163 in #4655 - Fix stack overflow in AddJSONFlags by @rsteube in #4614
- Fix rendering issue in "formatting" help topic by @pbnj in #4661
- fix branch flag on browse within dir by @bstncartwright in #4676
Docs, developer, and performance improvements
- Generate Go 1.17-style
go:builddirectives by @mislav in #4838 - Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6 by @dependabot in #4832
- some automation by @vilmibm in #4810
- Improve
issue viewre: overfetching, PR support by @mislav in #4803 - Improve queries in
issuecommands: no overfetching, support PR arguments by @mislav in #4794 - Bump github.com/mattn/go-colorable from 0.1.11 to 0.1.12 by @dependabot in #4804
- Replace shurcool/graphql with cli/shurcool-graphql by @samcoe in #4750
- update help for magic type conversion #4365 by @signalwerk in #4434
- fix angle brackets in man pages by @meiji163 in #4752
- Overhaul manual pages for the web by @mislav in #4675
- Fix CODEOWNERS for codespaces by @mislav in #4728
- Don't use gpg in Debian instruction by @TobiX in #4610
- Bump bluemonday to silence the security alert by @mislav in #4607
New Contributors
- @pbnj made their first contribution in #4661
- @reybard made their first contribution in #4635
- @bstncartwright made their first contribution in #4676
- @TobiX made their first contribution in #4610
- @adnamalin made their first contribution in #4737
- @signalwerk made their first contribution in #4434
- @lpessoa made their first contribution in #4489
- @sguzmanm made their first contribution in #4423
Full Changelog: v2.2.0...v2.3.0
What's Changed
- Bump bluemonday to silence the security alert by @mislav in #4607
- Fix stack overflow in AddJSONFlags by @rsteube in #4614
- Fix rendering issue in "formatting" help topic by @pbnj in #4661
- Adds a timeout context to the ssh waiter to prevent indefinite hanging by @reybard in #4635
- fix branch flag on browse within dir by @bstncartwright in #4676
- gh repo rename by @pxrth9 in #4450
- codespace: Rename errors from Live Share to generic codespace by @josebalius in #4705
- Overhaul manual pages for the web by @mislav in #4675
- Fix CODEOWNERS for codespaces by @mislav in #4728
- Don't use gpg in Debian instruction by @TobiX in #4610
- Add prebuild availability status to create codespaces by @adnamalin in #4737
- fix binary extensions on windows by @vilmibm in #4717
- rewrite
gh repo createby @meiji163 in #4578 - binary extension migration by @vilmibm in #4588
- add base repo resolution to archive by @meiji163 in #4654
- add base repo resolution to
gh repo deleteby @meiji163 in #4655 - fix angle brackets in man pages by @meiji163 in #4752
- Add idle_timeout_minutes as possible cs create param by @reybard in #4741
- Support listing and removing user Codespaces secrets by @joshmgross in #4714
- Support setting user Codespaces secrets by @joshmgross in #4699
- encode
gh browseoutput url by @bchadwic in #4663 - Confirm name change before creating a repo with special characters by @bchadwic in #4562
- update help for magic type conversion #4365 by @signalwerk in #4434
- Replace shurcool/graphql with cli/shurcool-graphql by @samcoe in #4750
- Escape workflow information when generating URLs by @samcoe in #4760
- Remove the default value from idle-timeout by @reybard in #4756
- Inherit API endpoint configuration from the Codespaces environment by @marwan-at-work in #4723
- Improve queries in
issuecommands: no overfetching, support PR arguments by @mislav in #4794 - Bump github.com/mattn/go-colorable from 0.1.11 to 0.1.12 by @dependabot in #4804
- [Bug fix] gh pr merge fails to delete remote branch if $PWD is not a git repository by @pxrth9 in #4769
- Fix up bug in RemoveEntry and add tests for config_map by @samcoe in #4784
- Fix
codespace codecommand under WSL by @mislav in #4747 - Don't swallow duplicate key error by @despreston in #4807
- Improve
issue viewre: overfetching, PR support by @mislav in #4803 - some automation by @vilmibm in #4810
- [Bug Fix] PR merge should, after switching branches, pull by @pxrth9 in #4748
- Adding gh release download for .zip and .tar.gz by @lpessoa in #4489
- make extension create binary aware by @vilmibm in #4718
- Extensions create
💅 by @mislav in #4802 - Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6 by @dependabot in #4832
- pr diff color output fixes by @mislav in #4833
- Ignore scope suggestions for http 422 by @despreston in #4809
- Add
gh config listby @meiji163 in #4729 - Generate Go 1.17-style
go:builddirectives by @mislav in #4838 - feat(3796): add cmd for setting up gh-cli as git cred helper by @despreston in #4246
New Contributors
- @pbnj made their first contribution in #4661
- @reybard made their first contribution in #4635
- @bstncartwright made their first contribution in #4676
- @TobiX made their first contribution in #4610
- @adnamalin made their first contribution in #4737
- @signalwerk made their first contribution in #4434
- @lpessoa made their first contribution in #4489
- @sguzmanm made their first contribution in #4423
Full Changelog: v2.2.0...v2.3.0-pre.0
Support for GitHub Codespaces
The new gh codespace commands allow creating, listing, connecting to, and otherwise managing your codespaces.
# list your codespaces
$ gh codespace list
# create a new codespace
$ gh codespace create --repo cli/cli
# start an interactive shell within a codespace
$ gh codespace sshTo get started, check out gh help codespace. You can also use the gh cs <command> alias for short.
Thank you @josebalius, @adonovan, and code contributors: @asciimike @CamiloGarciaLaRotta @CGA1123 @edgonmsft @geramirez @georgebrock @issyl0 @joshmgross @koddsson @marwan-at-work @maxbeizer @nickfyson @Raffo @Shanduur!
What's New
- Add
repo deletecommand by @meiji163 in #4451 - Add
run cancelcommand by @cristiand391 in #3833 - Add
gpg-keymanagement commands by @owenvoke in #3822 - Support logging in to
github.localhostby @joshmgross in #4523
What's Changed
browse: respect the current working directory for file arguments by @bchadwic in #4007release create: respect the--draftflag in interactive mode by @Sixeight in #4542api: avoid repeating GET parameters when paginating by @mislav in #4559- The progress spinner is now visible against a light background #4556
- Dispatch binary extensions directly by @vilmibm in #4568
- Fix copy/paste mistake in docs by @stdtom in #4582
New Contributors
- @nickfyson made their first contribution in #4529
- @asciimike made their first contribution in #4538
- @owenvoke made their first contribution in #3822
- @Sixeight made their first contribution in #4542
- @joshmgross made their first contribution in #4523
- @stdtom made their first contribution in #4582
- @dhiemaz made their first contribution in #4586
New features
-
Add support for precompiled extensions by @vilmibm in #4308 #4373
If an extension repository publishes Releases with uploaded binary assets named with a suffix formatted like
{OS}-{ARCH}(e.g.linux-amd64), the matching binary will be downloaded and installed as the extension instead of cloning the code from the extension repository. -
pr list: add--draft,--non-draft, and--headfilters by @SiarheiFedartsou in #4316 #4279 -
browse: add--commitflag to open the permalink for the latest commit by @bchadwic in #3950
Fixes
api: add docs hint on how to use use stdin by @rethab in #4291pr checks/run: revised "pending" and "skipped" symbols by @bchadwic in #4090pr checkout: also setpushRemotefor new branches by @RasmusWL in #4363extension list: speed up checking for updates by @samcoe in #4396extension install: document installing using a full URL by @wrslatz in #4271extension create: use/usr/bin/env bashinstead of/bin/bashin generated shebang by @kidonng in #4203browse: add support for line ranges browse by @despreston in #4253browse: fix markdown files with line ranges by @andrewhsu in #4310repo garden: use thex/termpackage instead of shelling out to stty by @mislav in #4214repo sync: allow user input forgit fetchby @samcoe in #4328repo create: avoid swallowing error from a prompt by @mislav in #4331- Skip authentication requirement for internal completion commands by @cuonglm in #4189
- Add quotes around
@mein documentation to ensure examples work in PowerShell by @Jernik in #4239 - Suggest to re-authenticate to fix "SAML enforcement" error by @mislav in #4241
- Print warning when limit exceeds search API maximum by @despreston in #3967
- Add
git+httpsto the list of supported git remote URL protocols by @danburzo in #4347 - Fix detecting the current
ghexecutable in PATH by @wilso199 in #4243 - Bump Survey library to fix the "Unexpected escape sequence" error by @mislav in #4405
- Warn about missing OAuth scopes when printing HTTP 4xx errors by @mislav in #4513
New Contributors
- @cuonglm made their first contribution in #4189
- @Jernik made their first contribution in #4239
- @wrslatz made their first contribution in #4271
- @andrewhsu made their first contribution in #4299
- @SiarheiFedartsou made their first contribution in #4316
- @danburzo made their first contribution in #4347
- @rethab made their first contribution in #4291
- @RasmusWL made their first contribution in #4363
- @geramirez made their first contribution in #4439
- @lcnzg made their first contribution in #4412
- @m4ver1k made their first contribution in #4460
- @neil465 made their first contribution in #4473
- @dependabot made their first contribution in #4475
- @Shanduur made their first contribution in #4453
- @pxrth9 made their first contribution in #4410
- @adonovan made their first contribution in #4504
- @alefranz made their first contribution in #4507
- @marwan-at-work made their first contribution in #4497
What's Changed
- Improve changelog script so it includes squashed merges by @mislav in #4184
- Disable auth for cobra shell request completion hidden commands by @cuonglm in #4189
- Use
/usr/bin/env bashinstead of/bin/bashingh extension createby @kidonng in #4203 - Remove defunct link from
gh actionsby @mislav in #4213 - add quotes around @me in documentation to ensure examples work on ps by @Jernik in #4239
- feat(4248): add support for line range w/ browse by @despreston in #4253
- Use
x/termpackage for repo garden instead of shelling out to stty by @mislav in #4214 - Rename the module to "github.com/cli/cli/v2" by @mislav in #4199
- Suggest to re-authenticate to fix "SAML enforcement" error by @mislav in #4241
- Document installing extensions using full repo URL by @wrslatz in #4271
- fix link to code in project-layout doc by @andrewhsu in #4299
- show warning when limit exceeds search api max by @despreston in #3967
- Publish docs site using a deploy key instead of PAT by @mislav in #4320
- fix browse of markdown files with line ranges by @andrewhsu in #4310
- Allow user input for git fetch in repo sync by @samcoe in #4328
- Do not swallow prompt error during
repo createby @mislav in #4331 - Add
--draftand--non-draftfilters togh pr listby @SiarheiFedartsou in #4316 - Add 'git+https' to list of supported URL protocols by @danburzo in #4347
- install binary extensions by @vilmibm in #4308
- factory: gh executable from PATH by @wilso199 in #4243
- docs: add hint how to use use stdin in api command by @rethab in #4291
- Revised pending and skipped symbols for pr checks / run commands by @bchadwic in #4090
- Switch to using cli/crypto & test fixes by @josebalius in #4379
- binary extensions list & upgrade by @vilmibm in #4373
- Also set
pushRemoteongh pr checkoutfrom fork by @RasmusWL in #4363 - codespace: validate host public keys by @josebalius in #4392
- Import codespaces by @josebalius in #4384
- liveshare: move location from
internal/livesharetopkg/liveshareby @josebalius in #4393 - codespace api: move
internal/apitointernal/codespaces/apiby @josebalius in #4394 - pkg/cmd/codespace: move
cmd/ghcstopkg/cmd/codespaceby @josebalius in #4395 - Bump Survey to fix "Unexpected escape sequence" by @mislav in #4405
- Don't allow the lazyLoadedHTTPClient mutex to wrap
Do()by @mislav in #4403 - codespace list: update ListCodespaces to use new API endpoint by @josebalius in #4407
- codespace create: update startCreate to use new API endpoint by @josebalius in #4408
- codespace delete: update DeleteCodespaces to new API endpoint by @josebalius in #4409
- codespace: rename the cmd pkg to codespace by @josebalius in #4432
- codespace create: update
API.StartCodespaceto use new API endpoint by @josebalius in #4429 - codespace machine: switch
API.GetCodespacesMachinesto use new API by @josebalius in #4431 - codespace: switch
API.GetCodespaceto new API endpoint by @josebalius in #4446 - Adding pagination to list codespaces by @geramirez in #4439
- codespace: choose codespace prompt improvements by @josebalius in #4440
- Add codeowners by @josebalius in #4448
- Set io when initializing extension manager by @samcoe in #4437
- codespace create: fix regression returning nil codespace by @josebalius in #4457
- Add instructions to gh installation via spack by @lcnzg in #4412
- #2720 | Add patch flag to pull-request diff command by @m4ver1k in #4460
- Enable dependabot to get security updates and if needed version updat… by @neil465 in #4473
- Bump github.com/google/go-cmp from 0.5.5 to 0.5.6 by @dependabot in #4475
- Bump github.com/muesli/termenv from 0.8.1 to 0.9.0 by @dependabot in #4479
- Bump github.com/briandowns/spinner from 1.11.1 to 1.16.0 by @dependabot in #4477
- Bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14 by @dependabot in #4478
- Bump github.com/mattn/go-colorable from 0.1.8 to 0.1.11 by @dependabot in #4481
- Bump github.com/cpuguy83/go-md2man/v2 from 2.0.0 to 2.0.1 by @dependabot in #4483
- Bump github.com/itchyny/gojq from 0.12.4 to 0.12.5 by @dependabot in #4482
- Bump github.com/hashicorp/go-version from 1.2.1 to 1.3.0 by @dependabot in #4484
- Bump github.com/creack/pty from 1.1.13 to 1.1.16 by @dependabot in #4485
- feat(#4452): codespaces list --limit flag by @Shanduur in #4453
- gh repo archive by @pxrth9 in #4410
- Bump github.com/gabriel-vasile/mimetype from 1.1.2 to 1.4.0 by @dependabot in #4496
- CodeQL-Dependabot compatibility by @mislav in #4480
- Use concurrency to check for extension updates by @samcoe in #4396
- codespace: fix for API response body change by @josebalius in #4505
- cs create: include HTTP status code in error from /user/codespaces/*/start by @adonovan in #4504
- Update winget installation instructions by @alefranz in #4507
- codespace/liveshare keepalive: keep LS sessions alive with PF traffic by @josebalius in #4461
- Add org scoped port forwarding + fix test formatting by @marwan-at-work in #4497
- Downgrade spinner package due to cleanup bug by @mislav in #4509
New Contributors
- @cuonglm made their first contribution in #4189
- @Jernik made their first contribution in #4239
- @wrslatz made their first contribution in #4271
- @andrewhsu made their first contribution in #4299
- @SiarheiFedartsou made their first contribution in #4316
- @danburzo made their first contribution in #4347
- @rethab made their first contribution in #4291
- @RasmusWL made their first contribution in #4363
- @geramirez made their first contribution in #4439
- @lcnzg made their first contribution in #4412
- @m4ver1k made their first contribution in #4460
- @neil465 made their first contribution in #4473
- @dependabot made their first contribution in #4475
- @Shanduur made their first contribution in #4453
- @pxrth9 made their first contribution in #4410
- @adonovan made their first contribution in #4504
- @alefranz made their first contribution in #4507
- @marwan-at-work made their first contribution in #4497
Full Changelog: v2.0.0...v2.1.0-pre.0
New features
Support for command extensions
GitHub CLI extensions are additional gh commands that you can install from other repositories. For example:
$ gh extension install owner/gh-my-extension
# invoke the new command
$ gh my-extensionFor more information, see gh help extension. To see currently published extensions, browse repositories with the gh-extension topic. Note that extensions may have runtime dependencies other than gh.
Other additions
-
Display label colors in
issue listoutput #4106 -
Add
tablerow/tablerendertemplate functions for rendering data as tables #3519 -
Add
GH_FORCE_TTYto enable terminal-style output even when redirected #4146 -
Add
repo synccommand to sync a branch with its upstream state #3813 -
Add
pr checkout --branchflag to control the branch name #4005 -
Add
release create --discussion-categoryflag #4003 -
Add
config set browseroption andGH_BROWSERenvironment variable #3992 -
Add
repo list --topicfilter #4136 -
Add PowerShell instructions to
completionhelp #4114
Fixes
-
Improve accessibility of interactive select menus #4172
-
Improve detection of truecolor terminal capabilities #4106
-
Avoid wrapping issues in powershell.exe #4106
-
Detect missing git and abort early during
auth loginflow #4109 -
Fix HTTP 502 error printing from GraphQL responses #4154
Removals
-
Require Go 1.16+ #4175 - drops support for OS X El Capitan
-
Remove backwards compatibility with
homedirlibrary for config files #4145
Thanks
As always, we couldn't have done this without our amazing contributors
Features
-
Improve shell completion #4028
- Enable
--jsonflag completion with multiple comma-separated fields - Add completion for
repo create --gitignoreflag - Add completion for
repo create --licenseflag - Switch to Cobra's improved bash completion with descriptions
- Enable descriptions in PowerShell completion #4085
- Add completion of
-R/--repoflag based on available git remotes #3942
- Enable
-
Add
pr merge --adminflag to allow admins to force-merge a pull request #4071
Fixes
Features
-
issue/pr view: output label names in their own color #3912 -
Add
gh browse --no-browserto only print the URL #3943
Fixes
-
repo create: respect privacy setting when using license/gitignore templates #3972 -
repo create: respect repository description when creating from template repository #3972 -
repo create --confirm: avoid license/gitignore template prompt #3995 -
pr merge --auto: merge immediately if the PR is already mergeable #3706 -
pr merge: suggest using--autowhen merging is blocked #3706 -
Allow using cursor keys in interactive text inputs #3980
-
gh run watch --exit-status: correct exit status for completed runs #3982 -
Skip auto-migrate of config files when GH_CONFIG_DIR is set #4017
-
alias set: add note about double-quoting arguments for Command Prompt users #4013 -
Clean up
GH_CONFIG_DIRdocs #4020
Thanks
Thanks to our amazing code contributors

