# @artale/pi-git-guard

Git safety guard for Pi coding agent. Prevents mistakes before they ship.

## Commands

```
pi git-guard check   → Git status, branch, staged files
pi git-guard scan   → Scan staged files for secrets  
pi git-guard enable → Install branch protection hooks
```

## Tools

- `git_guard_check` - Pre-flight check before commits/pushes
- `git_guard_scan` - Detect leaked secrets in staged files  
- `git_guard_enable` - One-time hook installation

## Why

- Catch leaked API keys before they reach GitHub
- Prevent force-push disasters on main
- Warn on commits that are too large
- Zero config, opinionated defaults

## Install

```bash
npm install -g @artale/pi-git-guard
```

Then in pi:
```
Use @artale/pi-git-guard
```

## Detection

Scans for:
- OpenAI API keys (`sk-...`)
- GitHub tokens (`ghp_...`)
- Stripe keys (`sk_live_...`, `sk_test_...`)
- AWS access keys (`AKIA...`)
- Slack tokens (`xox[baprs]-...`)
- SSH private keys
- Hardcoded passwords/secrets
- Email:password patterns
