Skip to content

It is too easy to accidentally private the wrong repository in gh repo edit #13435

@kisaragi-hiu

Description

@kisaragi-hiu

Describe the bug

It is too easy to accidentally set the wrong repository to private and not realize it until it's too late.

For one recent case of this, cf. Hexo accidentally being set to private because this command was run in the wrong folder.

Whereas repository deletion on both web and CLI has the enter-your-repo-name-style confirmation, and visibility edits on the web shows you your repository in big bold letters plus two extra confirmations before the final red button:

GitHub prompt for changing visibility of a repository on the web. The repository name 'kisaragi-hiu/k-kdesvn' (for illustration) is clearly shown in the center in bold letters. The 'I want to make this repository private' is very close to which repository it is talking about.

...visibility edits on CLI currently just shows big warnings with no reminder which repository the action will be performed on.

GitHub cli flow for editing visibility of a repository. There is one confirmation, two warnings about this being scary but not how scary. The repository name is finally shown after it is already done.

Affected version

gh version 2.92.0 (2026-04-28)
https://github.com/cli/cli/releases/tag/v2.92.0

Steps to reproduce the behavior

  1. gh repo edit
  2. Choose visibility and change it
  3. See the warnings - which on their own are not obvious why they may be relevant.

Expected vs actual behavior

I expect the repository name to be one of the things being highlighted in this flow, instead of being hidden until it's already too late.

Logs

~/git/kisaragi-rime-taigi main
❯ gh repo edit                                                           [2026-05-15T22:53:31+0900]
? What do you want to edit? Visibility
! Danger zone: changing repository visibility can have unexpected consequences; consult https://gh.io/setting-repository-visibility before continuing.
? Visibility private
! Changing the repository visibility to private will cause permanent loss of 0 stars and 1 watcher.
? Do you want to change visibility to private? Yes
✓ Edited repository kisaragi-hiu/kisaragi-rime-taigi

~/git/kisaragi-rime-taigi main 10s
❯                                                                        [2026-05-15T22:53:43+0900]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-reporelating to the gh repo commandpitchpitched internally for prioritisation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions