forkguarddocs

Install

One global install gives you the forkguard command in every folder.

On this page

#Requirements

Check you have both:

node --version
git --version

Two 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 forkguard

The -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-repo

You do need the global install for automatic protection, because your shell has to be able to find forkguard.

#Update

npm update -g forkguard

Check 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 forkguard

Open a new terminal afterwards.

#Platform notes

PlatformNotes
WindowsWorks in PowerShell, PowerShell 7 and Git Bash. forkguard setup writes the hook to each profile it finds.
macOSWorks in zsh and bash. forkguard setup writes to ~/.zshrc and ~/.bashrc.
LinuxWorks in bash and zsh, same files as macOS.

Tested in CI on Linux, Windows and macOS, on Node 18, 20 and 22.

Where to next

Edit this page on GitHub View as Markdown

Type to search. Use the arrow keys and Enter.