本地 SQLite 记账 skill。用于处理中文自然语言记账、查账、分类管理、钱包账户管理、账户余额查询、周期性交易管理、最近账单查询、修改账单和删除账单请求,例如“记账 我喝奶茶用了10元”“用支付宝记一笔午饭 25 元”“显示所有账户余额”“我现在还有多少美元”“添加周期性支出 每月 1 号交房租 3000 用银行卡”“列出 2026-03-15 的账单”。支持用户预定义分类、钱包加币种账户、按日周月年统计、分类与账户占比分析、交易明细查询和账单维护。
Use this skill for local bookkeeping with a lightweight SQLite database. Interpret the user's Chinese prompt, map it to a structured record or query, and use the bundled script to persist and analyze data.
python 3.9+ only. The bundled script uses only the standard library.{baseDir} so the skill still works when installed under an OpenClaw skills/ directory.{baseDir}/scripts/bookkeeping.py.~/.money_tracker/bookkeeping.db--db or the MONEY_TRACKER_DB environment variable.LOCAL_BOOKKEEPING_DB environment variable and can fall back to the legacy ~/.local-bookkeeping/bookkeeping.db path when needed.totals_by_currency, and the top-level unified totals are left empty.{baseDir}/references/chat_reference.md only when needed.Route the user's request into one of these flows:
记账 ... or other natural-language add-entry requests支付宝:CNY, 微信:CNY, 银行卡:USD, or Wise:EUR显示所有账户余额, 列出每个钱包余额, 我现在还有多少美元, or 我的欧元钱包还有多少今天花了多少, 这周花了多少, 这个月花了多少, or 今年花了多少这周花销哪里更多, 这个月花销哪里更多, or 今年收入主要来自哪里列出 2026-03-15 的账单, 列出这周的账单, 列出我这个月的账单, or 列出 2026 年的账单展示出最新的10个账单显示最近的一笔账修改一笔账 1 金额为12元,分类为学习删除一笔账 3 or 删除最近的一笔账If the user's wording is relative, resolve it into an explicit date, week, month, or year before calling the script. In final answers, mention the exact period used, for example 2026-03-15, 2026-W11, 2026-03, or 2026.
When the user asks to record a transaction:
entry_type: default to expense; use income only when the prompt clearly indicates inflow such as salary, refund, reimbursement, bonus, or revenue.amount: parse the positive numeric amount.occurred_on: use YYYY-MM-DD; default to today if the prompt does not specify a date.account: map to a wallet account such as 支付宝:CNY, 微信:CNY, 银行卡:CNY, 银行卡:USD, 银行卡:EUR, or another wallet like Wise:USD; use 未指定账户 only when the user did not specify one.description: keep it short and concrete, such as 奶茶, 英语教材, 插线板.note: keep extra context only if useful.source_text: store the original natural-language prompt when practical.list-categories.list-accounts if the account matters and you do not already know which ones are active.--strict-category.--strict-account.未分类 without --strict-category.日常, 学习, 电器.set-categories --replace when the user wants to redefine the whole active category set.set-categories without --replace when the user wants to add more categories while preserving existing ones.list-categories before classification if you do not already know the active category set from the current conversation.显示分类, call list-categories.添加分类 ..., call set-categories without --replace.删除分类 ..., call delete-category --name <category> and treat it as deactivation, not history rewrites.支付宝:CNY微信:CNY银行卡:CNY银行卡:USD银行卡:EURWise:USD, Revolut:EUR, or PayPal:USD.list-accounts to inspect the active wallet set.account-balances when the user asks about balances by wallet or totals by currency.account-balances over a period report.set-accounts --replace when the user wants to reset the whole active wallet set.set-accounts without --replace when the user wants to re-enable or add more wallets while preserving existing ones.update-account --name <wallet:currency> ... when the user wants to rename a wallet or change its configured currency.支付宝 -> CNY or 银行卡 -> CNYWise:USDupdate-account propagates the new wallet label and currency to linked entries and recurring schedules for consistency.删除账户 ..., call delete-account --name <wallet:currency> and treat it as deactivation, not history rewrites.Use recurring transactions to store scheduled payments or income that repeat over time.
When the user asks to manage recurring transactions:
entry_type: default to expense unless the recurring item is clearly income.amountcategoryaccountdescriptionfrequency: one of weekly, monthly, or yearlyinterval: default to 1next_due_on: use YYYY-MM-DDadd-recurring ....list-recurring.list-recurring --all.list-recurring --due-by YYYY-MM-DD.update-recurring --id <id> ....update-recurring --id <id> --activate or update-recurring --id <id> --deactivate.delete-recurring --id <id> as a deactivation shortcut.Example prompts:
添加周期性支出 每月 1 号交房租 3000 用银行卡添加周期性支出 每周交健身房 100 用微信列出所有周期性账单列出本月到期的周期性账单修改周期性账单 1 下次日期为 2026-05-01删除周期性账单 2For account balance queries:
account-balances.account-balances --currency <CODE>.accounts for each wallet balancetotals_by_currency for grouped totals such as total CNY, total USD, and total EURExample prompts:
显示所有账户余额列出每个钱包余额我现在还有多少美元我的欧元钱包还有多少For day, week, month, or year totals or analysis:
YYYY-MM-DD for a dayYYYY-Www for an ISO weekYYYY-MM for a monthYYYY for a yearday-report --date YYYY-MM-DDweek-report --week YYYY-Wwwmonth-report --month YYYY-MMyear-report --year YYYYexpense_total for total spendingincome_total for total incomenet_total for net cash flowtotals_by_currency for per-currency totals when the period contains multiple currenciesexpense_by_category for where spending is concentratedtop_expense_category for the largest spending categoryexpense_by_account for which account handled the spendingtop_expense_account for the most-used spending account in the selected periodtotals_by_currency and explicitly say no FX conversion was applied.account-balances instead.Example prompts:
今天花了多少2026-03-15 花了多少这周花了多少2026-W11 花了多少这个月花了多少2026-03 花了多少今年花了多少2026 年花了多少这周花销哪里更多今年收入主要来自哪里For detail queries:
--category <name>.--account <wallet:currency> when the currency matters.list-transactions with exactly one period selector:
--date YYYY-MM-DD--week YYYY-Www--month YYYY-MM--year YYYYExample prompts:
列出 2026-03-15 的账单显示今天的账单列出这周的账单列出 2026-W11 的账单列出这个月的账单列出 2026-03 的账单列出今年的账单列出 2026 年的账单列出 2026-03-15 学习分类的账单列出 2026-03 的支付宝账单列出 2026-03 的银行卡美元账单For latest-entry queries:
latest-entry.For recent-entry queries:
10 if the user asks for latest without a number.--category <name>.--account <wallet:currency> when the currency matters.recent-transactions --limit N.For updates:
update-entry --id <id> ... for transactions.update-recurring --id <id> ... for recurring schedules.For deletion:
delete-latest-entry.delete-entry --id <id>.delete-recurring --id <id>.Use {baseDir}/references/commands.md for exact runtime command shapes.
Use {baseDir}/references/chat_reference.md only when you need extra natural-language prompt examples.
Main commands:
python "{baseDir}/scripts/bookkeeping.py" init-dbpython "{baseDir}/scripts/bookkeeping.py" list-categoriespython "{baseDir}/scripts/bookkeeping.py" list-accountspython "{baseDir}/scripts/bookkeeping.py" account-balancespython "{baseDir}/scripts/bookkeeping.py" account-balances --currency USDpython "{baseDir}/scripts/bookkeeping.py" set-categories --replace 日常 学习 电器python "{baseDir}/scripts/bookkeeping.py" set-accounts --replace 支付宝:CNY 微信:CNY 银行卡:CNY 银行卡:USD 银行卡:EURpython "{baseDir}/scripts/bookkeeping.py" update-account --name Wise:USD --new-name TravelCard --currency EURpython "{baseDir}/scripts/bookkeeping.py" set-categories 旅行python "{baseDir}/scripts/bookkeeping.py" record --amount 10 --category 日常 --account 支付宝 --description 奶茶 --date 2026-03-15 --source-text "我喝奶茶用了10元" --strict-category --strict-accountpython "{baseDir}/scripts/bookkeeping.py" record --amount 12 --category 订阅 --account 银行卡:USD --description Claude --date 2026-03-15 --strict-accountpython "{baseDir}/scripts/bookkeeping.py" add-recurring --amount 3000 --category 日常 --account 银行卡:CNY --description 房租 --frequency monthly --next-date 2026-04-01 --strict-category --strict-accountpython "{baseDir}/scripts/bookkeeping.py" list-recurring --allpython "{baseDir}/scripts/bookkeeping.py" list-recurring --due-by 2026-04-30python "{baseDir}/scripts/bookkeeping.py" day-report --date 2026-03-15python "{baseDir}/scripts/bookkeeping.py" week-report --week 2026-W11python "{baseDir}/scripts/bookkeeping.py" month-report --month 2026-03python "{baseDir}/scripts/bookkeeping.py" year-report --year 2026python "{baseDir}/scripts/bookkeeping.py" list-transactions --date 2026-03-15 --account 支付宝python "{baseDir}/scripts/bookkeeping.py" list-transactions --month 2026-03 --account 银行卡:USDpython "{baseDir}/scripts/bookkeeping.py" list-transactions --month 2026-03python "{baseDir}/scripts/bookkeeping.py" recent-transactions --limit 10 --account 微信python "{baseDir}/scripts/bookkeeping.py" latest-entrypython "{baseDir}/scripts/bookkeeping.py" update-entry --id 1 --amount 12 --category 学习 --account 微信 --description 奶茶教材 --strict-category --strict-accountpython "{baseDir}/scripts/bookkeeping.py" update-recurring --id 1 --account 银行卡:USD --next-date 2026-05-01 --strict-accountpython "{baseDir}/scripts/bookkeeping.py" update-recurring --id 1 --deactivatepython "{baseDir}/scripts/bookkeeping.py" update-recurring --id 1 --activatepython "{baseDir}/scripts/bookkeeping.py" delete-entry --id 3python "{baseDir}/scripts/bookkeeping.py" delete-latest-entrypython "{baseDir}/scripts/bookkeeping.py" delete-category --name 旅行python "{baseDir}/scripts/bookkeeping.py" delete-account --name 银行卡:USDpython "{baseDir}/scripts/bookkeeping.py" delete-recurring --id 2totals_by_currency and say plainly that no FX conversion was applied.