Install
One global install gives you the forkguard command in every folder.
#Requirements
- Node.js 18 or newer. Get it from nodejs.org.
- git. Get it from git-scm.com.
Check you have both:
node --version
git --versionTwo features need a little more. forkguard pr and forkguard --mine talk to GitHub, so they need the GitHub CLI logged in (gh auth login) or a GITHUB_TOKEN environment variable.
#Install
npm install -g forkguardThe -g means global: you can now type forkguard in any folder. Check it worked:
forkguard --version#Or try it once
Put npx in front of any command. Nothing is installed:
npx forkguard
npx forkguard someone/their-repoYou do need the global install for automatic protection, because your shell has to be able to find forkguard.
#Update
npm update -g forkguardCheck what you have with forkguard --version. The newest version is on npm, and every release is listed on the releases page.
#Remove
If you turned on automatic protection, turn it off first so the hook comes out of your shell profile:
forkguard setup --remove
npm uninstall -g forkguardOpen a new terminal afterwards.
#Platform notes
| Platform | Notes |
|---|---|
| Windows | Works in PowerShell, PowerShell 7 and Git Bash. forkguard setup writes the hook to each profile it finds. |
| macOS | Works in zsh and bash. forkguard setup writes to ~/.zshrc and ~/.bashrc. |
| Linux | Works in bash and zsh, same files as macOS. |
Tested in CI on Linux, Windows and macOS, on Node 18, 20 and 22.