Install
openclaw skills install @tsag1/simple-ledgerLog expenses, check balances, track budgets, set savings goals, and monitor stock/fund/ETF investments from natural language. Plain-text CSV storage, multi-account, offline-first with optional real-time quotes via opt-in network access.
openclaw skills install @tsag1/simple-ledgerA natural-language expense tracker for everyday spending, plus investment tracking for stocks/funds/ETFs. Just say "lunch cost 50 today" — the agent parses and appends a CSV row to your ledger. No database, no cloud sync, just one CSV file.
What this skill is good at:
What this skill is NOT:
Just tell the agent something like:
今天中午吃了碗面花了25
昨天打车23.5
工资到账8000
买了件外套299,支付宝付的
The agent will:
~/.openclaw/workspace/data/ledger/default.csvDefault account is WeChat Pay if you don't specify one.
More examples:
Batch logging:
今天花了:早餐15、打车30、午饭45
Confirm-then-write: the agent shows the parsed entry before appending.
Parsed fields:
| Field | Default | Notes |
|---|---|---|
date | today | supports "today", "yesterday", "last Wednesday" |
amount | required | decimal allowed |
category | auto-inferred | from keyword list (see references) |
description | auto-extracted | brief summary |
account | 微信钱包 | WeChat Pay default |
Output format:
📊 2026年5月 餐饮支出
日期 金额 描述
2026-05-01 ¥50.00 午餐
2026-05-03 ¥128.00 火锅
...
合计 ¥238.00
Balance = initial balance + sum(income) − sum(expense)
python3 scripts/budget.py <ledger.csv> --set 餐饮 2000
python3 scripts/budget.py <ledger.csv> --progress 2026-05
python3 scripts/budget.py <ledger.csv> --alert 2026-05
python3 scripts/budget.py <ledger.csv> --template 15000 # 50/30/20 rule
python3 scripts/budget.py <ledger.csv> --list
python3 scripts/budget.py <ledger.csv> --remove 餐饮
See references/budget_guide.md for details.
python3 scripts/generate_report.py ./default.csv --month 2026-05
python3 scripts/generate_report.py ./default.csv --month 2026-05 --output report.txt
Output includes: income/expense summary, top 5 categories (ASCII bar chart), daily average, biggest single expense, vs last month delta, brief suggestions.
goal.py create "旅行基金" 10000 2026-12-31
goal.py deposit "旅行基金" 2000
goal.py progress "旅行基金"
goal.py list
goal.py delete "旅行基金" # ⚠️ requires typing "删除" to confirm
See references/goal_guide.md.
⚠️ Network: investment features (code lookup + live quotes) require akshare (pip install) and explicit --allow-network flag. All other features are offline.
Quick commands:
# Buy (auto-lookup code by name, requires Y/N confirm)
invest.py --buy "有色金属ETF南方" auto 3100 2.07 2026-01-10 --allow-network
# Buy (manual code)
invest.py --buy "沪深300ETF" 510050 100 3.50 2026-01-15
# Sell
invest.py --sell "沪深300ETF" 510050 500 4.00 2026-03-01
# Portfolio (offline, uses last-set prices)
invest.py --portfolio
# Portfolio with auto-refresh quotes (needs network opt-in)
invest.py --portfolio --auto-refresh
# Total P&L
invest.py --summary
# Single quote
invest.py --quote 601138 --allow-network
Full command reference: references/invest_api.md.
Auto-refresh mode: create ~/.openclaw/workspace/data/ledger/.env with AUTO_REFRESH=1 to make portfolio queries always fetch live prices. Delete the file to disable.
Activate this skill only when the user expresses an explicit financial intent:
Do NOT activate for:
Disambiguation rule: If the user is just chatting about a recent expense, treat it as ordinary conversation. The key signal is whether the user has an explicit intent to record, manage, or query their finances.
# 日期,类型,金额,分类,描述,账户
余额,微信钱包,1000.00
余额,支付宝,2000.00
余额,银行卡,50000.00
余额,现金,500.00
2026-05-21,支出,50,餐饮,午餐,微信钱包
2026-05-22,收入,8000,工资,5月工资,银行卡
2026-05-23,支出,299,购物,外套,支付宝
Rules:
日期,类型,金额,分类,描述,账户类型 must be 收入 or 支出金额 is always positive (direction comes from 类型)余额,账户,金额 formatDefault location: ~/.openclaw/workspace/data/ledger/default.csv
This skill performs the following operations:
| Operation | Behavior | Scope |
|---|---|---|
| 📖 Read files | Reads ledger CSV, budget JSON, investment CSV, goals JSON | Only data/ directory |
| ✏️ Write files | Appends/modifies ledger entries, budgets, investments, goals | Only data/ directory |
| 🗑️ Delete data | Deletes transactions, budgets, goals (all require user Y/N confirm) | Only data/ directory |
| 🌐 Network access | Queries stock/fund codes + real-time quotes via akshare (Sina/Eastmoney APIs) | Sends only security codes/names, no personal financial data |
| 💻 Execute scripts | Runs Python scripts in scripts/ | Only this skill's own scripts |
Data isolation: investments.csv (investments) and default.csv (daily ledger) are completely independent files.
Will NOT do:
Backup reminder: All operations modify local CSV/JSON files directly. Back up data/ regularly.
⚠️ Network summary: Investment features (security code lookup + live quotes) require network via the
aksharelibrary calling Sina Finance public APIs. All other features are fully local — your financial data is never sent to any external server.
🔒 Privacy notice: Network queries only send security codes/names to public quote APIs (Sina, Eastmoney). No personal financial data (balances, transactions, account info) is transmitted. Be aware that queries themselves reveal which securities you're interested in.
Default behavior: offline queries.
Network access uses an explicit opt-in mechanism — never enabled by default. Add --allow-network to one-off network commands, or set AUTO_REFRESH=1 in a local .env file to auto-refresh quotes on portfolio queries.
| Operation | Default | Enable network |
|---|---|---|
Portfolio (--portfolio) | offline (uses last-set prices) | add --auto-refresh |
Summary (--summary) | offline | add --auto-refresh |
Refresh quotes (--refresh) | blocked | add --allow-network |
Single quote (--quote) | blocked | add --allow-network |
| Auto-lookup code on buy | blocked | add --allow-network |
Disable auto-refresh: delete ~/.openclaw/workspace/data/ledger/.env or say "关闭自动联网刷新".
Manual price update (no network):
工业富联现在81.58
亨通光电价格91.43
Both methods (auto-refresh vs manual update) work side-by-side without conflict.
When the user first triggers this skill:
Template:
# 日期,类型,金额,分类,描述,账户
# 个人账本 - 创建于 YYYY-MM-DD
# 格式说明见 references/ledger_format.md
# 账户初始余额
余额,微信钱包,0.00
余额,支付宝,0.00
余额,银行卡,0.00
余额,现金,0.00
# === 交易记录 ===
用户: 今天中午吃了碗面花了25
Agent: 已记录 ✅
📅 2026-05-21
💰 ¥25.00
📂 餐饮
💳 微信钱包
📝 午餐
微信钱包余额:¥975.00
用户: 花了200块
Agent: 买的什么?
用户: 买了本书
Agent: 已记录 ✅ ...
When the user says they saved money toward a goal, do two things:
goal.py deposit to update goal progress⚠️ All delete operations require user Y/N confirm — never auto-delete.
This skill provides financial recording and basic analysis tools, not investment advisory services.
| Can do | Cannot do |
|---|---|
| Record and analyze your spending data | Recommend specific financial products |
| Compare your spending vs general benchmarks | Guarantee any investment return |
| Suggest savings based on your data | Predict market movements |
| Explain financial concepts (compound interest, inflation) | Provide tax planning |
| Help you build a savings plan | Do asset allocation |
Bottom line: I help you understand where your money went, not where it should go.
Load on demand:
references/ledger_format.md — CSV format detailsreferences/budget_guide.md — budget managementreferences/goal_guide.md — savings goalsreferences/invest_guide.md — investment tracking workflowreferences/invest_api.md — investment command referencereferences/user_guide.md — user FAQreferences/financial_benchmarks.md — financial health benchmarksreferences/education.md — financial concepts| Scenario | Style |
|---|---|
| Successful logging | Concise confirmation + key info: "已记录 ✅ 餐饮 ¥35 余额 ¥965" |
| Monthly report | Clear data + 1-2 sentence suggestions |
| User overspending | Gentle reminder, not criticism |
| User reaching a goal | Genuine encouragement |
| User asking investment advice | Educational content + disclaimer |
Avoid: preachy tone, number-shaming, over-cautious language, fake intimacy.
data/ regularly.akshare (pip install akshare) + network.