README.md

  1<img width="1200" alt="Invoice" src="https://github.com/maaslalani/nap/assets/42545625/16dae9d9-390c-49b6-aedd-3f882b17f57b">
  2
  3# Invoice
  4
  5Generate invoices from the command line.
  6
  7## Command Line Interface
  8
  9```bash
 10invoice generate --from "Dream, Inc." --to "Imagine, Inc." \
 11    --item "Rubber Duck" --quantity 2 --rate 25 \
 12    --tax 0.13 --discount 0.15 \
 13    --note "For debugging purposes."
 14```
 15
 16<img src="https://vhs.charm.sh/vhs-66CMd4UQuXkuxX9djHUnGX.gif" width="600" />
 17
 18View the generated PDF at `invoice.pdf`, you can customize the output location
 19with `--output`.
 20
 21```bash
 22open invoice.pdf
 23```
 24
 25<img width="574" alt="Example invoice" src="https://github.com/maaslalani/nap/assets/42545625/13153de2-dfa1-41e6-a18e-4d3a5cea5b74">
 26
 27### Environment
 28
 29Save repeated information with environment variables:
 30
 31```bash
 32export INVOICE_LOGO=/path/to/image.png
 33export INVOICE_FROM="Dream, Inc."
 34export INVOICE_TO="Imagine, Inc."
 35export INVOICE_TAX=0.13
 36export INVOICE_RATE=25
 37```
 38
 39Generate new invoice:
 40
 41```bash
 42invoice generate \
 43    --item "Yellow Rubber Duck" --quantity 5 \
 44    --item "Special Edition Plaid Rubber Duck" --quantity 1 \
 45    --note "For debugging purposes." \
 46    --output duck-invoice.pdf
 47```
 48
 49### Configuration File
 50
 51Or, save repeated information with JSON / YAML:
 52
 53```json
 54{
 55    "logo": "/path/to/image.png",
 56    "from": "Dream, Inc.",
 57    "to": "Imagine, Inc.",
 58    "tax": 0.13,
 59    "rates": 25
 60}
 61```
 62
 63Generate new invoice by importing the configuration file:
 64
 65```bash
 66invoice generate --import path/to/data.json \
 67    --output duck-invoice.pdf
 68```
 69
 70### Custom Templates
 71
 72If you would like a custom invoice template for your business or company, please
 73reach out via:
 74
 75* [Email](mailto:maas@lalani.dev)
 76* [Twitter](https://twitter.com/maaslalani)
 77
 78## Installation
 79
 80<!--
 81
 82Use a package manager:
 83
 84```bash
 85# macOS
 86brew install invoice
 87
 88# Arch
 89yay -S invoice
 90
 91# Nix
 92nix-env -iA nixpkgs.invoice
 93```
 94
 95-->
 96
 97Install with Go:
 98
 99```sh
100go install github.com/maaslalani/invoice@main
101```
102
103Or download a binary from the [releases](https://github.com/maaslalani/invoice/releases).
104
105## License
106
107[MIT](https://github.com/maaslalani/invoice/blob/master/LICENSE)
108
109## Feedback
110
111I'd love to hear your feedback on improving `invoice`.
112
113Feel free to reach out via:
114* [Email](mailto:maas@lalani.dev)
115* [Twitter](https://twitter.com/maaslalani)
116* [GitHub issues](https://github.com/maaslalani/invoice/issues/new)
117
118---
119
120<sub><sub>z</sub></sub><sub>z</sub>z