← 输入框|github.com|刷新
Skip to content

Releases: cli/cli

GitHub CLI 2.103.3

Choose a tag to compare

@github-actions github-actions released this 26 Oct 19:20
Immutable release. Only release title and notes can be modified.
63837fb

What's Changed

🐛 Fixes

  • fix(gh auth status): explain expired expiring tokens with --no-refresh by @babakks in #14815

Full Changelog: v2.103.2...v2.103.3

GitHub CLI 2.103.2

Choose a tag to compare

@github-actions github-actions released this 23 Oct 20:24
Immutable release. Only release title and notes can be modified.
4f2cfe9

🐛 Fixes

  • Allow server to arbitrate which GitHub App installation tokens can attach files by @martinajir in #14804
  • Defer --attach credential checks to the upload endpoint by @BagToad in #14805

New Contributors

Full Changelog: v2.103.1...v2.103.2

GitHub CLI 2.103.1

Choose a tag to compare

@github-actions github-actions released this 23 Oct 16:24
Immutable release. Only release title and notes can be modified.
64d1752

What's Changed

🐛 Fixes

  • Avoid repeating the skill installation safety warning by @tommaso-moro in #14784
  • feat(gh auth login): hint at --expiring when no preference is set by @babakks in #14798

📚 Docs & Chores

:dependabot: Dependencies

Full Changelog: v2.103.0...v2.103.1

GitHub CLI 2.103.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 15:33
Immutable release. Only release title and notes can be modified.
7948e80

Expiring, auto-refreshing OAuth tokens (preview)

gh can now sign in with expiring OAuth credentials that it refreshes automatically. When you opt in, gh stores a short-lived access token alongside a rotating refresh token and refreshes the access token whenever it is needed, so you stay signed in without having to authenticate again.

To opt in for a single sign-in, run:

gh auth login --expiring

To prefer expiring credentials for every sign-in, run:

gh config set expiring_credentials enabled

gh auth status shows whether a credential is refreshable and when the current access token expires. Both gh auth status and gh auth token automatically refresh the access token when needed. Expiring tokens are available on github.com and GHE.com; on hosts that do not issue them, gh falls back to a regular non-expiring token.

If you use HTTPS as your git protocol, we advise using git 2.46 or newer and letting gh act as your git credential helper by running gh auth setup-git. This way gh serves and refreshes the expiring credential for git, and git does not cache it past its lifetime.

Important

Expiring access tokens should not be cached. Scripts and extensions that store the output of gh auth token will eventually hold an expired token, so run gh auth token again each time a token is needed. Tokens supplied through GH_TOKEN or GITHUB_TOKEN are never refreshed.

For more information, see Authenticating with GitHub CLI.

Manage issue artifacts with gh issue artifact (private preview)

gh issue artifact brings issue artifacts to the command line. Users and organizations enrolled in the private preview can use the list, view, create, edit, download, and delete commands to manage issue artifacts.

# Create a Markdown document with an attached image
gh issue artifact create 142 signin-plan.md --attach ./signin-flow.png

# Create an HTML document
gh issue artifact create 142 menu-prototype.html

# List or view artifacts
gh issue artifact list 142
gh issue artifact view 142 2

# Update a document or restore an earlier version
gh issue artifact edit 142 2 --body-file signin-plan-v2.md
gh issue artifact edit 142 2 --restore-version 5

Artifacts can also be addressed by their GitHub URLs, and Markdown documents support image and video attachments with --attach.

Important

Issue artifacts are in private preview. These commands only work for repositories enrolled in the preview. See the Issue Artifacts private preview announcement and feedback discussion for access instructions and to share feedback.

What's Changed

