Skip to content

About

Make all repositories private via the gh cli (except starred repos & forks) Github CLI extension

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

A gh-extension to manage privacy on github

Note

Not unmaintained ! It works so I'm done

Warning

Turning a starred repository into a private repository will lose all the stars
Current forks will remain public and will be detached from the repository.

Important

if it has >= 1 stars or is a fork, ghpm does not turn a repository into a private repository.
It does not turn your README repository (username/username) private because it's a special repository meant for public display

Note

I am not sponsored by github, nor affiliated, but you can change that by pinging them on social media. And ask for this functionality to be integrated directly into the gh CLI

Requirements

Installation

supported operating systems

  • linux-amd64
  • linux-arm64
  • darwin-arm64
  • darwin-amd64

not supported operating systems

  • freebsd-amd64
  • freebsd-arm64
  • linux-386
  • windows-386.exe
  • windows-amd64.exe
  • windows-arm64.exe
gh extension install Neal-C/gh-ghpm-rs

List your extensions

gh extension list

Upgrade

gh extension upgrade ghpm-rs

Uninstall

gh extension remove ghpm-rs

Usage

# prints help message
gh ghpm-rs --help
# turns all your repositories private (except starred repos & forks)
gh ghpm-rs thanos_snap

Only turn 1 repository private

The github cli already supports turning 1 repository private: https://cli.github.com/manual/gh_repo_edit

gh repo edit myusername/myrepository --visibility private --accept-visibility-change-consequences

Roadmap

  • switch every repositories to private (excluding repos with >= 1 stars)
  • Lobby github to provide a batch request endpoint, so that it's only 1 HTTPS request and not O(n) HTTPS requests
  • Lobby github to add this functionality to the gh CLI

Contributing

I am open to random pull requests that do at least 1 of the following :

  • cross items off the roadmap
  • fix typos
  • add tooling
  • add tests
  • add/improve documentation
  • improve CI/CD

Local setup

  1. if gh-ghpm-rs is already installed, uninstall it with
gh extension remove ghpm-rs
  1. Clone the repo
  2. Run cargo build --release
cargo build --release
  1. cp target/release/gh-ghpm-rs .
cp target/release/gh-ghpm-rs .
  1. Run gh extension install .
gh extension install .
  1. Run gh ghpm-rs --help
gh ghpm-rs --help

How to permanently delete or hide data from a repository ?

Only sure way is to contact github support : https://support.github.com/

When in doubt, revoke and rotate your keys. Or better yet, automate it.


Made with 💞 love 💞 for developers by a developer ❤️

About

Make all repositories private via the gh cli (except starred repos & forks) Github CLI extension

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages