@curviate/cli 0.4.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/CHANGELOG.md CHANGED
@@ -8,6 +8,24 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.5.0] - 2026-06-29
12
+
13
+ ### Added
14
+
15
+ - `message inmail --surface classic` — send an InMail from the account's own premium
16
+ InMail credits (in addition to `sales_nav` and `recruiter`). Use this to reach an
17
+ out-of-network member from a LinkedIn Premium/Core account.
18
+ - `message inmail --to` now accepts a member **provider id** (`ACoAAA…`) as well as a
19
+ member URN (`urn:li:member:<id>`). The server resolves the recipient either way.
20
+
21
+ ## [0.4.1] - 2026-06-29
22
+
23
+ ### Changed
24
+
25
+ - Updated `@curviate/sdk` dependency to `^0.2.1`, which fixes `message delete` and
26
+ `message react` failing with an unexpected `account_id` parameter rejection. The SDK
27
+ now correctly omits `account_id` for those two operations.
28
+
11
29
  ## [0.4.0] - 2026-06-28
12
30
 
13
31
  ### Added
@@ -11,10 +11,10 @@ import {
11
11
  renderSuccess,
12
12
  renderUnexpectedError,
13
13
  resolveEffectiveConfig
14
- } from "./chunk-UPNQPAJG.js";
14
+ } from "./chunk-U6ACUNLU.js";
15
15
  import {
16
16
  GLOBAL_FLAGS
17
- } from "./chunk-QQRTODHN.js";
17
+ } from "./chunk-52RZLSWP.js";
18
18
 
19
19
  // src/commands/account.ts
20
20
  import { defineCommand } from "citty";
@@ -187,6 +187,16 @@ var GLOBAL_FLAGS = {
187
187
  default: false
188
188
  }
189
189
  };
190
+ var WRITE_FLAGS = {
191
+ "api-key": GLOBAL_FLAGS["api-key"],
192
+ profile: GLOBAL_FLAGS.profile,
193
+ account: GLOBAL_FLAGS.account,
194
+ "base-url": GLOBAL_FLAGS["base-url"],
195
+ timeout: GLOBAL_FLAGS.timeout,
196
+ json: GLOBAL_FLAGS.json,
197
+ preview: GLOBAL_FLAGS.preview,
198
+ verbose: GLOBAL_FLAGS.verbose
199
+ };
190
200
 
191
201
  export {
192
202
  getConfigPath,
@@ -196,5 +206,6 @@ export {
196
206
  renameProfile,
197
207
  removeProfile,
198
208
  updateProfileField,
199
- GLOBAL_FLAGS
209
+ GLOBAL_FLAGS,
210
+ WRITE_FLAGS
200
211
  };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readConfig
4
- } from "./chunk-QQRTODHN.js";
4
+ } from "./chunk-52RZLSWP.js";
5
5
 
6
6
  // src/lib/resolve.ts
7
7
  var DEFAULT_BASE_URL = "https://api.curviate.com";
package/dist/cli.js CHANGED
@@ -134,22 +134,22 @@ var main = defineCommand({
134
134
  // Subcommand registry — names and descriptions are static for help rendering;
135
135
  // the handler implementation is loaded lazily on first invocation.
136
136
  subCommands: {
137
- login: () => import("./login-PUTCMS5B.js").then((m) => m.loginCommand),
138
- config: () => import("./config-E2XQNLSX.js").then((m) => m.configCommand),
137
+ login: () => import("./login-UJQGIP7S.js").then((m) => m.loginCommand),
138
+ config: () => import("./config-6PNGYL5E.js").then((m) => m.configCommand),
139
139
  // ---------------------------------------------------------------------------
140
140
  // Noun groups — lazy-loaded on first invocation.
141
141
  // ---------------------------------------------------------------------------
142
- profile: () => import("./profile-KVTWLH7X.js").then((m) => m.profileCommand),
143
- company: () => import("./company-FHNHF2WQ.js").then((m) => m.companyCommand),
144
- connect: () => import("./connect-LRYVZCN6.js").then((m) => m.connectCommand),
145
- search: () => import("./search-ZPGKDJIT.js").then((m) => m.searchCommand),
146
- inbox: () => import("./inbox-O4ZETUIU.js").then((m) => m.inboxCommand),
147
- message: () => import("./message-A3XMZCQA.js").then((m) => m.messageCommand),
148
- post: () => import("./post-HOXZPFVI.js").then((m) => m.postCommand),
149
- account: () => import("./account-3I63RFVN.js").then((m) => m.accountCommand),
150
- webhook: () => import("./webhook-VSM72KL5.js").then((m) => m.webhookCommand),
151
- "sales-nav": () => import("./sales-nav-E3TH7CL7.js").then((m) => m.salesNavCommand),
152
- recruiter: () => import("./recruiter-7SE3YCVZ.js").then((m) => m.recruiterCommand)
142
+ profile: () => import("./profile-CUVVESMY.js").then((m) => m.profileCommand),
143
+ company: () => import("./company-4MUABENR.js").then((m) => m.companyCommand),
144
+ connect: () => import("./connect-ZXD7P5CA.js").then((m) => m.connectCommand),
145
+ search: () => import("./search-M4WK3PDC.js").then((m) => m.searchCommand),
146
+ inbox: () => import("./inbox-ME4TXGFV.js").then((m) => m.inboxCommand),
147
+ message: () => import("./message-O7QN2L6Q.js").then((m) => m.messageCommand),
148
+ post: () => import("./post-VDQF23WS.js").then((m) => m.postCommand),
149
+ account: () => import("./account-47TRPUKL.js").then((m) => m.accountCommand),
150
+ webhook: () => import("./webhook-2SSNW25K.js").then((m) => m.webhookCommand),
151
+ "sales-nav": () => import("./sales-nav-UL2H6J6V.js").then((m) => m.salesNavCommand),
152
+ recruiter: () => import("./recruiter-QKJKOWD7.js").then((m) => m.recruiterCommand)
153
153
  },
154
154
  async run() {
155
155
  const { runMain } = await import("citty");
@@ -11,10 +11,10 @@ import {
11
11
  renderSuccess,
12
12
  renderUnexpectedError,
13
13
  resolveEffectiveConfig
14
- } from "./chunk-UPNQPAJG.js";
14
+ } from "./chunk-U6ACUNLU.js";
15
15
  import {
16
16
  GLOBAL_FLAGS
17
- } from "./chunk-QQRTODHN.js";
17
+ } from "./chunk-52RZLSWP.js";
18
18
 
19
19
  // src/commands/company.ts
20
20
  import { defineCommand } from "citty";
@@ -7,7 +7,7 @@ import {
7
7
  renameProfile,
8
8
  setActiveProfile,
9
9
  updateProfileField
10
- } from "./chunk-QQRTODHN.js";
10
+ } from "./chunk-52RZLSWP.js";
11
11
 
12
12
  // src/commands/config.ts
13
13
  import { defineCommand } from "citty";
@@ -14,10 +14,10 @@ import {
14
14
  renderSuccess,
15
15
  renderUnexpectedError,
16
16
  resolveEffectiveConfig
17
- } from "./chunk-UPNQPAJG.js";
17
+ } from "./chunk-U6ACUNLU.js";
18
18
  import {
19
19
  GLOBAL_FLAGS
20
- } from "./chunk-QQRTODHN.js";
20
+ } from "./chunk-52RZLSWP.js";
21
21
 
22
22
  // src/commands/connect.ts
23
23
  import { defineCommand } from "citty";
@@ -8,10 +8,10 @@ import {
8
8
  renderSuccess,
9
9
  renderUnexpectedError,
10
10
  resolveEffectiveConfig
11
- } from "./chunk-UPNQPAJG.js";
11
+ } from "./chunk-U6ACUNLU.js";
12
12
  import {
13
13
  GLOBAL_FLAGS
14
- } from "./chunk-QQRTODHN.js";
14
+ } from "./chunk-52RZLSWP.js";
15
15
 
16
16
  // src/commands/inbox.ts
17
17
  import { defineCommand } from "citty";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GLOBAL_FLAGS,
