Introduction¶
DeepSeek Harness’s (DSH) plugin-based architecture allows Agents to invoke external services through tool calls. Integrating a bookkeeping system into an Agent typically requires implementing a REST wrapper first, then orchestrating a “read-then-write” workflow. dsh-plugin-firefly-iii is a Host plugin that directly exposes Firefly III’s bookkeeping capabilities to DSH’s conversational flow.
Plugin Positioning¶
- Plugin name:
dsh-plugin-firefly-iii - Maintainer: zh-Littlebird
- Plugin type: Host bundle (
dsh.bundle.patch) + optional Web settings page - Core objective: Enable the Agent to perform bookkeeping, queries, corrections, budget checks, and financial analysis within conversations, while reducing the risk of misoperations through built-in Skills and a Web settings page.
Feature Scope¶
The plugin registers 9 domain tools via ctx.tools.register and a firefly-iii skill via ctx.skills.register.
- Bookkeeping: single, multiple, and split transactions; preview first by default, submit only when
confirm=true; time format must includeHH:MM:SS. - Query & correction: list, detail, search, filter by account/date/type; when updating split transactions,
transaction_journal_idmust be preserved. - Master data: accounts, categories, tags, budgets, budget allocations, available budgets; accounts support active status and per-day balance queries.
- Reports: official summary, account/balance/budget/category charts, expense/income/transfer insights, net worth, budget execution.
- Subscriptions & recurrences: subscriptions/bills, recurring transactions, piggy banks; triggering a recurring transaction generates a real transaction.
- Attachments: upload, download to session workspace, metadata management; constrained by
maxAttachmentMband MIME whitelist. - Rules & metadata: rules, rule groups, link types, transaction links, Webhooks, currencies, exchange rates.
- CSV export: official
/v1/data/export/*export to session workspace; overwriting existing files is rejected. - Instance diagnostics: version, release notes, endpoint capability probing; after an upgrade, use
/firefly-statusto confirm instance capabilities first.
Alignment with Firefly III 6.7¶
The plugin was initially implemented against 6.6.6. Starting from 0.2.0, it targets 6.7.9 as the baseline and handles the following differences:
- 6.7 charts/insights/autocomplete return bare JSON arrays, not JSON:API; the plugin parses them as bare arrays.
- 6.7 returns 404 for missing resources; 401 indicates only invalid/revoked tokens. Error codes and messages have been updated.
- Account listing adds
active=true|falsefilter (6.7.4), and supportsdate=YYYY-MM-DDto query a specific day’s balance. - Account responses add
credit_card_typeandmonthly_payment_date; filled in as required by Firefly when creating credit card accounts. - Categories support the
colorfield from 6.7.8 (6-digit hex, without#). - Budget charts add
includeLimits=true, callingchart/budget/overview-with-limits. - Expense insights add
subscription/no-subscriptiongrouping. - Autocomplete adds
transactions-with-meta(includes description, date, currency, amount). firefly_admin resource=instancecan view/about,/release-notes, and endpoint capability probe results.
Compatibility¶
- Firefly III: 6.7.x (tested on 6.7.9 / API 6.7.9 / PHP 8.5.12 / MySQL); 6.6 works, but 6.7 new endpoints will return 404.
- DSH:
>=0.2.2-rc.1 <0.3.0(tested on 0.2.2-rc.5). - Node.js:
>=22.19.0. - Runtime dependencies: only Node built-in
fetch, no npm runtime dependencies.
The plugin defaults to expectedApiPrefix: "6.7."; /firefly-status will warn if the instance API version does not match this series.
Installation & Activation¶
Currently installed via Git repository or local directory (npm package name reserved as dsh-plugin-firefly-iii):
git clone https://github.com/zh-Littlebird/dsh-plugin-firefly-iii.git
cd dsh-plugin-firefly-iii
# Install to the desktop profile; on Windows, use the absolute path of the directory
dsh plugin --profile desktop add "$PWD"
You can also let the Agent call plugin_manager’s install_bundle with target set to the absolute path of a local directory, or select a local directory for installation via Plugins → Add plugin in the Web sidebar.
After installation:
- Create a token in Firefly III under Profile → OAuth → Personal Access Tokens.
- Open Settings → Firefly III, fill in the instance URL and access token, click “Test Connection” to confirm the instance is reachable before saving: the URL and
autoCreatetoggles are written back to the profile config, while the token is stored in DSH’s credential store and will no longer be displayed afterwards. - Alternatively, you can still use the config file and environment variables: modify
baseUrlin the profile’scordis.patch.yml, save the token with/firefly-token <token>, then verify the connection and API version with/firefly-status.
After installing or upgrading a Host plugin, if DSH Desktop is running, the Harness process must be restarted to load the new Host code; the Web settings page is available without a refresh.
Uninstall:
dsh plugin --profile desktop remove dsh-plugin-firefly-iii
Configuration¶
cordis.patch.yml ships with a loadable default configuration; modify it according to your instance after installation. You can also fill in the instance URL directly on the Settings → Firefly III page; saving will write it back to the profile config:
- insert:
- id: firefly-iii
name: dsh-plugin-firefly-iii
config:
baseUrl: https://firefly.example.com/
currency: CNY
timeZone: Asia/Shanghai
confirmWrites: true
pageSize: 25
maxAttachmentMb: 10
expectedApiPrefix: '6.7.'
autoCreate:
accounts: false
categories: false
tags: false
budgets: false
piggyBanks: false
Key configuration items:
baseUrl: Firefly III root URL; remote instances accept onlyhttps, local instances allowhttp. If left empty, the plugin still loads to open the settings page, but tools will reportCONFIGURATION_MISSING.currency: Default currency for reports and summaries.timeZone: IANA timezone for transaction timestamps and reporting periods.confirmWrites: Whether routine writes require approval first; whenfalse, they execute directly, but destructive operations still enforce approval.pageSize: Default page size for list/search (1–100).maxAttachmentMb: Attachment upload size limit (MiB).expectedApiPrefix: Version prefix from/about; mismatch triggers a warning in/firefly-status.requestTimeoutMs: Per-request timeout (1000–120000 ms).autoCreate.accounts/categories/tags/budgets/piggyBanks: Whether to allow implicit creation of unknown accounts/categories/tags/budgets/piggy banks.
When autoCreate=false, tools will reject guessing IDs/names; use firefly_lookup to fetch live metadata first, or create them explicitly.
Token Management¶
- Recommended: Paste the token in the “Access Token” field on Settings → Firefly III and save; the value is stored in DSH’s credential store, never displayed, and never written to session logs.
- Command:
/firefly-token <token>also writes to the credential store, and the command input is not recorded in session logs. - Fallback: Process environment variable
FIREFLY_III_ACCESS_TOKEN. - Clear: “Clear Token” on the settings page, or
/firefly-token-clear. - Check:
/firefly-statusdisplays version, API version, token source, and warns on series mismatch.
No tool parameter in the plugin accepts a token, and tokens never appear in tool results, errors, or debug logs.
Tool List¶
| Tool | Purpose |
|---|---|
firefly_lookup |
Read live metadata: accounts (filterable by active/date), categories, tags, budgets, budget allocations, subscriptions, piggy banks, recurrences, rules, currencies, exchange rates, object groups, attachments; autocomplete; transaction/account search; linked records |
firefly_record |
Bookkeeping: single/multiple/split; preview first by default, submit only with confirm=true |
firefly_transactions |
Transaction list, detail, splits, update, delete, account transfer, transaction links |
firefly_masterdata |
Account/category/tag/budget CRUD; budget allocations; available budgets; no-budget transaction audit |
firefly_reports |
Summary, account/balance/budget/category charts, insights, net worth, budget execution, monthly reports, trends |
firefly_recurring |
Subscriptions/bills, recurring transactions, piggy banks; trigger recurring transactions |
firefly_attachments |
Attachment list, detail, create, upload, download, update, delete |
firefly_admin |
Currencies, exchange rates, rules, rule groups, link types, transaction links, Webhooks; instance about/release-notes/capabilities |
firefly_export |
Official CSV export to session workspace |
Bookkeeping Example¶
{
"transactions": [
{
"type": "withdrawal",
"date": "2026-11-22T12:30:00+08:00",
"amount": "28.50",
"description": "Lunch",
"source_name": "Savings Card A",
"destination_name": "Example Merchant",
"category_name": "Dining",
"tags": ["Lunch"],
"notes": "Auto-synced by DSH from text"
}
],
"confirm": false
}
Review the type, amount, time, accounts, category, budget, tags, and notes in the preview, then submit with confirm=true. Multiple transactions are submitted independently by default; use split=true only when the same expense needs to be split across different categories/budgets.
6.7 Examples¶
firefly_lookup action=list resource=accounts active=true type=asset
firefly_lookup action=autocomplete resource=transactions-with-meta query=bank
firefly_reports action=chart-budget start=2026-11-01 end=2026-11-30 includeLimits=true
firefly_reports action=insight scope=expense group=subscription start=2026-01-01 end=2026-12-01
firefly_admin resource=instance action=capabilities
Security & Privacy¶
- Token isolation: stored only in DSH’s credential store or environment variables; no tool parameter accepts a token; errors and logs do not contain tokens.
- Hard-blocked endpoints:
/data/purge,/data/destroy,/cron/{token},/batch/finishare hard-coded to be rejected on the client side and cannot be bypassed via any parameter. - Destructive operation approval: object deletion, bulk account transfers, budget allocation changes, rule/Webhook triggers, currency changes go through DSH approval; when the approval policy is
never, operations fail closed and are never executed silently. - Write gate: all five
autoCreatetoggles default to off; unknown names are never guessed into IDs. - Attachment boundaries: upload/download accept only session workspace paths, constrained by
maxAttachmentMband the MIME whitelist, and overwriting existing files is rejected. - Data flow: financial data is sent only to the configured Firefly III instance; the plugin introduces no third-party telemetry.
- No privacy in the repo: example domains are uniformly
firefly.example.com, test fixtures use generic names and example amounts, and contain no real instances, tokens, or account data.
Use Cases & Notes¶
- Suitable for DSH users who need Firefly III as a unified ledger and want to perform bookkeeping, queries, and report analysis through a conversational Agent.
- The plugin runs with the current dsh process permissions; it is recommended to review the source code and license (MIT) before installation.
- The Web settings page and Host code are decoupled; after installing or upgrading the Host plugin, the Harness process must be restarted to load the new code; the Web settings page requires no refresh.
Summary¶
dsh-plugin-firefly-iii fully integrates Firefly III’s bookkeeping capabilities into DSH, providing a toolchain from metadata queries, bookkeeping, and reports to exports, while reducing the risk of misoperations through the Web settings page and security boundary design. Under DSH’s plugin-based architecture, it demonstrates how a Host bundle + Web settings page can provide controlled interfaces for external services.
- Plugin catalog page: https://www.skillhub.cn/plugins/zh-Littlebird/dsh-plugin-firefly-iii
- GitHub repository: https://github.com/zh-Littlebird/dsh-plugin-firefly-iii