@go-labs-sg/bb 2.45.0 → 2.46.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 +47 -2
- package/command-manifest.json +12 -0
- package/dist/index.js +587 -245
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,14 @@ For AI agents using this CLI: do not execute mutations until the user explicitly
|
|
|
12
12
|
|
|
13
13
|
**Registry:** [`@go-labs-sg/bb`](https://www.npmjs.com/package/@go-labs-sg/bb)
|
|
14
14
|
|
|
15
|
+
## Bill and claim list summaries
|
|
16
|
+
|
|
17
|
+
`bb bill list` / `bb claim list` (legacy `list-bills` / `list-claims`) now use `bill.getList`. Lists return summary fields, `isClaimable`, `lineItemCount` and `hasPendingApproval`, plus the existing pagination, counts and metrics envelope. Filters and sorting are unchanged. They no longer return attachment, detailed line-item or approval arrays, full supplier/budget/project/company records, or detail-only payment/integration/verification metadata.
|
|
18
|
+
|
|
19
|
+
**Output migration:** scripts reading those removed fields must fetch the selected bill/claim with `bb get-bill-details <billId>`. Do not fetch details for every list row unless the task actually needs them. No rich-list flag or automatic detail expansion is added. Older clients can still call the existing `bill.getAll` API.
|
|
20
|
+
|
|
21
|
+
Deploy the API containing `bill.getList` before publishing this CLI; there is no automatic fallback to the old rich list. Budget-list options are unchanged by this bill/claim migration.
|
|
22
|
+
|
|
15
23
|
## Company discovery and reuse
|
|
16
24
|
|
|
17
25
|
`bb company search --query "a star" [--page 2]` searches stored BB companies and QuickBooks company customers, including inactive records. Results identify `bb`, `qbo`, or `both`; punctuation/spacing normalization is for suggestions only. Search does not write to either system.
|
|
@@ -63,7 +71,7 @@ See the [supplier review and rollout policy](../api/docs/supplier-edit-review.md
|
|
|
63
71
|
|
|
64
72
|
## Runtime and installation
|
|
65
73
|
|
|
66
|
-
The same CLI package
|
|
74
|
+
The same CLI package targets macOS, Windows, and Linux; authentication depends on the secure backend described below. It requires [Bun](https://bun.com/docs/installation) 1.4.0 or newer and a Budget Builder account with any active user role. Windows users can run the commands below in native PowerShell; Bash and `export PATH=...` are not required.
|
|
67
75
|
|
|
68
76
|
Check whether a compatible Bun version is already available:
|
|
69
77
|
|
|
@@ -125,6 +133,16 @@ bb get-budget-details <budget-id> --includeInactive
|
|
|
125
133
|
|
|
126
134
|
`--active false` lists inactive budgets only. `--active all` lists active and inactive budgets. `--includeInactive` allows the three budget/detail/item commands to read inactive history. If the authenticated identity is not an Admin, the API rejects the historical request before reading budget data. For `get-budget`, the CLI requests the budget and its line items concurrently; each API read independently enforces the same active-only default and Admin-only historical opt-in.
|
|
127
135
|
|
|
136
|
+
## Secure credential storage
|
|
137
|
+
|
|
138
|
+
`GO_LABS_CLI_CREDENTIAL_ACCOUNT` selects the native credential-store account for this CLI. The default is `default`, preserving existing production logins. The downloadable staging launcher sets it to `staging` so a staging login does not replace the production login; keep the same account value for login and subsequent commands. The launcher also sets `GO_LABS_CLI_SKIP_DOTENV=1`, which skips the CLI's explicit current-directory `.env` load while leaving normal production behavior unchanged.
|
|
139
|
+
|
|
140
|
+
Browser sessions use `Bun.secrets`: macOS Keychain, Windows Credential Manager, or Linux Secret Service. Linux requires libsecret, a reachable user D-Bus session, and an unlocked Secret Service collection. SSH and containers must provide those native prerequisites themselves; `--no-browser` only lets approval happen on another device. Denied D-Bus access is a host permissions/session issue, not something the CLI bypasses.
|
|
141
|
+
|
|
142
|
+
Before requesting approval, login verifies write/read/delete capability with a unique non-secret probe. Native operations have a 10-second process deadline and sanitized errors. Issued credentials are read back and verified; failed persistence attempts remote revocation and reports local and remote cleanup separately. There is no plaintext fallback or external credential-helper configuration.
|
|
143
|
+
|
|
144
|
+
See the [shared authentication contract](../../cli-auth/README.md) for recovery and verification limits.
|
|
145
|
+
|
|
128
146
|
## Authentication
|
|
129
147
|
|
|
130
148
|
Interactive users authorize the CLI through Budget Builder's normal Google-backed
|
|
@@ -142,7 +160,7 @@ credentials through `Bun.secrets`. It never stores Google credentials. Use
|
|
|
142
160
|
`bb auth logout` to revoke the interactive session. For SSH or containers, pass
|
|
143
161
|
`--no-browser` and open the printed URL on another device.
|
|
144
162
|
|
|
145
|
-
Credentials use macOS Keychain
|
|
163
|
+
Credentials use macOS Keychain, Windows Credential Manager, or Linux Secret Service, not plaintext files.
|
|
146
164
|
The per-user lock directory contains only random ownership markers used to serialize
|
|
147
165
|
login, refresh, and logout. macOS/Linux enforce owner-only POSIX permissions there;
|
|
148
166
|
Windows uses its native filesystem access controls rather than POSIX mode checks.
|
|
@@ -164,6 +182,16 @@ only. Revoking the key currently stored in `BB_API_KEY` causes that automation
|
|
|
164
182
|
process to fail until the environment credential is replaced or removed so the
|
|
165
183
|
interactive session can be used.
|
|
166
184
|
|
|
185
|
+
`bb user api-key list` and the `mcpApiKey.list` API retain the nullable
|
|
186
|
+
`lastUsedAt` field for compatibility (an ISO timestamp in CLI JSON). Interpret
|
|
187
|
+
only its calendar date in `Asia/Singapore` (UTC+08:00): it records the first
|
|
188
|
+
successful usage touch of that day, **not the most recent request time**.
|
|
189
|
+
Null means no use has been recorded; pre-rollout values may represent any use
|
|
190
|
+
on their recorded day. Do not use the time portion for inactivity timeouts,
|
|
191
|
+
minute-level mutation attribution, or request auditing. Authentication still
|
|
192
|
+
reads the key and current user ban status on every request; revocation does
|
|
193
|
+
not cancel requests already in flight.
|
|
194
|
+
|
|
167
195
|
Admins can provision API-only service identities and manage their keys from the
|
|
168
196
|
CLI. These identities are not human web accounts: `create-user` does not create
|
|
169
197
|
or link a Google OAuth account, so the resulting user cannot sign in with Google.
|
|
@@ -440,6 +468,23 @@ bb quotation create --payload '{
|
|
|
440
468
|
Use the same fields for `bb quotation update --payload`, adding the existing quotation `"id": "<quotation-id>"`. Read the quotation and its budget before updating so the IDs and current status are confirmed. The example's subtotal is S$1,200, GST is S$0, and total is S$1,200; those values are illustrative only and contain no live resource IDs.
|
|
441
469
|
|
|
442
470
|
|
|
471
|
+
### Budget version history (pagination contract change)
|
|
472
|
+
|
|
473
|
+
`bb budget version list <budgetId>` now returns **one page**, not the full history array. The normal CLI envelope contains `data: { versions, nextCursor }`; legacy aliases `get-budget-versions` and `get_budget_versions` return that page object directly. Update scripts that previously iterated the top-level array to iterate `versions` and explicitly request older pages when needed.
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
bb budget version list <budgetId>
|
|
477
|
+
bb budget version list <budgetId> --limit 20 --cursor <nextCursor>
|
|
478
|
+
bb budget version list <budgetId> --all
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
- Default page size: 20; `--limit` accepts integers from 1 to 50.
|
|
482
|
+
- `nextCursor: null` means no older visible versions. Otherwise pass it as `--cursor` for the next page; do not automatically drain history for ordinary browsing.
|
|
483
|
+
- `--all` explicitly collects all visible history through sequential bounded requests. It cannot be combined with `--cursor`; `--limit` controls each request's size. It can still be expensive and retains the complete result in memory. A failed page aborts without emitting a successful partial export.
|
|
484
|
+
- Pages preserve newest-first `createdAt`/`id` ordering, role visibility, and creator/version-group metadata. They are not a point-in-time database snapshot; versions added after traversal starts require a fresh first-page read, and concurrent changes to visibility can affect traversal.
|
|
485
|
+
|
|
486
|
+
The backend must expose `budgetVersion.getBudgetVersionsPage`. The legacy unbounded tRPC `getBudgetVersions` remains available but deprecated for external compatibility; unknown external clients are not silently capped. Removing that endpoint requires a separate usage/compatibility review. This change does not publish the CLI, deploy the backend/MCP server, delete audit snapshots, or establish measured RU savings.
|
|
487
|
+
|
|
443
488
|
### Link an existing QuickBooks invoice
|
|
444
489
|
|
|
445
490
|
**Release status:** these CLI commands are pending release. The repository package version remains `2.31.0`; that version number alone does not establish that a published CLI contains them. Check `bb help` for `customer-invoice preview-qbo` and `customer-invoice import-qbo` after the normal CLI release. This code delivery does not publish the CLI, deploy the API, or perform a production import. The backend must expose `customerInvoice.previewExistingInvoice` and `customerInvoice.linkExistingInvoice` (implemented in PR #1067).
|
package/command-manifest.json
CHANGED
|
@@ -606,6 +606,18 @@
|
|
|
606
606
|
{
|
|
607
607
|
"name": "--allow-financial-write",
|
|
608
608
|
"description": "Allow financial-record changes in non-interactive use."
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"name": "--limit <1-50>",
|
|
612
|
+
"description": "Versions per page (default 20). Returns versions and nextCursor, not a full-history array."
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"name": "--cursor <versionId>",
|
|
616
|
+
"description": "Load the next page using the previous nextCursor; null means complete."
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"name": "--all",
|
|
620
|
+
"description": "Explicitly fetch all visible history in bounded pages; cannot combine with --cursor. May be expensive."
|
|
609
621
|
}
|
|
610
622
|
],
|
|
611
623
|
"argumentMode": "legacy-passthrough",
|