phi-cli
v2.1.0
Published
npm package for pre-commit hook CLI
Readme
phi-cli: Pre-Commit PHI Checker
The phi-cli is a command-line tool designed to check for Protected Health Information (PHI) in the files staged for commit in a Git repository. It helps ensure that sensitive data is not accidentally committed to version control.
Installation
You can install phi-cli either globally or locally depending on how you'd like to use it in your project.
Install Locally
If you'd prefer to use phi-cli locally, you can install it as a dev dependency:
npm install phi-cli --save-devSetting the PHI_API_URL Environment Variable in the calling project
PHI_API_URL=https://your-phi-checker-api-url.comCustomize your pre commit hook
To automatically run phi-cli before each commit, you can set up a pre-commit hook using Husky.
First, ensure Husky is installed:
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Run phi-cli to check PHI before the commit
npx phi-cli
Example Usage
After setting up everything, you can now test the pre-commit hook by staging some changes and committing them:
git add .
git commit -m "Test PHI check"
