Communitygithub.com

cli-anything-firefly-iii

Firefly III CLI - 基于 CLI-Anything 规范的命令行个人财务管理工具

cli-anything-firefly-iii 是什么?

Firefly III CLI 是一款基于 CLI-Anything 规范开发的个人财务命令行管理工具,将原本的 MCP 模式转换为无状态的 CLI 模式,从而避免 Node 进程残留问题。它支持 Python 3.10+ 环境,需要连接一个正在运行的 Firefly III 实例并通过个人访问令牌(PAT)进行认证。该工具提供了覆盖账户、交易、预算、分类、标签、账单、存钱罐、货币、循环交易、规则、规则组、摘要、Webhooks、洞察与报告、搜索、数据导出和系统信息等 18 个命令组,几乎囊括了 Firefly III 的全部 API 功能。通过 `--json` 标志可以获得结构化输出,并支持预设参数(如 budget、reporting 等)来筛选可用命令,适合开发者和 AI 代理通过命令行自动管理个人财务。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-firefly-iii

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Firefly III CLI

基于 CLI-Anything 规范的 Firefly III 命令行界面。将 MCP 模式转换为无状态 CLI 模式,以避免 Node 残留进程问题。

安装

pip install cli-anything-firefly-iii

前提条件

  • Python 3.10+
  • 正在运行的 Firefly III 实例
  • 个人访问令牌 (PAT)

配置

环境变量(推荐)

export FIREFLY_III_BASE_URL="https://firefly.yourdomain.com"
export FIREFLY_III_PAT="your-personal-access-token"

命令行参数

cli-anything-firefly-iii --base-url https://firefly.yourdomain.com --pat your-token

命令组

