cli-invoice 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CLI Invoice Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # CLI Invoice
2
+
3
+ Generate professional PDF invoices, manage clients, and track payments — entirely from the terminal. Offline, scriptable, and version-control friendly.
4
+
5
+ ```
6
+ $ inv create --client "Acme Corp" --item "Web development" --qty 40 --rate 150
7
+ Invoice INV-0001 created. Total: $6,000.00. Due: Apr 13, 2026.
8
+
9
+ $ inv export INV-0001
10
+ Exported to ./INV-0001-acme-corp.pdf
11
+ ```
12
+
13
+ ## Quick Install
14
+
15
+ ```bash
16
+ npm install -g cli-invoice
17
+ ```
18
+
19
+ Requires Node.js 18 or later.
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ # 1. Set up your business details
25
+ inv init
26
+
27
+ # 2. Add a client
28
+ inv client add --name "Acme Corp" --email "billing@acme.com"
29
+
30
+ # 3. Create an invoice
31
+ inv create --client "Acme Corp" \
32
+ --item "Web development" --qty 40 --rate 150 \
33
+ --item "Code review" --qty 5 --rate 150
34
+
35
+ # 4. Export to PDF
36
+ inv export INV-0001
37
+
38
+ # 5. Track payment
39
+ inv status INV-0001 sent
40
+ inv status INV-0001 paid
41
+ ```
42
+
43
+ ## Command Reference
44
+
45
+ ### Setup
46
+
47
+ | Command | Description |
48
+ |---------|-------------|
49
+ | `inv init` | Interactive setup wizard for your business profile |
50
+ | `inv config set <key> <value>` | Update a config value (e.g., `defaults.currency EUR`) |
51
+ | `inv config show` | Display current configuration |
52
+
53
+ ### Client Management
54
+
55
+ | Command | Description |
56
+ |---------|-------------|
57
+ | `inv client add --name <n> --email <e>` | Add a new client |
58
+ | `inv client list` | List all clients with invoice counts and totals |
59
+ | `inv client edit <name> [--email <e>]` | Edit client details |
60
+ | `inv client remove <name>` | Remove a client |
61
+
62
+ ### Invoicing
63
+
64
+ | Command | Description |
65
+ |---------|-------------|
66
+ | `inv create --client <name> [options]` | Create a new invoice |
67
+ | `inv show <id>` | Display full invoice details |
68
+ | `inv edit <id> [options]` | Edit a draft invoice |
69
+ | `inv delete <id>` | Delete a draft invoice |
70
+ | `inv list [--status <filter>]` | List invoices (filter: draft, sent, paid, overdue) |
71
+ | `inv status <id> <status>` | Update status (sent, paid) |
72
+ | `inv export <id>` | Generate PDF |
73
+ | `inv summary [--year YYYY]` | Revenue summary (Pro) |
74
+
75
+ ### Line Items
76
+
77
+ Line items can be provided in two ways:
78
+
79
+ **Repeated flags:**
80
+ ```bash
81
+ inv create --client "Acme" \
82
+ --item "Development" --qty 40 --rate 150 \
83
+ --item "Code review" --qty 5 --rate 150
84
+ ```
85
+
86
+ **From a JSON file:**
87
+ ```bash
88
+ inv create --client "Acme" --from items.json
89
+ ```
90
+
91
+ Where `items.json` is:
92
+ ```json
93
+ [
94
+ { "description": "Development", "quantity": 40, "unit_price": 150 },
95
+ { "description": "Code review", "quantity": 5, "unit_price": 150 }
96
+ ]
97
+ ```
98
+
99
+ ### License & Pro
100
+
101
+ | Command | Description |
102
+ |---------|-------------|
103
+ | `inv upgrade` | Show Pro tier info and pricing |
104
+ | `inv activate <key>` | Activate a Pro license key |
105
+
106
+ ## Free vs Pro
107
+
108
+ | Feature | Free | Pro |
109
+ |---------|------|-----|
110
+ | Clients | 3 | Unlimited |
111
+ | Invoices per month | 5 | Unlimited |
112
+ | PDF export | Yes | Yes |
113
+ | Recurring templates | -- | Yes |
114
+ | Revenue summaries | -- | Yes |
115
+ | Custom PDF templates | -- | Yes |
116
+
117
+ ## Data Storage
118
+
119
+ All data is stored locally in `~/.config/cli-invoice/` (XDG-compliant):
120
+
121
+ ```
122
+ ~/.config/cli-invoice/
123
+ config.toml # Business profile and preferences
124
+ data/
125
+ clients.json # Client records
126
+ invoices.json # Invoice records
127
+ counter.json # Invoice number counter
128
+ ```
129
+
130
+ No cloud. No accounts. Your data stays on your machine.
131
+
132
+ ## Environment Variables
133
+
134
+ | Variable | Description |
135
+ |----------|-------------|
136
+ | `XDG_CONFIG_HOME` | Override config base directory (default: `~/.config`) |
137
+
138
+ No API keys or secrets required.
139
+
140
+ ## Development
141
+
142
+ ```bash
143
+ # Install dependencies
144
+ npm install
145
+
146
+ # Run in development mode
147
+ npx tsx bin/inv.ts --help
148
+
149
+ # Type check
150
+ npx tsc --noEmit
151
+
152
+ # Run tests
153
+ npx vitest run
154
+
155
+ # Build
156
+ npx tsup
157
+ ```
158
+
159
+ ## Contributing
160
+
161
+ 1. Fork the repository
162
+ 2. Create a feature branch
163
+ 3. Make your changes with tests
164
+ 4. Run `npx tsc --noEmit && npx vitest run` to verify
165
+ 5. Submit a pull request
166
+
167
+ ## Disclaimer
168
+
169
+ CLI Invoice is a billing tool, not accounting software. Generated invoices are for informational purposes. Consult a qualified accountant for tax and financial matters. CLI Invoice is not responsible for errors in invoices or their legal enforceability in any jurisdiction.
170
+
171
+ ## License
172
+
173
+ MIT