4
4
  writeProfile
5
- } from "./chunk-QQRTODHN.js";
5
+ } from "./chunk-52RZLSWP.js";
6
6
 
7
7
  // src/commands/login.ts
8
8
  import { defineCommand } from "citty";
@@ -19,10 +19,10 @@ import {
19
19
  renderSuccess,
20
20
  renderUnexpectedError,
21
21
  resolveEffectiveConfig
22
- } from "./chunk-UPNQPAJG.js";
22
+ } from "./chunk-U6ACUNLU.js";
23
23
  import {
24
24
  GLOBAL_FLAGS
25
- } from "./chunk-QQRTODHN.js";
25
+ } from "./chunk-52RZLSWP.js";
26
26
 
27
27
  // src/commands/message.ts
28
28
  import { defineCommand } from "citty";
@@ -62,8 +62,9 @@ function normalizeAttachPaths(attach) {
62
62
  if (!attach) return [];
63
63
  return Array.isArray(attach) ? attach : [attach];
64
64
  }
65
- var INMAIL_SURFACES = ["sales_nav", "recruiter"];
65
+ var INMAIL_SURFACES = ["sales_nav", "recruiter", "classic"];
66
66
  var MEMBER_URN_RE = /^urn:li:member:\d+$/;
67
+ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{16,}$/;
67
68
  async function handleSdkError(err, outOpts, out) {
68
69
  const { CurviateError } = await import("@curviate/sdk");
69
70
  if (err instanceof CurviateError) {
@@ -279,9 +280,9 @@ async function runMessageInMail(client, flags, out) {
279
280
  process.exit(2);
280
281
  }
281
282
  const recipientUrn = resolveIdentifier(flags.to ?? "");
282
- if (!MEMBER_URN_RE.test(recipientUrn)) {
283
+ if (!MEMBER_URN_RE.test(recipientUrn) && !MEMBER_PROVIDER_ID_RE.test(recipientUrn)) {
283
284
  out.stderr.write(
284
- "error: --to must be a LinkedIn member URN (e.g. urn:li:member:99999), not a URL or slug.\n"
285
+ "error: --to must be a LinkedIn member URN (e.g. urn:li:member:99999) or a member provider id (e.g. ACoAAA\u2026), not a URL or slug.\n"
285
286
  );
286
287
  process.exit(2);
287
288
  }
@@ -484,8 +485,8 @@ var messageInMailCommand = defineCommand({
484
485
  meta: { name: "inmail", description: "Send an InMail to a member." },
485
486
  args: {
486
487
  ...GLOBAL_FLAGS,
487
- to: { type: "string", description: "Recipient member URN (urn:li:member:<id>). Must be a URN, not a URL or slug.", required: true },
488
- surface: { type: "string", description: "InMail surface: sales_nav or recruiter.", required: true },
488
+ to: { type: "string", description: "Recipient member URN (urn:li:member:<id>) or provider id (ACoAAA\u2026). Not a URL or slug.", required: true },
489
+ surface: { type: "string", description: "InMail surface: sales_nav, recruiter, or classic (classic uses the account's own premium InMail credits).", required: true },
489
490
  subject: { type: "string", description: "InMail subject line.", required: true },
490
491
  text: { type: "positional", description: "InMail body text." }
491
492
  },
@@ -15,13 +15,15 @@ import {
15
15
  renderSuccess,
16
16
  renderUnexpectedError,
17
17
  resolveEffectiveConfig
18
- } from "./chunk-UPNQPAJG.js";
18
+ } from "./chunk-U6ACUNLU.js";
19
19
  import {
20
- GLOBAL_FLAGS
21
- } from "./chunk-QQRTODHN.js";
20
+ GLOBAL_FLAGS,
21
+ WRITE_FLAGS
22
+ } from "./chunk-52RZLSWP.js";
22
23
 
23
24
  // src/commands/post.ts
24
25
  import { defineCommand } from "citty";
26
+ var VALID_REACTIONS = /* @__PURE__ */ new Set(["like", "celebrate", "support", "love", "insightful", "funny"]);
25
27
  function buildOutputStreams() {
26
28
  return {
27
29
  stdout: { write: (s) => process.stdout.write(s) },
@@ -183,6 +185,7 @@ async function runPostComment(client, flags, out) {
183
185
  const accountId = requireAccount(flags.account, out);
184
186
  const postId = flags.postId ?? "";
185
187
  const text = flags.text ?? "";
188
+ const replyTo = flags["reply-to"];
186
189
  const attachPaths = normalizeAttachPaths(flags.attach);
187
190
  let attachBuffers = [];
188
191
  try {
@@ -195,11 +198,13 @@ async function runPostComment(client, flags, out) {
195
198
  }
196
199
  throw err;
197
200
  }
201
+ const body = { text };
202
+ if (replyTo) body["comment_id"] = replyTo;
198
203
  if (flags.preview) {
199
204
  const preview = buildPreviewOutput({
200
205
  method: "posts.comment",
201
206
  args: { post_id: postId },
202
- body: { text },
207
+ body,
203
208
  account: accountId,
204
209
  attachments: attachBuffers.map((buf, i) => ({
205
210
  name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
@@ -209,7 +214,6 @@ async function runPostComment(client, flags, out) {
209
214
  out.stdout.write(JSON.stringify(preview) + "\n");
210
215
  return;
211
216
  }
212
- const body = { text };
213
217
  if (attachBuffers.length > 0) {
214
218
  body["attachments"] = attachBuffers;
215
219
  }
@@ -231,6 +235,7 @@ async function runPostComments(client, flags, out) {
231
235
  const all = flags.all ?? false;
232
236
  const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
233
237
  const params = buildPaginationParams(flags);
238
+ if (flags["reply-to"]) params["comment_id"] = flags["reply-to"];
234
239
  try {
235
240
  if (all) {
236
241
  const fn = (p) => ns.posts.listComments(postId, p);
@@ -252,11 +257,24 @@ async function runPostReact(client, flags, out) {
252
257
  const accountId = requireAccount(flags.account, out);
253
258
  const postId = flags.postId ?? "";
254
259
  const reaction = flags.reaction ?? "";
260
+ if (!VALID_REACTIONS.has(reaction)) {
261
+ out.stderr.write(
262
+ `error: --reaction must be one of: like, celebrate, support, love, insightful, funny. Got: "${reaction}"
263
+ `
264
+ );
265
+ process.exit(2);
266
+ return;
267
+ }
268
+ const commentId = flags["comment-id"];
269
+ const asOrganization = flags["as-organization"];
270
+ const body = { reaction };
271
+ if (commentId) body["comment_id"] = commentId;
272
+ if (asOrganization) body["as_organization"] = asOrganization;
255
273
  if (flags.preview) {
256
274
  const preview = buildPreviewOutput({
257
275
  method: "posts.react",
258
276
  args: { post_id: postId },
259
- body: { reaction },
277
+ body,
260
278
  account: accountId
261
279
  });
262
280
  out.stdout.write(JSON.stringify(preview) + "\n");
@@ -265,7 +283,7 @@ async function runPostReact(client, flags, out) {
265
283
  const ns = client.account(accountId);
266
284
  const outOpts = resolveOutputOpts(flags);
267
285
  try {
268
- const result = await ns.posts.react(postId, { reaction });
286
+ const result = await ns.posts.react(postId, body);
269
287
  renderSuccess(result, outOpts, out);
270
288
  } catch (err) {
271
289
  await handleSdkError(err, outOpts, out);
@@ -319,10 +337,13 @@ var postListCommand = defineCommand({
319
337
  }
320
338
  });
321
339
  var postGetCommand = defineCommand({
322
- meta: { name: "get", description: "Get a post by ID." },
340
+ meta: { name: "get", description: "Get a post by id." },
323
341
  args: {
324
342
  ...GLOBAL_FLAGS,
325
- postId: { type: "positional", description: "Post social_id or URN." }
343
+ postId: {
344
+ type: "positional",
345
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id. To list replies to a comment, use 'post comments <post_id> --reply-to <comment_id>'."
346
+ }
326
347
  },
327
348
  async run({ args }) {
328
349
  const flags = args;
@@ -345,10 +366,17 @@ var postGetCommand = defineCommand({
345
366
  var postCreateCommand = defineCommand({
346
367
  meta: { name: "create", description: "Create a new post." },
347
368
  args: {
348
- ...GLOBAL_FLAGS,
369
+ // Write command: WRITE_FLAGS omits pagination/projection flags
370
+ ...WRITE_FLAGS,
349
371
  text: { type: "positional", description: "Post body text." },
350
- attach: { type: "string", description: "File to attach (repeatable)." },
351
- "video-thumbnail": { type: "string", description: "Video thumbnail file." }
372
+ attach: {
373
+ type: "string",
374
+ description: "Image/video/document to attach (repeatable for images; use --video-thumbnail when attaching a video). Supported: jpg, png, gif, mp4, pdf."
375
+ },
376
+ "video-thumbnail": {
377
+ type: "string",
378
+ description: "Thumbnail image for a video attachment (required when attaching a video post)."
379
+ }
352
380
  },
353
381
  async run({ args }) {
354
382
  const flags = args;
@@ -369,12 +397,20 @@ var postCreateCommand = defineCommand({
369
397
  }
370
398
  });
371
399
  var postCommentCommand = defineCommand({
372
- meta: { name: "comment", description: "Comment on a post." },
400
+ meta: { name: "comment", description: "Comment on a post, or reply to a comment with --reply-to." },
373
401
  args: {
374
- ...GLOBAL_FLAGS,
375
- postId: { type: "positional", description: "Post social_id or URN." },
376
- text: { type: "positional", description: "Comment text." },
377
- attach: { type: "string", description: "Image to attach (optional)." }
402
+ // Write command: WRITE_FLAGS omits pagination/projection flags
403
+ ...WRITE_FLAGS,
404
+ postId: {
405
+ type: "positional",
406
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; use --reply-to <comment_id> to reply to a specific comment within this post."
407
+ },
408
+ text: { type: "positional", description: "Comment text (max ~1,250 characters per LinkedIn limits)." },
409
+ attach: { type: "string", description: "Image to attach to the comment (optional; one image per comment)." },
410
+ "reply-to": {
411
+ type: "string",
412
+ description: "Post as a reply to this comment id (omit for a top-level comment on the post)."
413
+ }
378
414
  },
379
415
  async run({ args }) {
380
416
  const flags = args;
@@ -395,10 +431,17 @@ var postCommentCommand = defineCommand({
395
431
  }
396
432
  });
397
433
  var postCommentsCommand = defineCommand({
398
- meta: { name: "comments", description: "List comments on a post." },
434
+ meta: { name: "comments", description: "List comments on a post. Use --reply-to to fetch replies to a specific comment." },
399
435
  args: {
400
436
  ...GLOBAL_FLAGS,
401
- postId: { type: "positional", description: "Post social_id or URN." }
437
+ postId: {
438
+ type: "positional",
439
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; to fetch replies to a comment, use --reply-to <comment_id>."
440
+ },
441
+ "reply-to": {
442
+ type: "string",
443
+ description: "Filter replies under this comment id (omit to list top-level comments on the post)."
444
+ }
402
445
  },
403
446
  async run({ args }) {
404
447
  const flags = args;
@@ -419,11 +462,27 @@ var postCommentsCommand = defineCommand({
419
462
  }
420
463
  });
421
464
  var postReactCommand = defineCommand({
422
- meta: { name: "react", description: "React to a post." },
465
+ meta: { name: "react", description: "React to a post or comment." },
423
466
  args: {
424
- ...GLOBAL_FLAGS,
425
- postId: { type: "positional", description: "Post social_id or URN." },
426
- reaction: { type: "string", description: "Reaction type (like | celebrate | support | love | insightful | funny).", required: true }
467
+ // Write command: WRITE_FLAGS omits pagination/projection flags
468
+ ...WRITE_FLAGS,
469
+ postId: {
470
+ type: "positional",
471
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id; to react to a comment within the post, use --comment-id <comment_id>."
472
+ },
473
+ reaction: {
474
+ type: "string",
475
+ required: true,
476
+ description: "Write-side reaction (lowercase). Write values: like, celebrate, support, love, insightful, funny. Read-side vocabulary (in the value and user_reacted response fields): LIKE, PRAISE, APPRECIATION, EMPATHY, INTEREST, ENTERTAINMENT. Confirmed write\u2192read mappings: like=LIKE, celebrate=PRAISE, insightful=INTEREST. (support, love, and funny are valid write values; their read-side pairings are unconfirmed.)"
477
+ },
478
+ "comment-id": {
479
+ type: "string",
480
+ description: "React to this specific comment id within the post (omit to react to the post itself)."
481
+ },
482
+ "as-organization": {
483
+ type: "string",
484
+ description: "React on behalf of an organization page (org id from 'profile me' organizations)."
485
+ }
427
486
  },
428
487
  async run({ args }) {
429
488
  const flags = args;
@@ -447,7 +506,10 @@ var postReactionsCommand = defineCommand({
447
506
  meta: { name: "reactions", description: "List reactions on a post." },
448
507
  args: {
449
508
  ...GLOBAL_FLAGS,
450
- postId: { type: "positional", description: "Post social_id or URN." }
509
+ postId: {
510
+ type: "positional",
511
+ description: "Numeric post id, urn:li:activity:N, or full LinkedIn share URL (activity-<N>- extracted). POSTID is always the post's id."
512
+ }
451
513
  },
452
514
  async run({ args }) {
453
515
  const flags = args;
@@ -480,7 +542,7 @@ var postCommand = defineCommand({
480
542
  },
481
543
  async run() {
482
544
  process.stderr.write(
483
- 'Usage: curviate post <subcommand>\n list\n get <post_id>\n create "<text>" [--attach <file>\u2026] [--video-thumbnail <file>]\n comment <post_id> "<text>" [--attach <file>]\n comments <post_id>\n react <post_id> --reaction <r>\n reactions <post_id>\n'
545
+ 'Usage: curviate post <subcommand>\n list\n get <post_id>\n create "<text>" [--attach <file>\u2026] [--video-thumbnail <file>]\n comment <post_id> "<text>" [--attach <file>] [--reply-to <comment_id>]\n comments <post_id> [--reply-to <comment_id>]\n react <post_id> --reaction <r> [--comment-id <comment_id>] [--as-organization <org_id>]\n reactions <post_id>\n'
484
546
  );
485
547
  }
486
548
  });
@@ -18,10 +18,10 @@ import {
18
18
  renderSuccess,
19
19
  renderUnexpectedError,
20
20
  resolveEffectiveConfig
21
- } from "./chunk-UPNQPAJG.js";
21
+ } from "./chunk-U6ACUNLU.js";
22
22
  import {
23
23
  GLOBAL_FLAGS
24
- } from "./chunk-QQRTODHN.js";
24
+ } from "./chunk-52RZLSWP.js";
25
25
 
26
26
  // src/commands/profile.ts
27
27
  import { defineCommand } from "citty";
@@ -60,7 +60,10 @@ function resolveOutputOpts(flags) {
60
60
  }
61
61
  async function runProfileMe(client, flags, out) {
62
62
  rejectPreviewOnRead(flags.preview, out);
63
- rejectAllOnNonPaginated(flags.all, out);
63
+ const hasActivityFlag = !!(flags.posts || flags.comments || flags.reactions || flags.followers);
64
+ if (!hasActivityFlag) {
65
+ rejectAllOnNonPaginated(flags.all, out);
66
+ }
64
67
  if (flags.sections === "") {
65
68
  out.stderr.write("error: --sections must not be empty. Omit the flag or provide section names.\n");
66
69
  process.exit(2);
@@ -68,19 +71,94 @@ async function runProfileMe(client, flags, out) {
68
71
  }
69
72
  const accountId = requireAccount(flags.account, out);
70
73
  const ns = client.account(accountId);
74
+ const outOpts = resolveOutputOpts(flags);
75
+ if (hasActivityFlag) {
76
+ const all = flags.all ?? false;
77
+ const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
78
+ const params2 = {};
79
+ if (flags.limit) params2["limit"] = parseInt(flags.limit, 10);
80
+ if (flags.cursor) params2["cursor"] = flags.cursor;
81
+ try {
82
+ const meResult = await ns.profiles.getMe({});
83
+ const ownSlug = meResult["public_identifier"];
84
+ if (flags.posts) {
85
+ if (all) {
86
+ const fn = (p) => ns.profiles.listPosts(ownSlug, p);
87
+ for await (const item of streamAll(fn, params2, {
88
+ maxPages,
89
+ onTruncated: (msg) => out.stderr.write(msg + "\n")
90
+ })) {
91
+ out.stdout.write(JSON.stringify(item) + "\n");
92
+ }
93
+ } else {
94
+ const result = await ns.profiles.listPosts(ownSlug, params2);
95
+ renderSuccess(result, outOpts, out);
96
+ }
97
+ } else if (flags.comments) {
98
+ if (all) {
99
+ const fn = (p) => ns.profiles.listComments(ownSlug, p);
100
+ for await (const item of streamAll(fn, params2, {
101
+ maxPages,
102
+ onTruncated: (msg) => out.stderr.write(msg + "\n")
103
+ })) {
104
+ out.stdout.write(JSON.stringify(item) + "\n");
105
+ }
106
+ } else {
107
+ const result = await ns.profiles.listComments(ownSlug, params2);
108
+ renderSuccess(result, outOpts, out);
109
+ }
110
+ } else if (flags.reactions) {
111
+ if (all) {
112
+ const fn = (p) => ns.profiles.listReactions(ownSlug, p);
113
+ for await (const item of streamAll(fn, params2, {
114
+ maxPages,
115
+ onTruncated: (msg) => out.stderr.write(msg + "\n")
116
+ })) {
117
+ out.stdout.write(JSON.stringify(item) + "\n");
118
+ }
119
+ } else {
120
+ const result = await ns.profiles.listReactions(ownSlug, params2);
121
+ renderSuccess(result, outOpts, out);
122
+ }
123
+ } else if (flags.followers) {
124
+ if (all) {
125
+ const fn = (p) => ns.profiles.listFollowers(ownSlug, p);
126
+ for await (const item of streamAll(fn, params2, {
127
+ maxPages,
128
+ onTruncated: (msg) => out.stderr.write(msg + "\n")
129
+ })) {
130
+ out.stdout.write(JSON.stringify(item) + "\n");
131
+ }
132
+ } else {
133
+ const result = await ns.profiles.listFollowers(ownSlug, params2);
134
+ renderSuccess(result, outOpts, out);
135
+ }
136
+ }
137
+ } catch (err) {
138
+ const { CurviateError } = await import("@curviate/sdk");
139
+ if (err instanceof CurviateError) {
140
+ const { getExitCode } = await import("./exit-codes-NFIR57ZA.js");
141
+ renderError(err, outOpts, out);
142
+ process.exit(getExitCode(err.code));
143
+ }
144
+ renderUnexpectedError(err, out);
145
+ process.exit(1);
146
+ }
147
+ return;
148
+ }
71
149
  const params = {};
72
150
  if (flags.sections) {
73
151
  params["linkedin_sections"] = flags.sections.split(",").map((s) => s.trim()).filter(Boolean);
74
152
  }
75
153
  try {
76
154
  const result = await ns.profiles.getMe(params);
77
- const outOpts = { ...resolveOutputOpts(flags), slim: slimProfileMe };
78
- renderSuccess(result, outOpts, out);
155
+ const slimOutOpts = { ...outOpts, slim: slimProfileMe };
156
+ renderSuccess(result, slimOutOpts, out);
79
157
  } catch (err) {
80
158
  const { CurviateError } = await import("@curviate/sdk");
81
159
  if (err instanceof CurviateError) {
82
160
  const { getExitCode } = await import("./exit-codes-NFIR57ZA.js");
83
- renderError(err, resolveOutputOpts(flags), out);
161
+ renderError(err, outOpts, out);
84
162
  process.exit(getExitCode(err.code));
85
163
  }
86
164
  renderUnexpectedError(err, out);
@@ -268,12 +346,32 @@ async function runProfileEndorse(client, flags, out) {
268
346
  }
269
347
  }
270
348
  var profileMeCommand = defineCommand({
271
- meta: { name: "me", description: "Get your own LinkedIn profile." },
349
+ meta: { name: "me", description: "Get your own profile, or list own activity with --posts/--comments/--reactions/--followers." },
272
350
  args: {
273
351
  ...GLOBAL_FLAGS,
274
352
  sections: {
275
353
  type: "string",
276
- description: "Comma-separated LinkedIn sections to fetch (e.g. experience,education)."
354
+ description: "Comma-separated LinkedIn sections to fetch (e.g. experience,education). Only applies to the base getMe call (no activity flag)."
355
+ },
356
+ posts: {
357
+ type: "boolean",
358
+ description: "List own activity feed (posts + reposts). For authored-only posts, use 'post list'.",
359
+ default: false
360
+ },
361
+ comments: {
362
+ type: "boolean",
363
+ description: "List own comments.",
364
+ default: false
365
+ },
366
+ reactions: {
367
+ type: "boolean",
368
+ description: "List own reactions.",
369
+ default: false
370
+ },
371
+ followers: {
372
+ type: "boolean",
373
+ description: "List own followers.",
374
+ default: false
277
375
  }
278
376
  },
279
377
  async run({ args }) {
@@ -27,10 +27,10 @@ import {
27
27
  renderSuccess,
28
28
  renderUnexpectedError,
29
29
  resolveEffectiveConfig
30
- } from "./chunk-UPNQPAJG.js";
30
+ } from "./chunk-U6ACUNLU.js";
31
31
  import {
32
32
  GLOBAL_FLAGS
33
- } from "./chunk-QQRTODHN.js";
33
+ } from "./chunk-52RZLSWP.js";
34
34
 
35
35
  // src/commands/recruiter.ts
36
36
  import { defineCommand } from "citty";
@@ -24,10 +24,10 @@ import {
24
24
  renderSuccess,
25
25
  renderUnexpectedError,
26
26
  resolveEffectiveConfig
27
- } from "./chunk-UPNQPAJG.js";
27
+ } from "./chunk-U6ACUNLU.js";
28
28
  import {
29
29
  GLOBAL_FLAGS
30
- } from "./chunk-QQRTODHN.js";
30
+ } from "./chunk-52RZLSWP.js";
31
31
 
32
32
  // src/commands/sales-nav.ts
33
33
  import { defineCommand } from "citty";
@@ -14,10 +14,10 @@ import {
14
14
  renderSuccess,
15
15
  renderUnexpectedError,
16
16
  resolveEffectiveConfig
17
- } from "./chunk-UPNQPAJG.js";
17
+ } from "./chunk-U6ACUNLU.js";
18
18
  import {
19
19
  GLOBAL_FLAGS
20
- } from "./chunk-QQRTODHN.js";
20
+ } from "./chunk-52RZLSWP.js";
21
21
 
22
22
  // src/commands/search.ts
23
23
  import { defineCommand } from "citty";
@@ -11,10 +11,10 @@ import {
11
11
  renderSuccess,
12
12
  renderUnexpectedError,
13
13
  resolveEffectiveConfig
14
- } from "./chunk-UPNQPAJG.js";
14
+ } from "./chunk-U6ACUNLU.js";
15
15
  import {
16
16
  GLOBAL_FLAGS
17
- } from "./chunk-QQRTODHN.js";
17
+ } from "./chunk-52RZLSWP.js";
18
18
 
19
19
  // src/commands/webhook.ts
20
20
  import { defineCommand } from "citty";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "clean": "rm -rf dist *.tsbuildinfo"
41
41
  },
42
42
  "dependencies": {
43
- "@curviate/sdk": "^0.2.0",
43
+ "@curviate/sdk": "^0.3.0",
44
44
  "citty": "^0.1.6"
45
45
  },
46
46
  "devDependencies": {