# README
A tool to manage privacy on github
[!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, ghpm does not turn a starred 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
[!NOTE] Also exists as github cli extension : https://github.com/Neal-C/gh-ghpm
Requirements
- Go >= 1.23 for go install and contributing
- unix-like system for user installation
Installation
with go ( golang)
go install github.com/Neal-C/ghpm/cmd/ghpm@latest
One liner install command (Linux/amd64 & Linux/x86_64) :
curl -s "https://raw.githubusercontent.com/Neal-C/ghpm/main/docs/install.sh" | bash
Manual install
For Linux/amd64 and Linux/x86_64
# requires: curl
# ~
curl -L -o ghpm https://github.com/Neal-C/ghpm/releases/latest/download/ghpm-linux-amd64
give ghpm executable permissions
# ~
chmod +x ghpm
move to /usr/local/bin/
# ~
# might require to be prefixed with sudo: sudo mv ghpm /usr/local/bin/
mv ghpm /usr/local/bin/
Uninstall :
# ~
# might require to be prefixed with sudo: sudo rm /usr/local/bin/ghpm
rm /usr/local/bin/ghpm
Usage
# prints help message
ghpm --help
# turns all your repositories private
ghpm thanos_snap
Roadmap
-
lobby github for ghpm features to included in gh CLI so that I don't have to maintain this repository for free forever
-
lobby github for a batch request endpoint, so that it can be only 1 HTTP call and not O(n) HTTP calls
-
list your private repos
-
list your public repos
-
switch every repositories to private (excluding repos with >= 1 stars)
-
switch 1 repository to private
-
switch 1 repository to public
-
shell installation script
if time and will :
- persist auth to allow multiple successive commands
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
if you're thinking "hmm... I could rewrite it in Rust", I'm waaaay ahead of you : https://github.com/Neal-C/gh-ghpm-rs
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.
Why didn't you just ... ?
-
use the official sdk :
- Because it's a codegen sdk and not human maintained. The code has been generated by Microsoft's kiota codegen framework with OpenAPI specs and the codebase is just unreadable. it also would require me to use kiota-abstractions in my code, you're free to go check out what they are but have a bucket nearby before you do that.
- also it's not stable yet and breaking changes may happen at any time (says their README)
-
use github.com/google/go-github/v66 :
- realized too late, that I could've. It was a legit option.
- I was never going to use all of their features, so that's 1 dependency avoided.
- it would have been a missed opportunity to learn device authentication, Oauth flow and the inners of github.