| name | mfk-usecase-usage |
| description | Bulk-download Money Forward Kessai (マネーフォワードケッサイ) invoice PDFs with the mfk-usecase CLI — every invoice in a date range, or one by invoice id, saved into a directory. Use when the user asks to download, archive or collect their MFK invoices or 請求書 PDFs, for example for bookkeeping or a tax filing. |
| license | MIT |
| compatibility | Requires the `mfk-usecase` binary on PATH — run the mfk-usecase-install skill if it is missing. Needs MFK_API_KEY in the environment (or --api-key). Downloads write files into a directory the user chooses. For querying MFK data rather than downloading PDFs, use the mfk CLI instead. |
| allowed-tools | Bash(mfk-usecase:*) Bash(ls:*) Bash(command:*) Read |
mfk-usecase-usage
Download Money Forward Kessai invoice PDFs in bulk.
1. Is this the right tool?
This CLI does one job: fetch invoice PDFs and write them to disk.
- Downloading PDFs →
mfk-usecase (this skill)
- Querying invoices, customers, credit or payouts as data →
mfk and its /mfk-usage skill
If the user wants amounts or statuses rather than files, switch to mfk.
2. Confirm the tool and the key
command -v mfk-usecase && mfk-usecase --version
Missing? Run the mfk-usecase-install skill.
MFK_API_KEY must be in the environment. Do not pass the key with
--api-key on the command line — it lands in shell history and the process
list. If it is unset, ask the user to export it.
3. Agree on the output directory first
Downloads write real files. Before running, confirm with the user where they
want them, and check what is already there:
ls ~/Downloads/invoices 2>/dev/null | wc -l
The directory is created if missing and ~ is expanded. Repeated runs into the
same directory accumulate files.
4. Download
mfk-usecase download-invoices 2024-09-01 2025-09-30 ~/Downloads/invoices
mfk-usecase download-invoice IN_XXXXXXXXXXXXX ~/Downloads/invoices
Things that will bite you:
- Arguments are positional, in that order — not flags. Getting the order
wrong silently means a wrong date range or a directory named like a date.
- Dates must be
YYYY-MM-DD. Slash-separated dates are rejected.
- Never invent an invoice id. Ids look like
IN_…; get real ones from
mfk billings qualified if the user does not have them.
-c sets download concurrency (default 5). The default is fine — raising it
only adds load on the API.
5. Report
There is no JSON output; progress is human-readable log lines. Verify by
counting what actually landed:
ls -1 ~/Downloads/invoices/*.pdf | wc -l
Report the count, the date range and the directory. If the count is zero, say so
plainly — an empty range and a failed download look the same in the log unless
you check.
Failure modes
| Symptom | Cause | Fix |
|---|
command not found | not installed | run the mfk-usecase-install skill |
| API key errors | MFK_API_KEY unset | ask the user to export it |
| date parse errors | wrong format | use YYYY-MM-DD |
| "accepts 3 arg(s)" | positional args missing or reordered | <start> <end> <output-dir> |
| no files downloaded | no invoices in that range | confirm the range with the user |