Generate Invoice
Generate a PDF invoice by pulling hours from Toggl and rendering to PDF. The tool lives at /home/czue/src/personal/agent-tools/invoice-gen/.
Arguments
$0: (optional) end date (YYYY-MM-DD)$1: (optional) client config name (default: "peregrine")$2: (optional) start date (YYYY-MM-DD, defaults to day after last invoice)
Workflow
-
Resolve the end date:
- If
$0is provided, use it. - Otherwise, use
AskUserQuestionto ask: "What end date for the invoice?" with options for today's date and end of last month.
- If
-
Resolve the client:
- If
$1is provided, use it. - Otherwise, default to
peregrine.
- If
-
Dry run first to confirm hours and amount:
cd /home/czue/src/personal/agent-tools/invoice-gen && uv run python generate.py --end <end_date> --client <client> --dry-runIf
$2(start date) is provided, add--start <start_date>. Show the user the hours and amount and ask for confirmation before generating. -
Generate the invoice:
cd /home/czue/src/personal/agent-tools/invoice-gen && uv run python generate.py --end <end_date> --client <client>Add
--startand--descriptionif provided by the user. -
Report results: Show the output path and the invoice summary (hours, rate, amount).
CLI Options
--start: Start date. Defaults to day after last invoice end date for that client.--end: End date (required).--client: Client config name matching a file ininvoice-gen/clients/.--description: Work description (default: "Ongoing bolt assistant work.").--output-dir: Output directory (default:/home/czue/Dropbox/Personal/Elodin/invoices).--dry-run: Preview without generating.
Client Configs
Client TOML files live in invoice-gen/clients/. Each has: name, country, rate, currency, toggl_project_name, line_item_description. To add a new client, copy example.toml.
Notes
- Invoice numbers auto-increment via
invoice-gen/counter.json. - Last end date per client is tracked, so
--startis usually not needed. - Suppress
uvwarnings in output (they're noisy but harmless).
