Manages the finance AP pipeline mode (shadow/live) to prevent accidental email sends during testing or development. Use when: (1) Starting any finance/AP/invoice pipeline work, (2) Testing invoice processing, (3) Any work that could trigger emails to vendors, (4) Reminds user to flip back to live when done
Prevents accidental email sends from the AP (Accounts Payable) pipeline during testing/development by managing AP_PIPELINE_MODE in ~/.finance/config.env.
# Check current mode
grep "AP_PIPELINE_MODE" ~/.finance/config.env
# If not set or is 'live', set to 'shadow'
echo "AP_PIPELINE_MODE=shadow" >> ~/.finance/config.env
Or update existing:
sed -i '' 's/AP_PIPELINE_MODE=.*/AP_PIPELINE_MODE=shadow/' ~/.finance/config.env
Run pipelines, test invoice processing, etc. No emails will be sent.
ALWAYS remind the user to flip back to live when done:
sed -i '' 's/AP_PIPELINE_MODE=.*/AP_PIPELINE_MODE=live/' ~/.finance/config.env
Or manually change in ~/.finance/config.env:
AP_PIPELINE_MODE=live
| Mode | Behavior |
|---|---|
shadow | Invoice scanning works, scoring works, NO emails sent, NO payment status changes |
live | Full pipeline: score, send emails, update payment status |
dryrun | Log only, no DB writes |
After completing finance work, ALWAYS say:
🔔 REMINDER: Flip
AP_PIPELINE_MODEback tolivewhen ready to go live. Change in~/.finance/config.env:AP_PIPELINE_MODE=live
~/.finance/config.env — Contains AP_PIPELINE_MODE setting