bonbox 0.1.0 → 0.3.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 CHANGED
@@ -13,12 +13,15 @@ node packages/cli/dist/cli.js --help
13
13
 
14
14
  | Command | What it does |
15
15
  | --- | --- |
16
- | `bonbox login [--provider google\|apple]` | Sign in through the browser and store the session |
16
+ | `bonbox login` | Sign in through the browser and store the session |
17
17
  | `bonbox logout` | Remove the stored session |
18
18
  | `bonbox whoami` | Show the signed-in account and plan |
19
19
  | `bonbox customers ls [--archived]` | List customers |
20
+ | `bonbox customers create --name <name> --address <street> --postal-code <zip> --city <city> […]` | Create a customer |
21
+ | `bonbox customers update <name-or-id> [--name] [--address] [--postal-code] [--city] [--country] [--department]` | Update a customer (only given fields change) |
20
22
  | `bonbox invoices ls [--status created\|paid] [--quotes]` | List invoices or quotes |
21
23
  | `bonbox invoices create --customer <name-or-id> --item "…"` | Create an invoice or quote |
24
+ | `bonbox invoices update <number-or-id> [--customer] [--item "…"] [--date] [--payment-days] [--currency] [--language] [--subtitle] [--reference] [--vat-rate] [--custom-notes]` | Update an invoice or quote (only given fields change) |
22
25
  | `bonbox invoices pdf <number-or-id> [-o file]` | Download the PDF |
23
26
  | `bonbox invoices paid <number-or-id> [--date] [--no-receipt]` | Mark an invoice as paid |
24
27
  | `bonbox invoices unpaid <number-or-id>` | Undo a payment |
@@ -43,6 +46,30 @@ bonbox invoices create \
43
46
  `--customer` accepts an ID, an exact name, or a unique name prefix. If a prefix
44
47
  matches several customers the CLI lists them and stops.
45
48
 
49
+ ### Updating a customer
50
+
51
+ `customers update` takes the same flags as `create`, but only the flags you
52
+ pass are changed — everything else is left as-is. `--country` and
53
+ `--department` are optional fields: passing them as an empty string
54
+ (`--country ""`) clears that field. `--name`, `--address`, `--postal-code` and
55
+ `--city` are required fields and cannot be cleared this way — the API rejects
56
+ an empty value for those.
57
+
58
+ ### Updating an invoice
59
+
60
+ `invoices update <number-or-id>` accepts `--customer`, `--item`, `--date`,
61
+ `--payment-days`, `--currency`, `--language`, `--subtitle`, `--reference`,
62
+ `--vat-rate` and `--custom-notes` — only the flags you pass are changed,
63
+ everything else (including existing line items) is left as-is. There is no
64
+ `--quote` flag; whether an invoice is a quote can't be changed after creation.
65
+ Unlike `create`, `--date` has no "today by default" — omit it to leave the
66
+ invoice date untouched. `--subtitle`, `--reference`, `--custom-notes` and
67
+ `--vat-rate` are optional fields: passing them as an empty string
68
+ (`--vat-rate ""`) clears that field. Passing `--item` at all REPLACES the
69
+ entire line-item list with the given items, the same way the apps do when you
70
+ edit an invoice — it is not a way to add a single item. A paid invoice cannot
71
+ be updated; run `bonbox invoices unpaid` first.
72
+
46
73
  ### Marking an invoice paid
47
74
 
48
75
  ```bash
@@ -52,10 +79,14 @@ bonbox invoices paid 260830-001 --no-receipt
52
79
 
53
80
  ## Sign-in and session
54
81
 
55
- `bonbox login` opens a Supabase OAuth flow (PKCE) in your browser and listens on
56
- `localhost:51823` (falling back to 51824 and 51825) for the redirect. The
57
- session is stored in `~/.config/bonbox/session.json` with mode `0600`
58
- (`XDG_CONFIG_HOME` is honoured) and refreshed automatically.
82
+ `bonbox login` opens the bonbox web sign-in page (`app.bonbox.io/login`) in your
83
+ browser, tagged with a one-time port and state, and listens on `localhost:51823`
84
+ (falling back to 51824 and 51825) for the result. Sign in there however you like
85
+ — Google, Apple, or email + password — then confirm "Continue as …"; the page
86
+ hands the session tokens back to the CLI's local listener via a redirect, and
87
+ the CLI adopts them with `supabase.auth.setSession(...)`. The session is stored
88
+ in `~/.config/bonbox/session.json` with mode `0600` (`XDG_CONFIG_HOME` is
89
+ honoured) and refreshed automatically.
59
90
 
60
91
  ## Exit codes
61
92