@usesocial/cli 0.4.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @usesocial/cli
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#30](https://github.com/usesocial/monorepo/pull/30) [`7aefe83`](https://github.com/usesocial/monorepo/commit/7aefe83f716321d7fa10d52be67cb6f96b5474f0) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Per-collection sync with a confirm-by-credits gate, a local profiles mirror, and cache-first enriched reads.
8
+
9
+ - `social x|linkedin sync <collection>` gates spend with a single `--credits {N}` flag that is both the consent and the hard cap; bare invocations auto-run cheap syncs (≤ $5) or print a credit estimate and stop. Replaces `--billing-limit`/`--yes`/the TTY prompt, and `sync` is now a visible command.
10
+ - New `x_messages` DM collection (flat `/dm_events`) and a DM `includes.users` profile extractor. Syncs mirror participant profiles into the local cache (`x_profiles`/`li_profiles`) with a COALESCE merge so thin sources never clobber richer rows; the server `profiles` corpus merges the same way.
11
+ - `x followers|following|messages` and `linkedin connections|messages|requests` now read from the local cache, enriched with the profiles mirror. They require a first sync; `followers`/`following`/`connections` then auto-refresh only when older than 15 minutes, while `messages` and `requests sent|received` refresh on every read so they always return the latest.
12
+
13
+ ### Patch Changes
14
+
15
+ - [#30](https://github.com/usesocial/monorepo/pull/30) [`e58d6c7`](https://github.com/usesocial/monorepo/commit/e58d6c7d44dfe7cd569ac0ce6e93bd2f25765993) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Retry LinkedIn 429 responses automatically with `Retry-After` support, exponential fallback, and sync progress on stderr/spinner without changing JSON summaries.
16
+
17
+ ## 0.5.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#29](https://github.com/usesocial/monorepo/pull/29) [`f99f1b3`](https://github.com/usesocial/monorepo/commit/f99f1b3da1215c74a1044aac3aed210604562fcc) Thanks [@CyrusNuevoDia](https://github.com/CyrusNuevoDia)! - Add `social account billing` and `social account billing portal` for CLI billing status and hosted portal handoff.
22
+
3
23
  ## 0.4.0
4
24
 
5
25
  ### Minor Changes
package/README.md CHANGED
@@ -90,7 +90,7 @@ stdin; if stdin parses as JSON but is not an object, the command rejects it.
90
90
 
91
91
  | Command | Description |
92
92
  |---|---|
93
- | `social account` | Show auth state and connected accounts; login, logout, connect accounts, inspect usage/logs, and configure local CLI settings. |
93
+ | `social account` | Show auth state and connected accounts; login, logout, connect accounts, inspect billing/usage/logs, and configure local CLI settings. |
94
94
  | `social schema` | Print the compact command tree, inspect one command with `social schema "<command path>"`, or emit agent command contracts with `social schema --leaves`. |
95
95
  | `social x <…>` | X operations (below). |
96
96
  | `social linkedin <…>` | LinkedIn operations (below). |
@@ -108,6 +108,8 @@ stdin; if stdin parses as JSON but is not an object, the command rejects it.
108
108
  | `reconnect x <account>` | Re-auth an existing X account by opening or printing an OAuth URL. | ✎ write |
109
109
  | `disconnect linkedin <account>` | Disconnect a LinkedIn account. | ✎ write |
110
110
  | `disconnect x <account>` | Disconnect an X account. | ✎ write |
111
+ | `billing` | Show seats, subscription, and current usage billing. | |
112
+ | `billing portal` | Open the hosted billing portal and print its URL. | |
111
113
  | `usage` | Aggregate proxy usage and billing stats. | |
112
114
  | `logs` | Recent proxy calls. | |
113
115
  | `config cache mode` | Read or set the cache mode preset. | |
@@ -202,7 +204,7 @@ jq -r '.items[].id' /tmp/recent-posts.json \
202
204
  | `3` | Not found | Check the resource ID or pick a different item. |
203
205
  | `4` | Auth or scope error | Run `social account login`, or log out and choose the needed scope. |
204
206
  | `5` | API or unexpected error | Retry later or surface the server error. |
205
- | `7` | Rate limited | Back off; JSON errors may include `retryAfterSeconds`. |
207
+ | `7` | Rate limited | LinkedIn retries automatically; otherwise back off, using `retryAfterSeconds` when present. |
206
208
 
207
209
  ## Auth
208
210
 
@@ -227,6 +229,11 @@ namespace, verified session when available, and connected accounts.
227
229
  `social account login` requires an interactive terminal and is not supported from CI,
228
230
  background jobs, or agent-mediated setup flows.
229
231
 
232
+ `social account billing` prints the current seat/subscription snapshot plus
233
+ aggregate usage billing. `social account billing portal` opens the hosted billing
234
+ portal when possible and always prints the portal URL as JSON; use the portal for
235
+ payment methods, invoices, plan changes, seat changes, and cancellation.
236
+
230
237
  ## Cache config
231
238
 
232
239
  Allowlisted GET requests use a local proxy cache. Cacheable commands send
@@ -266,8 +273,9 @@ social linkedin messages --limit 20 | jq '{cost: .meta.cost, cursor: .meta.curso
266
273
  social x bookmarks --limit 20 | jq '{cost: .meta.cost, cursor: .meta.cursor}'
267
274
  ```
268
275
 
269
- Agents should watch `.meta.cost` during high-fanout loops and use `social account usage`
270
- or `social account logs` after a run to summarize actual spend.
276
+ Agents should watch `.meta.cost` during high-fanout loops, use `social account billing`
277
+ for the current plan snapshot, and use `social account usage` or `social account logs`
278
+ after a run to summarize actual spend.
271
279
 
272
280
  ## Account safety
273
281
 
@@ -300,6 +308,8 @@ echo "gm" | social x post
300
308
  social linkedin post < draft.md
301
309
 
302
310
  # Usage / billing
311
+ social account billing
312
+ social account billing portal
303
313
  social account usage
304
314
  social account logs --limit 20 --from 2026-05-01T00:00:00Z
305
315
 
package/dist/index.d.mts CHANGED
@@ -1199,6 +1199,7 @@ type PrintResultArgs = {
1199
1199
  data: unknown;
1200
1200
  resolved?: ResourceResolutionRecord[];
1201
1201
  responseHeaders?: Headers;
1202
+ usage?: unknown;
1202
1203
  };
1203
1204
  //#endregion
1204
1205
  //#region src/lib/ui.d.ts
@@ -1377,16 +1378,14 @@ declare const createSocialCommand: (deps?: {
1377
1378
  disconnect: any;
1378
1379
  };
1379
1380
  billing: {
1380
- status: () => Promise<{
1381
- canConnect: any;
1382
- seats: any;
1383
- }>;
1381
+ status: () => Promise<any>;
1384
1382
  prepareAccountConnect: () => Promise<{
1385
1383
  canConnect: any;
1386
1384
  paymentURL: any;
1387
1385
  requiredAction: any;
1388
1386
  seats: any;
1389
1387
  }>;
1388
+ portalURL: any;
1390
1389
  };
1391
1390
  usage: {
1392
1391
  summary: any;
@@ -1437,7 +1436,7 @@ declare const createSocialCommand: (deps?: {
1437
1436
  [k: string]: string;
1438
1437
  }>;
1439
1438
  printData: (value: unknown) => void;
1440
- printResult: (args: PrintResultArgs) => void;
1439
+ printResult: (args: PrintResultArgs) => Promise<void>;
1441
1440
  resolveAccount: ({
1442
1441
  account,
1443
1442
  platform