✨ Features

  • Replace extension browse with Bubble Tea by @williammartin in #14578
  • gh issue artifact stack 1/12: Resolve --attach references against the body file's directory by @BagToad in #14564
  • gh issue artifact stack 2/12: Attach one set of files to several Markdown documents by @BagToad in #14565
  • gh issue artifact stack 3/12: Add the command group and list by @BagToad in #14566
  • gh issue artifact stack 4/12: Add view by @BagToad in #14567
  • gh issue artifact stack 5/12: Add delete by @BagToad in #14568
  • gh issue artifact stack 6/12: Add download by @BagToad in #14569
  • gh issue artifact stack 7/12: Add create by @BagToad in #14570
  • gh issue artifact stack 8/12: Add edit by @BagToad in #14571
  • gh issue artifact stack 10/12: Add edit --restore-version by @BagToad in #14580
  • gh issue artifact stack 11/12: Address review feedback by @BagToad in #14640
  • gh issue artifact stack 12/12: Add artifact URLs by @BagToad in #14678
  • Support HTML documents in gh issue artifact by @BagToad in #14720
  • Refreshable tokens (1/7): foundation credential model, storage migration, and file lock by @babakks in #14450
  • Refreshable tokens (2/7): refresher domain, OAuth refresher, storage, and wiring by @babakks in #14451
  • Refreshable tokens (3/7): short-lived login, refresh, and git credential path by @babakks in #14452
  • Refreshable tokens (4/7): gh auth token refresh and secure-storage handling by @babakks in #14453
  • Refreshable tokens (5/7): gh auth status short-lived token details by @babakks in #14454
  • Refreshable tokens (6/7): agent-task and CAPI per-request refresh by @babakks in #14455
  • Refreshable tokens: review fixes across the stack by @babakks in #14663
  • Refreshable tokens: rename --short-lived flag to --expiring by @babakks in #14665
  • Refreshable tokens: add prefer_expiring_credentials config option by @babakks in #14672
  • Refreshable tokens: capture auth_invocation telemetry on login and refresh by @babakks in #14673
  • Refreshable tokens: review fixes (round 2) by @babakks in #14717
  • Refreshable tokens: show relative time-to-expiry in gh auth status by @babakks in #14745
  • Refreshable tokens: build-gated debug overrides for testing token expiry by @babakks in #14752
  • Refreshable tokens: bump cli/oauth to v1.3.0 and fix gh status column width by @babakks in #14768

🐛 Fixes

📚 Docs & Chores

