Splitwise CLI Skill
Manage shared expenses, balances, and settlements through the splitwise CLI.
Setup
This skill requires the splitwise CLI to be installed and available on PATH. It uses OAuth 2.0 credentials stored at ~/.config/splitwise-cli/auth.json. If auth expires, the CLI will tell you — run splitwise auth to re-authenticate (requires browser OAuth flow).
If a default group is already configured locally, you can omit --group. Otherwise, pass --group explicitly.
Quick Reference
Check balances
CODEBLOCK0
List expenses
CODEBLOCK1
Create an expense
CODEBLOCK2
Other commands
CODEBLOCK3
Output Modes
Every command supports:
- -
--json — raw JSON (for scripting or piping) - INLINECODE8 — minimal output, just IDs/amounts
- INLINECODE9 — disable color (also respects
NO_COLOR env var)
Patterns for Common Tasks
Log a recurring shared bill
Include the month in the description to avoid confusion:
CODEBLOCK4
Check before logging (avoid duplicates)
splitwise expenses list --after 2026-03-01 --limit 50 --json
Search the output for matching descriptions before creating.
Batch-log multiple expenses
Run multiple
splitwise expenses create commands in sequence. No special syntax.
Error Handling
- - "not logged in" → Run
splitwise auth (needs browser for OAuth) - "group not found" → Verify name with INLINECODE13
- "friend not found" → Verify name with INLINECODE14
- Network errors → Retry once, then report to user
Key Details
- - Group/friend names use case-insensitive partial matching
- A configured default group means
--group is optional - Amounts are USD by default (configurable via
splitwise config set default_currency) - INLINECODE17 is the default — expense split equally among all group members
- INLINECODE18 — custom per-person split (amounts must sum to total)
- The
--paid-by flag defaults to the authenticated user
Splitwise CLI 技能
通过 splitwise CLI 管理共享费用、余额和结算。
设置
此技能要求 splitwise CLI 已安装并位于 PATH 中。它使用存储在 ~/.config/splitwise-cli/auth.json 的 OAuth 2.0 凭证。如果认证过期,CLI 会提示您——运行 splitwise auth 重新认证(需要浏览器 OAuth 流程)。
如果本地已配置默认群组,可以省略 --group。否则,请显式传递 --group。
快速参考
查看余额
bash
默认群组余额
splitwise balances
指定群组
splitwise balances --group Trip
列出费用
bash
默认群组最近费用
splitwise expenses list --limit 10
按日期筛选
splitwise expenses list --after 2026-03-01 --before 2026-03-31
不同群组
splitwise expenses list --group Trip --limit 5
创建费用
bash
均摊,您已支付
splitwise expenses create Internet - March 51.30
自定义精确分摊(60/40、70/30,任意比例)
splitwise expenses create Utilities - March 2026 254.80 --split exact:MemberA:152.88,MemberB:101.92
splitwise expenses create Rent - April 9300 --split exact:MemberA:7300,MemberB:2000
其他成员已支付
splitwise expenses create Groceries 87.50 --paid-by MemberB
其他成员已支付,自定义分摊
splitwise expenses create Dinner 120.00 --paid-by MemberB --split exact:MemberA:80,MemberB:40
不同群组
splitwise expenses create Dinner 120.00 --group Trip
不同货币
splitwise expenses create Dinner on Trip 45.00 --group Trip --currency EUR
其他命令
bash
splitwise me # 当前用户信息
splitwise groups # 列出所有群组
splitwise group Household # 群组详情 + 成员余额
splitwise friends # 列出好友
splitwise settle MemberB # 记录结算
splitwise expenses delete 12345 # 按ID删除费用
输出模式
每个命令支持:
- - --json — 原始JSON(用于脚本或管道)
- --quiet — 最小输出,仅ID/金额
- --no-color — 禁用颜色(也遵循 NO_COLOR 环境变量)
常见任务模式
记录重复共享账单
在描述中包含月份以避免混淆:
bash
splitwise expenses create Internet - March 2026 51.30
记录前检查(避免重复)
bash
splitwise expenses list --after 2026-03-01 --limit 50 --json
在创建前搜索输出中的匹配描述。
批量记录多个费用
按顺序运行多个 splitwise expenses create 命令。无需特殊语法。
错误处理
- - 未登录 → 运行 splitwise auth(需要浏览器进行OAuth)
- 未找到群组 → 使用 splitwise groups 验证名称
- 未找到好友 → 使用 splitwise friends 验证名称
- 网络错误 → 重试一次,然后报告给用户
关键细节
- - 群组/好友名称使用不区分大小写的部分匹配
- 配置了默认群组意味着 --group 是可选的
- 金额默认以美元为单位(可通过 splitwise config set default_currency 配置)
- --split even 是默认值——费用在所有群组成员间均摊
- --split exact:Name:Amount,Name:Amount — 自定义每人分摊(金额总和必须等于总额)
- --paid-by 标志默认为已认证用户