GHPM is a simple CLI tool written in Go that lets you install public GitHub repositories to your local machine. This repository is a prototype and learning project.
Quick summary: ghpm install owner/repo clones into ~/.ghpm/packages/repo-name and creates a JSON manifest in ~/.ghpm/manifests/.
Repository status: Prototype — minimal feature set, no sandboxing, and intended for local use only.
- Go 1.22+ (for building from source)
- Git (for cloning repositories)
On Linux, you also need a writable install location (either /usr/local/bin or ~/.local/bin).
An install script is included: install.sh.
How it works:
- Builds the
ghpmbinary withgo build. - Installs to
/usr/local/binif writable, otherwise to$HOME/.local/bin. - If
$HOME/.local/binis used the script will attempt to add that directory to a sensible shell profile (for example~/.zshrc,~/.bashrcor~/.profile) so the command is available in new shells. - The script avoids
sudoso it won't prompt for credentials; usesudomanually if you prefer installing to/usr/local/bin.
Run the installer from the project root:
./install.shIf the script updated a profile file, open a new terminal or source the file, for example:
source ~/.zshrcgo build -o ghpm
sudo mv ghpm /usr/local/bin/Use the included Windows setup scripts (setup.bat or install.ps1) as documented in the original project files.
- Install any public GitHub repository by owner/repo.
- If you provide only a repository name (for example
btop),ghpmwill perform a GitHub search and prompt you to pick one of the matching repositories. - Installs go into
~/.ghpm/packages/. - Manifest JSON files are written to
~/.ghpm/manifests/and include fields:name,repo,url,installed_at, and optionalcommitandversion. - The tool creates
~/.ghpm,~/.ghpm/packages, and~/.ghpm/manifestsautomatically. - the tool has integrated auto build and language detect that supports c/c++ ruby rust go python etc...
Install a repository (owner specified):
ghpm install owner/repoExample:
ghpm install golang/goInstall by name (search):
If you don't know the owner you can provide only the repository name and ghpm will search GitHub and prompt you to choose:
ghpm install btopYou can automate selection in scripts by piping a number into the command:
printf '1\n' | ghpm install btopList installed packages:
ghpm listRemove a package:
ghpm remove repo-nameExample workflow:
ghpm install aristocratos/btop
ghpm list
ghpm remove btop- If
ghpmis not found after runninginstall.sh, make sure the installer added$HOME/.local/binto a shell profile and that profile has been sourced (or open a new terminal). - To add
$HOME/.local/binto your current session manually:
export PATH="$HOME/.local/bin:$PATH"- If
ghpm install <name>printsInvalid repo format. Use owner/repo, use the search form instead (just the repo name) — recent versions will automatically search if you provide a name without an owner.
Build locally:
go build -o ghpmRun with go run for iterative development:
go run main.go listSee LICENSE in this repository.