Spend Pulse
Proactive spending alerts via Plaid. Track credit card spending against a monthly budget with pace-based alerts.
Installation
CODEBLOCK0
Verify installation:
CODEBLOCK1
First-Time Setup
Run the interactive setup wizard:
CODEBLOCK2
This will:
- 1. Prompt for Plaid API credentials (get them at https://dashboard.plaid.com/developers/keys)
- Ask to choose Sandbox (test data) or Development (real bank) mode
- Set monthly spending budget
- Open browser for Plaid Link bank authentication
- Store credentials securely in macOS Keychain
For Sandbox testing, use these Plaid test credentials when the bank login appears:
- - Username: INLINECODE0
- Password: INLINECODE1
After setup, run initial sync:
CODEBLOCK3
Commands
spend-pulse check — Primary Command
Returns alert decision with full context. This is the main command to use.
CODEBLOCK4
Alert triggers (should_alert: true when any apply):
- - New transactions since last check
- Over pace (spending faster than expected)
- Remaining budget < $500
- End of month (last 3 days)
- First of month (new month started)
spend-pulse sync
Pull latest transactions from Plaid. Run before check for fresh data.
CODEBLOCK5
spend-pulse status [--oneline]
Full spending summary, or quick one-liner:
CODEBLOCK6
spend-pulse recent [--days N] [--count N]
Recent transactions (default: last 5 days).
spend-pulse config [key] [value]
View or modify settings:
CODEBLOCK7
spend-pulse link [--status] [--remove <id>]
Manage linked bank accounts:
CODEBLOCK8
spend-pulse chart [-o <path>]
Generate a cumulative spending chart as a PNG image showing:
- - Current month spending (solid blue line with gradient fill, ends with a dot at today)
- Last month spending (dashed gray line, full month)
- Budget target (dashed amber horizontal line)
CODEBLOCK9
Outputs the file path to stdout so you can capture it and attach to messages.
spend-pulse check --chart
Generate a chart alongside the alert check. Adds chart_path to the YAML output:
CODEBLOCK10
Recommended Workflow
CODEBLOCK11
If should_alert: true: Compose a brief, friendly spending update using the data. Attach the chart image from chart_path — it shows current vs. last month spending at a glance.
If should_alert: false: Stay quiet unless the user asks about spending.
Composing Messages
Use the oneline field as the core message, then add context. Always attach the chart image when available — it communicates pace visually better than any text can.
Under pace (positive):
"Quick spending pulse: Jan at $6.8k of $8k, $1.2k left with 1 day to go. Under pace by 12% — nice work!"
[attach chart.png]
On track:
"January update: $5.5k of $8k (69%) with 10 days left. Right on pace. Recent: $125 Amazon, $47 Whole Foods."
[attach chart.png]
Over pace (heads up):
"Heads up — January's at $7.2k of $8k with 5 days to go. About 10% over pace. The travel charges added up."
[attach chart.png]
Over budget:
"January budget: $8.5k spent, about $500 over the $8k target. Something to keep in mind for February."
[attach chart.png]
Guidelines:
- - Tone: helpful friend, not nagging accountant
- Keep text under 280 characters when possible
- Mention 1-2 notable items from
new_items if interesting - Use
reasons array for context - Always include the chart image — it's designed to be readable on a phone screen
Pace Explained
Spend Pulse paces against last month's actual cumulative spend curve when available, falling back to a linear budget ramp when no prior month data exists.
- -
expected_spend: Where you were at this point last month (or linear ramp fallback) - INLINECODE20 : Actual spending
- INLINECODE21 : Difference (negative = under, positive = over)
- INLINECODE22 :
under | on_track | INLINECODE25 - INLINECODE26 :
last_month (curve-based) or linear (ramp fallback)
This means early-month bills (rent, subscriptions) won't trigger false "over pace" alerts if you had similar bills last month.
Example: Day 15, last month you'd spent $4.2k by this point → expected ~$4.2k.
Upgrading to Real Bank Data
After testing with Sandbox, upgrade to Development mode for real transactions:
CODEBLOCK12
This clears sandbox data and connects your real bank account.
Troubleshooting
"Plaid credentials not found": Run spend-pulse setup to configure.
"Access token not found": Run spend-pulse setup to re-authenticate.
"No accounts found": Check spend-pulse link --status and add account if needed.
Stale data: Run spend-pulse sync to refresh from Plaid.
Spend Pulse
通过Plaid实现主动消费提醒。基于月度预算追踪信用卡支出,并提供节奏感知型提醒。
安装
bash
全局安装
npm install -g spend-pulse
或从源码安装
git clone https://github.com/jbornhorst1524/spend-pulse.git
cd spend-pulse
npm install && npm run build && npm link
验证安装:
bash
spend-pulse --version
首次设置
运行交互式设置向导:
bash
spend-pulse setup
此操作将:
- 1. 提示输入Plaid API凭证(获取地址:https://dashboard.plaid.com/developers/keys)
- 询问选择沙盒模式(测试数据)或开发模式(真实银行)
- 设置月度消费预算
- 打开浏览器进行Plaid Link银行认证
- 将凭证安全存储在macOS钥匙串中
沙盒测试时,银行登录界面出现后使用以下Plaid测试凭证:
- - 用户名:usergood
- 密码:passgood
设置完成后,运行初始同步:
bash
spend-pulse sync
命令
spend-pulse check — 主要命令
返回包含完整上下文的提醒决策。这是主要使用的命令。
yaml
should_alert: true
reasons:
- 3笔新交易
- 临近月底
month: 2026-01
budget: 8000
spent: 6801.29
remaining: 1198.71
dayofmonth: 30
daysinmonth: 31
days_remaining: 1
expected_spend: 7200.00
pace: under
pace_delta: -398.71
pace_percent: -6
pacesource: lastmonth
oneline: 一月:$6.8k / $8k (85%) | 剩余$1.2k | 1天 | > 进度正常
new_transactions: 3
new_items:
- merchant: Whole Foods
amount: 47.50
category: 食品杂货
- merchant: Amazon
amount: 125.00
category: 购物
提醒触发条件(满足任一条件时should_alert: true):
- - 自上次检查后有新交易
- 超出进度(消费速度快于预期)
- 剩余预算 < $500
- 月底(最后3天)
- 月初(新月份开始)
spend-pulse sync
从Plaid拉取最新交易。在运行check前执行以获取最新数据。
yaml
synced: 16
new: 3
account: Amex Gold (...1234)
totalthismonth: 6801.29
spend-pulse status [--oneline]
完整消费摘要,或快速单行摘要:
bash
spend-pulse status --oneline
一月:$6.8k / $8k (85%) | 剩余$1.2k | 1天 | > 进度正常
spend-pulse recent [--days N] [--count N]
近期交易(默认:最近5天)。
spend-pulse config [key] [value]
查看或修改设置:
bash
spend-pulse config # 显示所有设置
spend-pulse config target 8000 # 设置月度预算
spend-pulse config timezone America/Chicago
spend-pulse link [--status] [--remove ]
管理关联的银行账户:
bash
spend-pulse link --status # 显示已关联账户
spend-pulse link # 添加另一个账户
spend-pulse link --remove
spend-pulse chart [-o ]
生成累计消费图表的PNG图片,显示:
- - 本月消费(蓝色实线带渐变填充,今日位置以圆点结束)
- 上月消费(灰色虚线,整月)
- 预算目标(琥珀色虚线水平线)
bash
spend-pulse chart # 写入 ~/.spend-pulse/chart.png
spend-pulse chart -o /tmp/chart.png # 自定义输出路径
将文件路径输出到标准输出,方便捕获并附加到消息中。
spend-pulse check --chart
在提醒检查的同时生成图表。在YAML输出中添加chart_path:
yaml
should_alert: true
chart_path: /Users/you/.spend-pulse/chart.png
... 其余检查输出
推荐工作流程
bash
1. 同步最新交易
spend-pulse sync
2. 检查是否需要提醒,生成图表
spend-pulse check --chart
如果shouldalert: true:使用数据编写简短友好的消费更新。从chartpath附加图表图片——它一目了然地显示本月与上月的消费对比。
如果should_alert: false:保持安静,除非用户询问消费情况。
编写消息
使用oneline字段作为核心消息,然后添加上下文。有图表时始终附加——它比任何文字都更能直观地传达消费节奏。
低于进度(正面):
快速消费脉搏:一月$6.8k / $8k,剩余$1.2k,还有1天。低于进度12%——干得漂亮!
[附加chart.png]
进度正常:
一月更新:$5.5k / $8k (69%),剩余10天。进度正常。近期:$125亚马逊,$47 Whole Foods。
[附加chart.png]
超出进度(提醒):
提醒——一月已达$7.2k / $8k,剩余5天。超出进度约10%。旅行费用累积较多。
[附加chart.png]
超出预算:
一月预算:已消费$8.5k,超出$8k目标约$500。二月需留意。
[附加chart.png]
指南:
- - 语气:乐于助人的朋友,而非唠叨的会计
- 尽量控制在280字符以内
- 如有趣可提及new_items中的1-2个显著项目
- 使用reasons数组提供上下文
- 始终包含图表图片——专为手机屏幕阅读而设计
进度说明
Spend Pulse在可用时以上月实际累计消费曲线为基准进行进度对比,无上月数据时回退为线性预算曲线。
- - expectedspend:上月此时你的消费金额(或线性曲线回退值)
- spent:实际消费
- pacedelta:差值(负值=低于,正值=超出)
- pace:under | ontrack | over
- pacesource:last_month(基于曲线)或linear(曲线回退)
这意味着月初的账单(房租、订阅)不会触发虚假的超出进度提醒,前提是上月也有类似账单。
示例:第15天,上月此时已消费$4.2k → 预期约$4.2k。
升级到真实银行数据
沙盒测试完成后,升级到开发模式使用真实交易:
bash
spend-pulse setup --upgrade
这将清除沙盒数据并连接你的真实银行账户。
故障排除
未找到Plaid凭证:运行spend-pulse setup进行配置。
未找到访问令牌:运行spend-pulse setup重新认证。
未找到账户:检查spend-pulse link --status,必要时添加账户。
数据过时:运行spend-pulse sync从Plaid刷新数据。