CLI Installation
Requirements
- Node.js 18+ (for npm/npx installation)
- Or use the standalone binary — no Node.js required
Installation Methods
npm (recommended)
npm install -g purgit-cli
npx (no install)
Run a one-off scan without installing anything globally:
npx purgit scan ./document.pdf
Homebrew (macOS / Linux)
brew tap purgit-io/tap && brew install purgit
Direct Binary Download (Linux / macOS / Windows)
curl -fsSL https://install.purgit.io | sh
On Windows, download the .exe from the releases page or use PowerShell:
irm https://install.purgit.io/windows | iex
Verify Installation
purgit --version
Expected output:
purgit/1.x.x linux-x64 node-v18.x
Authentication
Most CLI commands require authentication. Log in with your Purgit account:
purgit auth login
This opens your default browser for OAuth authentication. On success, a token is stored at ~/.purgit/credentials.json.
To check your current authentication status:
purgit auth status
To log out and remove stored credentials:
purgit auth logout
Configuration
Set your default policy so you don't have to pass --policy on every command:
purgit config set policy strict
View all configuration values:
purgit config list
Configuration is stored at ~/.purgit/config.json.
Quick Test
Run your first scan to verify everything works:
purgit scan ./my-document.pdf
You should see a formatted report in your terminal with any metadata findings listed by severity.
Uninstall
npm:
npm uninstall -g purgit-cli
Homebrew:
brew uninstall purgit
Binary: Remove the binary from your PATH (typically /usr/local/bin/purgit).
Troubleshooting
command not found: purgit
Your global npm bin directory may not be in your PATH. Find it with:
npm bin -g
Then add that directory to your shell profile (~/.bashrc, ~/.zshrc, etc.):
export PATH="$(npm bin -g):$PATH"
Permission errors on macOS
If you see EACCES errors during global install:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Or configure npm to use a different directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
Windows PATH issues
After installing via npm, you may need to restart your terminal or add the npm global directory to your system PATH. The default location is:
%APPDATA%\npm
Next Steps
- CLI Reference — Full command and flag reference.
- Policies & Rules — Choose the right policy for your use case.