:dependabot: Dependencies

  • Bump Go to 1.27.2 by @github-actions[bot] in #14632
  • chore(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 by @dependabot[bot] in #14633
  • chore(deps): bump github.com/mattn/go-colorable from 0.1.15 to 0.1.16 by @dependabot[bot] in #14634
  • chore(deps): bump golang.org/x/crypto from 0.57.0 to 0.58.0 by @dependabot[bot] in #14660
  • chore(deps): bump actions/upload-artifact from 7.0.1 to 7.0.2 by @dependabot[bot] in #14656
  • chore(deps): bump actions/download-artifact from 8.0.1 to 8.0.2 by @dependabot[bot] in #14655
  • chore(deps): bump the codeql-actions group with 3 updates by @dependabot[bot] in #14654
  • chore(deps): bump charm.land/bubbletea/v2 from 2.0.10 to 2.1.0 by @dependabot[bot] in #14657
  • chore(deps): bump google.golang.org/grpc from 1.83.2 to 1.84.0 by @dependabot[bot] in #14485
  • chore(deps): bump github.com/cli/go-gh/v2 from 2.16.1 to 2.16.2 by @dependabot[bot] in #14696
  • chore(deps): bump actions/setup-node from 7.0.0 to 7.1.0 by @dependabot[bot] in #14697
  • chore(deps): bump goreleaser/goreleaser-action from 7.2.3 to 7.3.0 by @dependabot[bot] in #14707
  • chore(deps): bump github.com/klauspost/compress from 1.20.1 to 1.20.3 by @dependabot[bot] in #14705
  • chore(deps): bump actions/create-github-app-token from 3.2.0 to 3.3.0 by @dependabot[bot] in https://github.com/cli/...
Read more

GitHub CLI 2.102.1

Choose a tag to compare

@github-actions github-actions released this 20 Oct 19:35
Immutable release. Only release title and notes can be modified.

What's Changed

:dependabot: Dependencies

chore(deps): bump Go toolchain from 1.27.1 to 1.27.3 and golang.org/x/net from 0.58.0 to 0.60.0

Full Changelog: v2.102.0...v2.102.1

GitHub CLI 2.102.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 02:40
Immutable release. Only release title and notes can be modified.
fc4b137

Security

Four security vulnerabilities have been identified, and fixed, in this release. Users are advised to update gh to version v2.102.0 as soon as possible.

gh release download, gh run download, gh repo read-file --output, and gh attestation download could write remote content to an unintended local file when the destination contained symbolic links.

See GHSA-39wj-f2f4-978v for more information.

gh attestation verify compared the --source-ref value case-insensitively, so an attestation built from a branch whose name differs only in case could satisfy a policy that named a different branch.

See GHSA-4mq3-hpgx-9cx8 for more information.

Interactive gh skill search passed repository paths from search results to gh skill install without an option separator, so a search result could inject installer options and change where skill files were written.

See GHSA-qcwj-mr2r-2cx7 for more information.

gh attestation verify matched the --signer-workflow value against only the start of the signing certificate's identity, so an attestation signed by a different workflow in the pinned repository could pass verification when its path began with the pinned value.

See GHSA-wjmr-j3rp-mh2g for more information.

What's Changed

🐛 Fixes

📚 Docs & Chores

:dependabot: Dependencies

  • chore(deps): bump the codeql-actions group with 3 updates by @dependabot in #14486
  • chore(deps): bump nodeselector/setup-apple-codesign from 0.0.2 to 0.0.3 by @dependabot in #14487
  • chore(deps): bump charm.land/bubbletea/v2 from 2.0.9 to 2.0.10 by @dependabot in #14541
  • chore(deps): bump github.com/klauspost/compress from 1.20.0 to 1.20.1 by @dependabot in #14542
  • chore(deps): bump the codeql-actions group with 3 updates by @dependabot in #14543

Full Changelog: v2.101.0...v2.102.0

GitHub CLI 2.101.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 14:24
Immutable release. Only release title and notes can be modified.
0cf1092

Linux package repository signing key rotation

GitHub CLI's APT and RPM repositories, along with individual RPM packages, are now signed only with the new PGP key (fingerprint: 7F38BBB59D064DBCB3D84D725612B36462313325)

Important

Linux users who installed gh from the official APT or RPM repositories before April 8, 2026, and have not refreshed their keyring, may now see package installation or update failures. Follow the PGP signing key rotation guidance to check and update your keyring. Users on Windows or macOS, and users who installed gh through Homebrew, GitHub Releases, another package manager, or from source, are not affected.

Copy authentication codes to the clipboard by default

gh auth login and gh auth refresh now copy OAuth device codes to the clipboard by default, saving a manual copy step during authentication.

To persistently opt out, run:

gh config set clipboard disabled

Explicit clipboard options still take precedence for an individual invocation.

What's Changed

✨ Features

🐛 Fixes

📚 Docs & Chores

:dependabot: Dependencies

  • chore(deps): bump github.com/klauspost/compress from 1.19.2 to 1.20.0 by @dependabot[bot] in #14376
  • chore(deps): bump github.com/google/go-containerregistry from 0.22.0 to 0.22.1 by @dependabot[bot] in #14377
  • chore(deps): bump github.com/yuin/goldmark from 1.8.5 to 1.8.6 by @dependabot[bot] in #14378
  • chore(deps): bump golang.org/x/sync from 0.22.0 to 0.23.0 by @dependabot[bot] in #14391
  • chore(deps): bump github.com/microsoft/dev-tunnels from 0.1.27 to 0.2.0 by @dependabot[bot] in #14375
  • chore(deps): bump golang.org/x/sys from 0.47.0 to 0.48.0 by @dependabot[bot] in #14417
  • Bump Go to 1.27.1 by @github-actions[bot] in #14442
  • chore(deps): bump azure/login from 3.0.2 to 3.1.0 by @dependabot[bot] in #14447
  • chore(deps): bump the codeql-actions group with 3 updates by @dependabot[bot] in #14446
  • chore(deps): bump golang.org/x/term from 0.45.0 to 0.46.0 by @dependabot[bot] in #14445
  • chore(deps): bump golang.org/x/text from 0.41.0 to 0.42.0 by @dependabot[bot] in #14444
  • chore(deps): bump golang.org/x/crypto from 0.56.0 to 0.57.0 by @dependabot[bot] in #14443
  • Bump github.com/cli/go-gh/v2 to v2.16.1 by @niik in #14461

New Contributors

Full Changelog: v2.100.0...v2.101.0

GitHub CLI 2.100.0

Choose a tag to compare

@github-actions github-actions released this 03 Sep 15:43
Immutable release. Only release title and notes can be modified.
45437bc

Experimental: Route GitHub API traffic through a custom host

Organizations can now route a GitHub host's API traffic through a gateway using the new per-host api_host configuration:

# Route API traffic for github.com through a gateway
gh config set api_host gh-gateway.example.com --host github.com

# Read the configured API host
gh config get api_host --host github.com

The original host remains in use for authentication, Git remotes, and browser URLs.

Note

api_host is experimental and is not a security boundary. Requests may still reach the original host.

What's Changed

✨ Features

🐛 Fixes

  • fix(api): disable telemetry for unauthenticated GHES requests using absolute hostnames by @williammartin in #14337

📚 Docs & Chores

:dependabot: Dependencies

  • chore(deps): bump golang.org/x/crypto from 0.55.0 to 0.56.0 by @babakks in #14331
  • chore(deps): bump Go toolchain from 1.26.7 to 1.26.8 by @babakks in #14330
  • chore(deps): bump github.com/cli/go-gh/v2 from 2.15.0 to 2.16.0 by @williammartin in #14338

Full Changelog: v2.99.0...v2.100.0

GitHub CLI 2.99.0

Choose a tag to compare

@github-actions github-actions released this 01 Sep 20:25
Immutable release. Only release title and notes can be modified.
d528f20

Attach images and videos to issues and pull requests

The repeatable --attach flag uploads local images and videos and adds them to issue, pull request, or comment bodies. If a body already references the local path, gh replaces it with the uploaded URL; otherwise it appends the attachment:

# Attach files when creating or editing an issue
gh issue create --attach './repro.png#The error state'
gh issue edit 123 --attach ./walkthrough.mp4

# Attach files when creating or editing a pull request
gh pr create --attach ./before.png
gh pr edit 456 --attach ./after.png

# Attach files to comments
gh issue comment 123 --attach ./repro.png
gh pr comment 456 --attach ./result.mp4

Repeat the flag to attach multiple files in a single invocation. Attachments are available on GitHub.com and GitHub Enterprise Cloud.

For more information see https://gh.io/gh-attach and https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments/

Worktree support extended to gh issue develop

gh issue develop can now create a linked branch and check it out in a new Git worktree, leaving your current working copy unchanged:

# Create a linked branch for an issue and check it out in a worktree
gh issue develop 123 --checkout --worktree /path/to/wt-feature

What's Changed

✨ Features

  • Add token and repository metadata required for attachment uploads by @BagToad in #14177
  • Add validation for attachable image and video files by @BagToad in #14178
  • Rewrite local Markdown references to uploaded attachment URLs by @BagToad in #14179
  • Add attachment uploads to GitHub by @BagToad in #14180
  • Add repeatable --attach flag parsing and upload orchestration by @BagToad in #14181
  • Add --attach to gh pr comment and gh issue comment by @BagToad in #14182
  • Add --attach to gh pr create and gh pr edit by @BagToad in #14183
  • Add --attach to gh issue create and gh issue edit by @BagToad in #14184
  • Add worktree checkout to gh issue develop by @sergiou87 in #14136
  • Use text-only spinner output when gh is invoked by a coding agent by @niik in #14191
  • Honor PI_CODING_AGENT_DIR for Pi user skills by @tommaso-moro in #14260

🐛 Fixes

  • fix(repo sync): explain when the target branch is checked out in another worktree by @williammartin in #14076
  • fix(pr merge): safely handle --delete-branch with linked worktrees by @tidy-dev in #14007
  • fix(copilot): end the declined-install warning with a newline by @BagToad in #14222
  • fix(attach): clarify retry windows and attachment path resolution by @BagToad in #14262
  • fix(issue develop): reject non-empty worktree targets before creating a branch by @tidy-dev in #14244
  • fix(repo sync): prevent linked-worktree corruption by @sergiou87 in #14060
  • fix(view): reject --comments with --json by @BagToad in #14215
  • fix(attach): limit batches to 50 files by @BagToad in #14289
  • fix(skills): install Codex user skills to ~/.agents/skills by @scarletkc in #14154

📚 Docs & Chores

:dependabot: Dependencies

New Contributors

Full Changelog: v2.98.0...v2.99.0

GitHub CLI 2.98.0

Choose a tag to compare

@github-actions github-actions released this 20 Aug 22:15
Immutable release. Only release title and notes can be modified.
a255baf

Security

A security vulnerability has been identified, and fixed, that binds the local forwarded port to all available network interfaces by default.

Users of gh codespace ports forward are advised to update gh to version v2.98.0 as soon as possible.

For more information see: GHSA-vfhh-p7hm-pxfh

Support worktrees in pr checkout

Users can now checkout a pull request into a git worktree by using the new --worktree PATH flag in gh pr checkout:

gh pr checkout 12 --worktree ../wt-feature

Add semantic search to search issues

The gh search issues command now supports semantic search for issues. Users can select the search type by passing the --search-type flag:

gh search issues --search-type semantic ...

gh search issues --search-type hybrid ...

For more information about semantic search see: "Improved Search for github issues is now generally available".

What's Changed

✨ Features

🐛 Fixes

📚 Docs & Chores

:dependabot: Dependencies

  • chore(deps): bump github.com/sigstore/sigstore-go from 1.2.2 to 1.3.0 by @dependabot[bot] in #14047
  • chore(deps): bump the codeql-actions group across 1 directory with 3 updates by @dependabot[bot] in #14049
  • chore(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.0 by @dependabot[bot] in #14048
  • chore(deps): bump github.com/google/go-containerregistry from 0.21.7 to 0.21.8 by @dependabot[bot] in #14066
  • chore(deps): bump actions/attest from 4.2.1 to 4.2.2 by @dependabot[bot] in #14100
  • chore(deps): bump azure/login from 3.0.0 to 3.0.1 by @dependabot[bot] in #14101
  • chore(deps): bump the codeql-actions group across 1 directory with 3 updates by @dependabot[bot] in #14091
  • chore(deps): bump github/gh-aw-actions/setup-cli from 0.83.4 to 0.85.4 by @dependabot[bot] in #14068
  • chore(deps): bump github.com/google/go-containerregistry from 0.21.8 to 0.21.9 by @dependabot[bot] in #14119
  • chore(deps): bump github.com/klauspost/compress from 1.19.1 to 1.19.2 by @dependabot[bot] in #14120
  • chore(deps): bump the aw-actions group with 2 updates by @dependabot[bot] in #14147
  • chore: sign APT repository with both keys by @babakks in #13271
  • chore(deps): bump github.com/yuin/goldmark from 1.8.4 to 1.8.5 by @dependabot[bot] in #14029
  • chore(deps): bump actions/attest from 4.2.0 to 4.2.1 by @dependabot[bot] in #14050
  • Bump golangci-lint in CI to v2.12.2 by @williammartin in #14102
  • chore(deps): bump the aw-actions group with 2 updates by @dependabot[bot] in #14124
  • chore(deps): bump google.golang.org/protobuf from 1.36.11 to 1.36.12 by @dependabot[bot] in #14140
  • Upgrade gh-aw workflows to v0.85.4 by @tidy-dev in #14141
  • Bump Go to 1.26.6 by @github-actions[bot] in #14143
  • chore: bump go to 1.26.7 by @babakks in #14205
  • chore(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.1 by @dependabot[bot] in #14204
  • chore(deps): bump the codeql-actions group across 1 directory with 3 updates by @dependabot[bot] in #14169
  • chore(deps): bump golang.org/x/crypto from 0.54.0 to 0.55.0 by @dependabot[bot] in #14164
  • chore(deps): bump charm.land/lipgloss/v2 from 2.0.5 to 2.0.6 by @dependabot[bot] in #14166
  • Bump gh-aw-actions to v0.87.1 and recompile agentic workflows by @BagToad in #14210

New Contributors

Full Changelog: v2.97.0...v2.98.0