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 "items": ["Yellow Rubber Duck", "Special Edition Plaid Rubber Duck"],
60 "quantities": [5, 1],
61 "rates": [25, 25],
62}
63```
64
65Generate new invoice by importing the configuration file:
66
67```bash
68invoice generate --import path/to/data.json \
69 --output duck-invoice.pdf
70```
71
72### Custom Templates
73
74If you would like a custom invoice template for your business or company, please
75reach out via:
76
77* [Email](mailto:maas@lalani.dev)
78* [Twitter](https://twitter.com/maaslalani)
79
80## Installation
81
82<!--
83
84Use a package manager:
85
86```bash
87# macOS
88brew install invoice
89
90# Arch
91yay -S invoice
92
93# Nix
94nix-env -iA nixpkgs.invoice
95```
96
97-->
98
99Install with Go:
100
101```sh
102go install github.com/maaslalani/invoice@main
103```
104
105Or download a binary from the [releases](https://github.com/maaslalani/invoice/releases).
106
107## License
108
109[MIT](https://github.com/maaslalani/invoice/blob/master/LICENSE)
110
111## Feedback
112
113I'd love to hear your feedback on improving `invoice`.
114
115Feel free to reach out via:
116* [Email](mailto:maas@lalani.dev)
117* [Twitter](https://twitter.com/maaslalani)
118* [GitHub issues](https://github.com/maaslalani/invoice/issues/new)
119
120---
121
122<sub><sub>z</sub></sub><sub>z</sub>z