Intelligent budget tracking and financial management library for AI agents - expense tracking, income management, budgets, savings goals, and LLM-powered insights
一个用于AI代理追踪支出、收入、预算和储蓄目标的TypeScript库,支持基于LLM的自然语言解析。无需前端 - 专为代理和机器人程序化使用而设计。
bash
npm install agent-money-tracker
typescript
import { clawhub } from agent-money-tracker;
// 初始化(在任何操作前必须执行)
await clawhub.initialize();
// 或使用自定义存储路径
await clawhub.initialize(/path/to/data);
typescript
// 添加一笔支出
await clawhub.addExpense(50, 餐饮, 购买日用品, {
date: 2026-01-31,
tags: [每周, 必需品],
merchant: 全食超市
});
// 自然语言输入
await clawhub.addFromNaturalLanguage(昨天打车花了45美元);
// 获取近期支出
const expenses = clawhub.getExpenses({ limit: 10 });
// 按类别和日期范围筛选
const foodExpenses = clawhub.getExpenses({
category: 餐饮,
startDate: 2026-01-01,
endDate: 2026-01-31
});
typescript
// 添加收入
await clawhub.addIncome(5000, 工资, 一月工资, {
date: 2026-01-15
});
// 添加自由职业收入
await clawhub.addIncome(500, 自由职业, 网站项目);
// 获取所有收入
const income = clawhub.getIncome();
typescript
// 创建月度预算
await clawhub.createBudget(食品预算, 餐饮, 500, 月度, 0.8);
// 检查预算状态
const status = clawhub.getBudgetStatus();
// 返回:[{ budgetName, spent, limit, remaining, percentageUsed, status }]
// 获取预算提醒
const alerts = clawhub.checkBudgetAlerts();
// 当超出阈值或限额时返回警告
// 获取智能预算建议
const suggestions = clawhub.suggestBudgetLimits();
// 返回:[{ category, suggested, average, max }]
typescript
// 创建储蓄目标
await clawhub.createGoal(应急基金, 10000, {
description: 6个月生活费,
deadline: 2026-12-31,
priority: 高
});
// 添加储蓄贡献
await clawhub.contributeToGoal(goal_abc123, 500, 一月储蓄);
// 查看进度
const progress = clawhub.getGoalProgress();
// 返回:[{ goalName, targetAmount, currentAmount, percentageComplete, daysRemaining, onTrack }]
typescript
// 月度支出汇总
const summary = clawhub.getSpendingSummary();
// 返回:{ totalExpenses, totalIncome, netSavings, expensesByCategory, incomeByCategory }
// 查看月度趋势
const trends = clawhub.getMonthlyTrends(12);
// 返回:[{ date, expenses, income, netSavings }]
// 完整月度报告
const report = clawhub.generateMonthlyReport(2026, 1);
// 与上月对比
const comparison = clawhub.compareToLastMonth();
// 返回:{ expenseChange, incomeChange, topIncreases, topDecreases }
typescript
// 生成AI驱动的洞察
const insights = await clawhub.generateInsights();
// 返回类似以下洞察:
// - ⚠️ 您的餐饮支出是平时的3倍
// - 💡 取消未使用的订阅每月可节省50美元
// - 🏆 您已连续7天追踪支出!
// 获取未读洞察
const unreadInsights = clawhub.getInsights();
typescript
// 创建周期性支出(例如:Netflix订阅)
await clawhub.createRecurring(
expense, 15.99, 订阅, Netflix, 月度,
{ startDate: 2026-02-01 }
);
// 创建周期性收入(例如:工资)
await clawhub.createRecurring(
income, 5000, 工资, 月度工资, 月度
);
// 处理到期的周期性交易
await clawhub.processRecurring();
typescript
// 获取统计数据
const stats = clawhub.getStats();
// 返回:{ totalTransactions, totalExpenses, totalIncome, netSavings, avgExpense, topCategory }
// 获取可用类别
const categories = clawhub.getCategories();
// 导出数据
const jsonData = await clawhub.exportData();
// 创建备份
const backupPath = await clawhub.backup();
// 获取存储位置
const dataPath = clawhub.getDataPath();
| 类别 | 图标 |
|---|---|
| 餐饮 | 🍔 |
| 交通 |
| 类别 | 图标 |
|---|---|
| 工资 | 💰 |
| 自由职业 |
数据存储在特定平台的位置:
| 平台 | 默认路径 |
|---|---|
| Windows | %APPDATA%\clawhub |
| macOS |
通过环境变量覆盖:
bash
export CLAWHUBDATAPATH=/custom/path
| 方法 | 描述 |
|---|---|
| initialize(path?) | 初始化预算追踪器 |
| addExpense(amount, category, description, options?) |
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 intelligent-budget-tracker-1776375396 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 intelligent-budget-tracker-1776375396 技能
skillhub install intelligent-budget-tracker-1776375396
文件大小: 3.14 KB | 发布时间: 2026-4-17 14:24