命令组描述对应的 API
accounts账户管理(CRUD)/api/v1/accounts
transactions交易管理(CRUD)/api/v1/transactions
budgets预算管理(CRUD + 限制)/api/v1/budgets
categories分类管理(CRUD)/api/v1/categories
tags标签管理(CRUD)/api/v1/tags
bills账单管理(CRUD)/api/v1/bills
piggy-banks存钱罐管理(CRUD + 事件)/api/v1/piggy-banks
autocomplete各类实体的自动补全/api/v1/autocomplete/*
currencies货币管理(CRUD)/api/v1/currencies
recurrences循环交易管理(CRUD)/api/v1/recurrences
rules规则管理(CRUD + 测试/执行)/api/v1/rules
rule-groups规则组管理(CRUD + 执行)/api/v1/rule-groups
summary财务摘要/api/v1/summary/*
webhooksWebhook 管理(CRUD + 触发)/api/v1/webhooks
insights洞察与报告/api/v1/insight/*
search搜索/api/v1/search/*
export数据导出/api/v1/data/export/*
info系统信息/api/v1/about

使用示例

账户管理

# 列出所有账户
cli-anything-firefly-iii --json accounts list

# 列出资产账户
cli-anything-firefly-iii --json accounts list --type asset

# 获取账户详情
cli-anything-firefly-iii --json accounts get --id 123

# 创建账户
cli-anything-firefly-iii --json accounts create --name "Cash" --type asset --currency-code USD

# 更新账户
cli-anything-firefly-iii --json accounts update --id 123 --name "New Name"

# 删除账户
cli-anything-firefly-iii accounts delete --id 123

交易管理

# 列出交易
cli-anything-firefly-iii --json transactions list --limit 10

# 按日期范围列出交易
cli-anything-firefly-iii --json transactions list --start 2024-01-01 --end 2024-01-31

# 创建交易
cli-anything-firefly-iii --json transactions create \
  --description "Grocery" \
  --amount 50.00 \
  --source-account 1 \
  --category "Food"

# 更新交易
cli-anything-firefly-iii --json transactions update --id 456 --description "Updated"

# 删除交易
cli-anything-firefly-iii transactions delete --id 456

预算管理

# 列出预算
cli-anything-firefly-iii --json budgets list

# 获取预算详情
cli-anything-firefly-iii --json budgets get --id 1

# 创建预算
cli-anything-firefly-iii --json budgets create --name "Monthly Budget"

# 更新预算
cli-anything-firefly-iii --json budgets update --id 1 --name "New Budget Name"

# 删除预算
cli-anything-firefly-iii budgets delete --id 1

# 列出预算限制
cli-anything-firefly-iii --json budgets limits --budget-id 1

# 创建预算限制
cli-anything-firefly-iii --json budgets limit-create --budget-id 1 --amount 1000 --start 2024-01-01 --end 2024-01-31

# 更新预算限制
cli-anything-firefly-iii --json budgets limit-update --id 1 --amount 1500

# 删除预算限制
cli-anything-firefly-iii budgets limit-delete --id 1

分类管理

# 列出分类
cli-anything-firefly-iii --json categories list

# 获取分类
cli-anything-firefly-iii --json categories get --id 1

# 创建分类
cli-anything-firefly-iii --json categories create --name "Food"

# 更新分类
cli-anything-firefly-iii --json categories update --id 1 --name "Food & Dining"

# 删除分类
cli-anything-firefly-iii categories delete --id 1

标签管理

# 列出标签
cli-anything-firefly-iii --json tags list

# 获取标签
cli-anything-firefly-iii --json tags get --id "uuid-here"

# 创建标签
cli-anything-firefly-iii --json tags create --tag "important"

# 更新标签
cli-anything-firefly-iii --json tags update --id "uuid-here" --tag "important-updated"

# 删除标签
cli-anything-firefly-iii tags delete --id "uuid-here"

账单管理

# 列出账单
cli-anything-firefly-iii --json bills list

# 获取账单
cli-anything-firefly-iii --json bills get --id 1

# 创建账单
cli-anything-firefly-iii --json bills create \
  --name "Netflix" \
  --amount-min 15.99 \
  --amount-max 15.99 \
  --frequency monthly

# 更新账单
cli-anything-firefly-iii --json bills update --id 1 --amount-min 19.99

# 删除账单
cli-anything-firefly-iii bills delete --id 1

存钱罐管理

# 列出存钱罐
cli-anything-firefly-iii --json piggy-banks list

# 获取存钱罐
cli-anything-firefly-iii --json piggy-banks get --id 1

# 创建存钱罐
cli-anything-firefly-iii --json piggy-banks create \
  --name "Vacation Fund" \
  --account-id 1 \
  --target-amount 5000

# 更新存钱罐
cli-anything-firefly-iii --json piggy-banks update --id 1 --name "New Name"

# 删除存钱罐
cli-anything-firefly-iii piggy-banks delete --id 1

# 列出存钱罐事件
cli-anything-firefly-iii --json piggy-banks events --id 1

# 向存钱罐添加资金
cli-anything-firefly-iii --json piggy-banks add-money --id 1 --amount 100

自动补全

# 自动补全账户
cli-anything-firefly-iii --json autocomplete accounts --query "bank"

# 自动补全分类
cli-anything-firefly-iii --json autocomplete categories --query "food"

# 自动补全标签
cli-anything-firefly-iii --json autocomplete tags --query "important"

# 自动补全交易
cli-anything-firefly-iii --json autocomplete transactions --query "grocery"

# 自动补全预算
cli-anything-firefly-iii --json autocomplete budgets --query "monthly"

# 自动补全账单
cli-anything-firefly-iii --json autocomplete bills --query "netflix"

# 自动补全存钱罐
cli-anything-firefly-iii --json autocomplete piggy-banks --query "vacation"

# 自动补全货币
cli-anything-firefly-iii --json autocomplete currencies --query "dollar"

# 自动补全规则
cli-anything-firefly-iii --json autocomplete rules --query "auto"

# 自动补全规则组
cli-anything-firefly-iii --json autocomplete rule-groups --query "finances"

# 自动补全循环交易
cli-anything-firefly-iii --json autocomplete recurring --query "rent"

# 自动补全对象组
cli-anything-firefly-iii --json autocomplete object-groups --query "group"

# 自动补全交易类型
cli-anything-firefly-iii --json autocomplete transaction-types --query "with"

货币管理

# 列出货币
cli-anything-firefly-iii --json currencies list

# 获取货币
cli-anything-firefly-iii --json currencies get --id 1

# 创建货币
cli-anything-firefly-iii --json currencies create \
  --code "CNY" \
  --name "Chinese Yuan" \
  --symbol "¥"

# 更新货币
cli-anything-firefly-iii --json currencies update --id 1 --symbol "元"

# 删除货币
cli-anything-firefly-iii currencies delete --id 1

# 获取汇率
cli-anything-firefly-iii --json currencies exchange-rates --from USD --to EUR

循环交易管理

# 列出循环交易
cli-anything-firefly-iii --json recurrences list

# 获取循环交易
cli-anything-firefly-iii --json recurrences get --id 1

# 创建循环交易
cli-anything-firefly-iii --json recurrences create \
  --title "Rent Payment" \
  --type withdrawal \
  --amount 1500 \
  --source-account 1 \
  --destination-account 2 \
  --frequency monthly

# 更新循环交易
cli-anything-firefly-iii --json recurrences update --id 1 --amount 1600

# 删除循环交易
cli-anything-firefly-iii recurrences delete --id 1

规则管理

# 列出规则
cli-anything-firefly-iii --json rules list

# 获取规则
cli-anything-firefly-iii --json rules get --id 1

# 创建规则
cli-anything-firefly-iii --json rules create \
  --title "Auto-tag groceries" \
  --trigger "description_contains" \
  --value "grocery" \
  --action set_category \
  --action-value "Food"

# 更新规则
cli-anything-firefly-iii --json rules update --id 1 --title "New Title"

# 删除规则
cli-anything-firefly-iii rules delete --id 1

# 测试规则
cli-anything-firefly-iii --json rules test --id 1

# 执行规则
cli-anything-firefly-iii --json rules execute --id 1

规则组管理

# 列出规则组
cli-anything-firefly-iii --json rule-groups list

# 获取规则组
cli-anything-firefly-iii --json rule-groups get --id 1

# 创建规则组
cli-anything-firefly-iii --json rule-groups create --title "Finance Rules"

# 更新规则组
cli-anything-firefly-iii --json rule-groups update --id 1 --title "New Title"

# 删除规则组
cli-anything-firefly-iii rule-groups delete --id 1

# 执行规则组
cli-anything-firefly-iii --json rule-groups execute --id 1

摘要报告

# 默认摘要集
cli-anything-firefly-iii --json summary default-set --start 2024-01-01 --end 2024-01-31

# 账户摘要
cli-anything-firefly-iii --json summary account-summary --start 2024-01-01 --end 2024-01-31

# 可用预算摘要
cli-anything-firefly-iii --json summary available-budget --start 2024-01-01 --end 2024-01-31

# 账单摘要
cli-anything-firefly-iii --json summary bill-summary --start 2024-01-01 --end 2024-01-31

# 预算摘要
cli-anything-firefly-iii --json summary budget-summary --start 2024-01-01 --end 2024-01-31

# 分类摘要
cli-anything-firefly-iii --json summary category-summary --start 2024-01-01 --end 2024-01-31

# 标签摘要
cli-anything-firefly-iii --json summary tag-summary --start 2024-01-01 --end 2024-01-31

# 转账摘要
cli-anything-firefly-iii --json summary transfer-summary --start 2024-01-01 --end 2024-01-31

Webhook 管理

# 列出 Webhook
cli-anything-firefly-iii --json webhooks list

# 获取 Webhook
cli-anything-firefly-iii --json webhooks get --id 1

# 创建 Webhook
cli-anything-firefly-iii --json webhooks create \
  --title "My Webhook" \
  --trigger create \
  --url "https://example.com/webhook" \
  --secret "my-secret"

# 更新 Webhook
cli-anything-firefly-iii --json webhooks update --id 1 --title "New Title"

# 删除 Webhook
cli-anything-firefly-iii webhooks delete --id 1

# 手动触发 Webhook
cli-anything-firefly-iii --json webhooks trigger --id 1

洞察与报告

# 支出报告(按分类)
cli-anything-firefly-iii --json insights expense \
  --start 2024-01-01 \
  --end 2024-01-31 \
  --group-by category

# 收入报告
cli-anything-firefly-iii --json insights income \
  --start 2024-01-01 \
  --end 2024-01-31

# 转账洞察
cli-anything-firefly-iii --json insights transfer \
  --start 2024-01-01 \
  --end 2024-01-31

# 账户概览
cli-anything-firefly-iii --json insights overview \
  --start 2024-01-01 \
  --end 2024-01-31

搜索

# 搜索交易
cli-anything-firefly-iii --json search transactions --query "grocery"

数据导出

# 导出交易
cli-anything-firefly-iii --json export transactions \
  --start 2024-01-01 \
  --end 2024-01-31

# 导出账户
cli-anything-firefly-iii --json export accounts

# 导出预算
cli-anything-firefly-iii --json export budgets

# 导出分类
cli-anything-firefly-iii --json export categories

系统信息

# 系统信息
cli-anything-firefly-iii --json info about

# 连接状态
cli-anything-firefly-iii info status

预设过滤

使用 --preset 参数来过滤可用命令:

# 默认预设
cli-anything-firefly-iii --preset default accounts list

# 全部预设
cli-anything-firefly-iii --preset full accounts list

# 预算预设
cli-anything-firefly-iii --preset budget budgets list

# 报告预设
cli-anything-firefly-iii --preset reporting insights expense --start 2024-01-01 --end 2024-01-31

可用的预设:

  • default:核心功能(账户、交易、分类、标签、账单、搜索)
  • full:所有功能
  • basic:基础功能(账户、交易、分类、标签、搜索)
  • budget:预算相关(账户、预算、交易、摘要、洞察)
  • reporting:报告相关(账户、交易、分类、洞察、摘要、搜索)
  • admin:管理功能(关于、配置、货币、用户、偏好)
  • automation:自动化(规则、循环交易、Webhook、交易)

代理使用指南

基本用法

  1. 使用 --json 获取结构化输出:所有命令都支持 --json 标志,返回 JSON 格式数据
  2. 首先调用 info status 检查连接:在执行操作前确认 Firefly III 连接正常
  3. 使用预设减少命令数量:通过 --preset 过滤不必要的命令

常见工作流

查看账户余额

# 1. 检查连接
cli-anything-firefly-iii info status

# 2. 列出资产账户
cli-anything-firefly-iii --json accounts list --type asset

# 3. 查看账户详情(获取余额)
cli-anything-firefly-iii --json accounts get --id <account_id>

记录支出

# 1. 查找支出账户
cli-anything-firefly-iii --json accounts list --type expense

# 2. 创建交易
cli-anything-fi

…

[内容已截断]

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

cli-anything-inkscape

>-

相关技能