Skip to main content

CLI to generate monthly consulting invoices as PDFs from YAML

Project description

yinv

CLI to generate monthly consulting invoices as PDFs. You edit a YAML draft in your $EDITOR, save, and get a PDF that matches a consistent template.

Install

brew tap nixmaldonado/yinv
brew install -v yinv

First install can take a couple of minutes so use -v to see it's actually progressing.

Configure

yinv config set invoices.dir ~/Documents/Invoices
yinv config set client.default <your-client-subdir-name>

invoices.dir is the parent dir containing one subdir per client. Each client's invoices live under {invoices.dir}/{client}/{year}/.

Use

First run

yinv new

If no prior invoice exists for client.default, yinv new writes a placeholder YAML into the correct path and opens it in $EDITOR.

Fill in the placeholders (name, address, bank details, line items), then save and exit your editor. yinv new will validate the YAML and generate the PDF automatically after the editor exits successfully.

The seed file still contains placeholder contact, bank, and pricing values, but the default Consulting fees for <Month YYYY> description is adjusted to the target service month automatically.

Monthly

yinv new

Forks the latest invoice, increments the number, rolls the month forward (updating dates and exact Month YYYY tokens in line-item descriptions), opens in $EDITOR for review, and renders the PDF after the editor exits successfully.

Example: if the previous invoice contains Consulting fees for April 2026, the next one will become Consulting fees for May 2026.

The month rewrite is intentionally narrow: it only replaces the exact previous invoice service-month token. If the prior invoice still says January 2026 or uses a different format such as Jan 2026, that text will be carried forward unchanged.

yinv new --month 2026-07 targets a specific month (skip ahead / regenerate). yinv new --force overwrites an existing target.

Re-render

yinv render <file.yaml>

Writes a fresh PDF next to the YAML. Useful after manually editing a YAML. This is mainly for re-rendering an existing invoice; yinv new already renders the new month's PDF automatically after a successful editor exit.

AI-driven workflow

yinv ships with a portable AI skill that lets you drive the same workflow from an agent ("generate May's invoice for Acme", "add a tech allowance line", "re-render the PDF"). For Claude Code, install it with:

yinv skill install

That copies the bundled skill to ~/.claude/skills/yinv/SKILL.md. For other agents, use --dest <path> or --print to redirect to wherever your tool expects skills to live.

The skill calls yinv new --no-edit --client <name> instead of the interactive flow, then edits the YAML and runs yinv render once you've confirmed the changes look right.

Commands (v0.1)

Command Purpose
yinv new [--month YYYY-MM] [--client NAME] [--force] [--no-edit] First-run bootstrap or monthly fork. --no-edit skips $EDITOR and auto-render (useful for agents).
yinv render <file.yaml> Render one YAML to PDF.
yinv config set <key> <value> Write a config key.
yinv config get <key> Read a config key.
yinv skill install [--dest PATH] [--print] [--force] Install the bundled AI skill (default: ~/.claude/skills/yinv/).

Data layout

~/Documents/Invoices/            ← invoices.dir
└── <client>/                    ← one subdir per client
    └── 2026/
        ├── March2026.yaml       ← source of truth
        └── March2026.pdf        ← generated from the YAML

Nothing else. No database, no index file. Add another client tomorrow by creating another subdir.

Configuration keys

Key Default Description
invoices.dir Parent directory containing one subdir per client.
client.default Client subdirectory to use when running yinv new.
editor $VISUAL / $EDITOR / vi Command used to open YAML drafts for editing.
currency USD Currency code used in invoices.
invoice_number.width 6 Minimum zero-padded width for invoice numbers.

Config is stored in ~/.config/yinv/config.toml.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yinv-0.1.2.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yinv-0.1.2-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file yinv-0.1.2.tar.gz.

File metadata

  • Download URL: yinv-0.1.2.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yinv-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c19a3f9f28a008c671882f4dac5d938ad4057f815a32c518e5db563c8f90e05f
MD5 c1fbdbff33f50f0e7773aea8ee354115
BLAKE2b-256 4ff6eabe5a423aa3b88df47a0c3a981b8f3d1fa2035b2e64746eb75d8b0d7c03

See more details on using hashes here.

File details

Details for the file yinv-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yinv-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yinv-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a1982c39112288ea0349d50d6a9f5b64413c651a689f81d0fd4dcc7940c4cc04
MD5 a5bcc2cff82acc2371c6d291b7edbe90
BLAKE2b-256 a8b1b911c3b0f5b6c158b7966ef9deb4cc2cd84afcd5bb8ea458b933dffe5465

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page