bonbox 0.2.0 → 0.5.0
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/README.md +58 -3
- package/dist/cli.js +844 -92
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,16 @@ The bonbox command line interface. It talks to the public bonbox REST API
|
|
|
4
4
|
(`https://app.bonbox.io/api/v1`) with your normal bonbox account — no direct
|
|
5
5
|
database access, no separate credentials.
|
|
6
6
|
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g bonbox
|
|
11
|
+
# or
|
|
12
|
+
brew install yannickpulver/tap/bonbox
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For local development instead:
|
|
16
|
+
|
|
7
17
|
```bash
|
|
8
18
|
pnpm -C packages/cli build
|
|
9
19
|
node packages/cli/dist/cli.js --help
|
|
@@ -17,14 +27,21 @@ node packages/cli/dist/cli.js --help
|
|
|
17
27
|
| `bonbox logout` | Remove the stored session |
|
|
18
28
|
| `bonbox whoami` | Show the signed-in account and plan |
|
|
19
29
|
| `bonbox customers ls [--archived]` | List customers |
|
|
30
|
+
| `bonbox customers create --name <name> --address <street> --postal-code <zip> --city <city> […]` | Create a customer |
|
|
31
|
+
| `bonbox customers update <name-or-id> [--name] [--address] [--postal-code] [--city] [--country] [--department]` | Update a customer (only given fields change) |
|
|
32
|
+
| `bonbox customers archive <name-or-id>` / `unarchive <name-or-id>` | Hide a customer from lists, or bring it back; it stays on its invoices and receipts |
|
|
33
|
+
| `bonbox customers delete <name-or-id>` | Delete a customer that no invoice, receipt or project uses (else archive it) |
|
|
20
34
|
| `bonbox invoices ls [--status created\|paid] [--quotes]` | List invoices or quotes |
|
|
21
|
-
| `bonbox invoices create --customer <name-or-id> --item "…"` | Create an invoice or quote |
|
|
35
|
+
| `bonbox invoices create --customer <name-or-id> --item "…" [--receipt <id>] [--combine] [--attach-receipts]` | Create an invoice or quote |
|
|
36
|
+
| `bonbox invoices update <number-or-id> [--customer] [--item "…"] [--receipt <id>] [--combine] [--[no-]attach-receipts] [--date] [--payment-days] [--currency] [--language] [--subtitle] [--reference] [--vat-rate] [--custom-notes]` | Update an invoice or quote (only given fields change) |
|
|
22
37
|
| `bonbox invoices pdf <number-or-id> [-o file]` | Download the PDF |
|
|
23
38
|
| `bonbox invoices paid <number-or-id> [--date] [--no-receipt]` | Mark an invoice as paid |
|
|
24
39
|
| `bonbox invoices unpaid <number-or-id>` | Undo a payment |
|
|
25
|
-
| `bonbox receipts ls [--month YYYY-MM] [--from] [--to] [--project]` | List receipts |
|
|
26
|
-
| `bonbox receipts add --seller <s> --price <n> […]` | Add a receipt by hand |
|
|
40
|
+
| `bonbox receipts ls [--month YYYY-MM] [--from] [--to] [--project]` | List receipts (VAT column only while VAT is on) |
|
|
41
|
+
| `bonbox receipts add --seller <s> --price <n> [--vat-rate 8.1] […]` | Add a receipt by hand (`--vat-rate`: Swiss VAT in the amount, 0 = none) |
|
|
42
|
+
| `bonbox receipts edit <id> [--seller] [--price] [--date] [--vat-rate] [--booking-text] [--exchange-rate] [--project] [--customer]` | Change a receipt; an empty flag clears the field |
|
|
27
43
|
| `bonbox receipts scan <file…> [--project]` | Upload a receipt and have it read out |
|
|
44
|
+
| `bonbox vat` | Show the VAT (MWST) setting and the filed returns (VAT is switched on in the app) |
|
|
28
45
|
|
|
29
46
|
Every command takes `--json` (raw API response, no decoration) and `--lang`.
|
|
30
47
|
|
|
@@ -40,9 +57,47 @@ bonbox invoices create \
|
|
|
40
57
|
--pdf invoice.pdf
|
|
41
58
|
```
|
|
42
59
|
|
|
60
|
+
### Billing expenses (Spesen)
|
|
61
|
+
|
|
62
|
+
`--receipt <id>` (repeatable) bills an expense receipt to the customer: one
|
|
63
|
+
position per receipt, or one combined position with `--combine` ("Spesen" in
|
|
64
|
+
the invoice language). The API fills in description and amount — the
|
|
65
|
+
receipt's amount, converted when the invoice is in your default currency.
|
|
66
|
+
`--attach-receipts` appends the receipts' files to the PDF. On `update`,
|
|
67
|
+
`--receipt` without `--item` adds to the existing positions.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bonbox invoices create --customer "Velo GmbH" --item "Design work:8:145" \
|
|
71
|
+
--receipt 3f0c… --receipt 9a1e… --combine --attach-receipts
|
|
72
|
+
```
|
|
73
|
+
|
|
43
74
|
`--customer` accepts an ID, an exact name, or a unique name prefix. If a prefix
|
|
44
75
|
matches several customers the CLI lists them and stops.
|
|
45
76
|
|
|
77
|
+
### Updating a customer
|
|
78
|
+
|
|
79
|
+
`customers update` takes the same flags as `create`, but only the flags you
|
|
80
|
+
pass are changed — everything else is left as-is. `--country` and
|
|
81
|
+
`--department` are optional fields: passing them as an empty string
|
|
82
|
+
(`--country ""`) clears that field. `--name`, `--address`, `--postal-code` and
|
|
83
|
+
`--city` are required fields and cannot be cleared this way — the API rejects
|
|
84
|
+
an empty value for those.
|
|
85
|
+
|
|
86
|
+
### Updating an invoice
|
|
87
|
+
|
|
88
|
+
`invoices update <number-or-id>` accepts `--customer`, `--item`, `--date`,
|
|
89
|
+
`--payment-days`, `--currency`, `--language`, `--subtitle`, `--reference`,
|
|
90
|
+
`--vat-rate` and `--custom-notes` — only the flags you pass are changed,
|
|
91
|
+
everything else (including existing line items) is left as-is. There is no
|
|
92
|
+
`--quote` flag; whether an invoice is a quote can't be changed after creation.
|
|
93
|
+
Unlike `create`, `--date` has no "today by default" — omit it to leave the
|
|
94
|
+
invoice date untouched. `--subtitle`, `--reference`, `--custom-notes` and
|
|
95
|
+
`--vat-rate` are optional fields: passing them as an empty string
|
|
96
|
+
(`--vat-rate ""`) clears that field. Passing `--item` at all REPLACES the
|
|
97
|
+
entire line-item list with the given items, the same way the apps do when you
|
|
98
|
+
edit an invoice — it is not a way to add a single item. A paid invoice cannot
|
|
99
|
+
be updated; run `bonbox invoices unpaid` first.
|
|
100
|
+
|
|
46
101
|
### Marking an invoice paid
|
|
47
102
|
|
|
48
103
|
```bash
|