@audienti/cli 0.1.9 → 0.1.10

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
@@ -4,6 +4,13 @@ All notable changes to the Audienti CLI are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.10] - 2026-07-15
8
+
9
+ ### Added
10
+
11
+ - Add `audienti motions update <motn_id> --status <draft|preparing|active|paused|archived>` plus `activate`, `pause`, and `archive` shortcuts for motion/play lifecycle status management.
12
+ - Add `audienti motions delete <motn_id> --confirm <yes|true|Y|y>` to delete a motion/play through the API cleanup path.
13
+
7
14
  ## [0.1.9] - 2026-07-15
8
15
 
9
16
  ### Added
package/README.md CHANGED
@@ -54,6 +54,9 @@ Common inspection commands:
54
54
  audienti operator next --plan
55
55
  audienti writer test-run <prsp_id>
56
56
  audienti motions analytics <motn_id>
57
+ audienti motions update <motn_id> --status paused
58
+ audienti motions activate <motn_id>
59
+ audienti motions delete <motn_id> --confirm yes
57
60
  audienti prospects show <prsp_id> --json
58
61
  audienti prospects list --profiles
59
62
  audienti prospects list --assigned-user unassigned
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audienti/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Agent-first command-line client for Audienti.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -56,6 +56,9 @@ audienti prospects assign <prsp_id> --assigned-user me --json
56
56
  audienti users activity me --window 7d --json
57
57
  audienti prospects import-batch --file prospects.csv --motion <motn_id> --assigned-user me --json
58
58
  audienti lists create --name "Target list" --json
59
+ audienti motions update <motn_id> --status paused --json
60
+ audienti motions activate <motn_id> --json
61
+ audienti motions delete <motn_id> --confirm yes --json
59
62
  audienti operator next --json
60
63
  audienti operator next --plan
61
64
  audienti analytics prospects --window 24h --json
package/src/api-client.js CHANGED
@@ -134,6 +134,19 @@ export class AudientiClient {
134
134
  });
135
135
  }
136
136
 
137
+ updateMotion(accountId, motionId, body) {
138
+ return this.requestJson(accountPath(accountId, ["motions", motionId]), {
139
+ method: "PATCH",
140
+ body
141
+ });
142
+ }
143
+
144
+ deleteMotion(accountId, motionId) {
145
+ return this.requestJson(accountPath(accountId, ["motions", motionId]), {
146
+ method: "DELETE"
147
+ });
148
+ }
149
+
137
150
  cloneMotion(accountId, motionId, body) {
138
151
  return this.requestJson(accountPath(accountId, ["motions", motionId, "clone"]), {
139
152
  method: "POST",
package/src/cli.js CHANGED
@@ -25,6 +25,7 @@ const DEFAULT_PROFILE_IDENTIFIERS = [
25
25
  "email/profile"
26
26
  ];
27
27
  const DELETE_CONFIRMATION_VALUES = new Set(["yes", "true", "y"]);
28
+ const MOTION_STATUS_VALUES = new Set(["draft", "preparing", "active", "paused", "archived"]);
28
29
  const PROSPECTS_ADD_NOTE_USAGE = "Usage: audienti prospects add-note <prsp_id> (--message <text> [--type <note|steer|voicemail_outreach|video_outreach>] [--engagement-type <key>] | --payload <file.json>) [--json] [--account <acct_id>]";
29
30
  const PROSPECTS_ADD_STEER_USAGE = "Usage: audienti prospects add-steer <prsp_id> (--message <text> [--engagement-type <key>] | --payload <file.json>) [--json] [--account <acct_id>]";
30
31
  const PROSPECTS_ADD_PROFILE_USAGE = "Usage: audienti prospects add-profile <prsp_id> --url <profile_url|email|phone> [--json] [--account <acct_id>]";
@@ -34,6 +35,8 @@ const PROSPECTS_IMPORT_BATCH_USAGE = "Usage: audienti prospects import-batch --f
34
35
  const USERS_ACTIVITY_USAGE = "Usage: audienti users activity <account_user_id|me> [--mode <actor|account_usage>] [--window <24h|7d|30d>] [--platform <linkedin|email|gmail>] [--query <text>] [--limit <n>] [--page <n>] [--json] [--account <acct_id>]";
35
36
  const WRITER_TEST_RUN_USAGE = "Usage: audienti writer test-run <prsp_id> [--json] [--mode <report|plan|step>] [--branch <both|no-accept|accepted>] [--step <step_key|row_number>] [--no-cache] [--clear-cache] [--account <acct_id>]";
36
37
  const MOTIONS_ANALYTICS_USAGE = "Usage: audienti motions analytics <motn_id> [--window 30d] [--json] [--account <acct_id>]";
38
+ const MOTIONS_UPDATE_USAGE = "Usage: audienti motions update <motn_id> --status <draft|preparing|active|paused|archived> [--json] [--account <acct_id>]";
39
+ const MOTIONS_DELETE_USAGE = "Usage: audienti motions delete <motn_id> --confirm <yes|true|Y|y> [--json] [--account <acct_id>]";
37
40
  const MOTIONS_CLONE_USAGE = "Usage: audienti motions clone <motn_id> --name <text> [--json] [--account <acct_id>]";
38
41
  const MOTIONS_MOVE_PROSPECTS_USAGE = "Usage: audienti motions move-prospects <source_motn_id> --target <target_motn_id> <prsp_id> [prsp_id...] [--json] [--account <acct_id>]";
39
42
  const ANALYTICS_PROSPECTS_USAGE = "Usage: audienti analytics prospects [--window 24h] [--cohort-start YYYY-MM-DD --cohort-end YYYY-MM-DD] [--motion <motn_id>] [--provenance <source>] [--user <account_user_id|email|name|me>] [--json] [--account <acct_id>]";
@@ -141,6 +144,9 @@ async function dispatch(argv, context) {
141
144
  if (normalizedResource === "motions" && action === "prospects") return motionsProspects(rest, context, { accountOverride });
142
145
  if (normalizedResource === "motions" && action === "add-prospects") return motionsAddProspects(rest, context, { accountOverride });
143
146
  if (normalizedResource === "motions" && action === "create") return motionsCreate(rest, context, { accountOverride });
147
+ if (normalizedResource === "motions" && action === "update") return motionsUpdate(rest, context, { accountOverride });
148
+ if (normalizedResource === "motions" && ["activate", "pause", "archive"].includes(action)) return motionsStatusShortcut(action, rest, context, { accountOverride });
149
+ if (normalizedResource === "motions" && action === "delete") return motionsDelete(rest, context, { accountOverride });
144
150
  if (normalizedResource === "motions" && action === "clone") return motionsClone(rest, context, { accountOverride });
145
151
  if (normalizedResource === "motions" && action === "move-prospects") return motionsMoveProspects(rest, context, { accountOverride });
146
152
  if (normalizedResource === "prospects" && action === "list") return prospectsList(rest, context, { accountOverride });
@@ -818,6 +824,68 @@ async function motionsCreate(args, context, { accountOverride } = {}) {
818
824
  renderMotion(created, context);
819
825
  }
820
826
 
827
+ async function motionsDelete(args, context, { accountOverride } = {}) {
828
+ const { values, positionals } = parseCommandArgs(args, {
829
+ ...jsonOptions(),
830
+ confirm: { type: "string" }
831
+ });
832
+ const normalizedConfirm = String(values.confirm || "").trim().toLowerCase();
833
+ if (positionals.length !== 1 || !DELETE_CONFIRMATION_VALUES.has(normalizedConfirm)) {
834
+ throw new CommandError(MOTIONS_DELETE_USAGE);
835
+ }
836
+
837
+ const { client, accountId } = await requireAccountContext(context, { accountOverride });
838
+ const payload = await client.deleteMotion(accountId, positionals[0]);
839
+ if (values.json) return writeJson(context.stdout, payload);
840
+
841
+ writeLine(context.stdout, `Deleted motion ${display(payload?.name)} (${display(payload?.prefix_id)}).`);
842
+ }
843
+
844
+ async function motionsUpdate(args, context, { accountOverride } = {}) {
845
+ const { values, positionals } = parseCommandArgs(args, {
846
+ ...jsonOptions(),
847
+ status: { type: "string" }
848
+ });
849
+ if (positionals.length !== 1 || !values.status) {
850
+ throw new CommandError(MOTIONS_UPDATE_USAGE);
851
+ }
852
+
853
+ return updateMotionStatus(positionals[0], values.status, context, { accountOverride, json: values.json });
854
+ }
855
+
856
+ async function motionsStatusShortcut(action, args, context, { accountOverride } = {}) {
857
+ const usage = `Usage: audienti motions ${action} <motn_id> [--json] [--account <acct_id>]`;
858
+ const { values, positionals } = parseCommandArgs(args, jsonOptions());
859
+ if (positionals.length !== 1) {
860
+ throw new CommandError(usage);
861
+ }
862
+
863
+ const statusByAction = {
864
+ activate: "active",
865
+ pause: "paused",
866
+ archive: "archived"
867
+ };
868
+ return updateMotionStatus(positionals[0], statusByAction[action], context, { accountOverride, json: values.json });
869
+ }
870
+
871
+ async function updateMotionStatus(motionId, status, context, { accountOverride, json } = {}) {
872
+ const normalizedStatus = String(status || "").trim().toLowerCase();
873
+ if (!MOTION_STATUS_VALUES.has(normalizedStatus)) {
874
+ throw new CommandError(MOTIONS_UPDATE_USAGE);
875
+ }
876
+
877
+ const { client, accountId } = await requireAccountContext(context, { accountOverride });
878
+ const motion = await client.updateMotion(accountId, motionId, {
879
+ motion: {
880
+ status: normalizedStatus
881
+ }
882
+ });
883
+ if (json) return writeJson(context.stdout, motion);
884
+
885
+ writeLine(context.stdout, `Updated motion ${display(motion?.name)} (${display(motion?.prefix_id)}) to ${display(motion?.status)}.`);
886
+ renderMotion(motion, context);
887
+ }
888
+
821
889
  async function motionsClone(args, context, { accountOverride } = {}) {
822
890
  const { values, positionals } = parseCommandArgs(args, {
823
891
  ...jsonOptions(),
@@ -3609,6 +3677,10 @@ const HELP_TOPICS = new Map([
3609
3677
  " audienti motions analytics <motn_id>",
3610
3678
  " audienti motions prospects <motn_id>",
3611
3679
  " audienti motions create --payload <file.json>",
3680
+ " audienti motions update <motn_id> --status <state>",
3681
+ " audienti motions activate <motn_id>",
3682
+ " audienti motions pause <motn_id>",
3683
+ " audienti motions delete <motn_id> --confirm <yes|true|Y|y>",
3612
3684
  " audienti motions clone <motn_id> --name <text>",
3613
3685
  " audienti motions move-prospects <source_motn_id> --target <target_motn_id> <prsp_id> [prsp_id...]",
3614
3686
  " Tip: `plays` is accepted anywhere `motions` is accepted.",
@@ -4205,10 +4277,15 @@ const HELP_TOPICS = new Map([
4205
4277
  " audienti motions prospects <motn_id> [--json]",
4206
4278
  " audienti motions add-prospects <motn_id> <prsp_id> [prsp_id...] [--json]",
4207
4279
  " audienti motions create --payload <file.json> [--json]",
4280
+ " audienti motions update <motn_id> --status <draft|preparing|active|paused|archived> [--json]",
4281
+ " audienti motions activate <motn_id> [--json]",
4282
+ " audienti motions pause <motn_id> [--json]",
4283
+ " audienti motions archive <motn_id> [--json]",
4284
+ " audienti motions delete <motn_id> --confirm <yes|true|Y|y> [--json]",
4208
4285
  " audienti motions clone <motn_id> --name <text> [--json]",
4209
4286
  " audienti motions move-prospects <source_motn_id> --target <target_motn_id> <prsp_id> [prsp_id...] [--json]",
4210
4287
  "",
4211
- "Status: read, create, clone, status, and prospect attachment commands implemented",
4288
+ "Status: read, create, status update, delete, clone, status, and prospect attachment commands implemented",
4212
4289
  "",
4213
4290
  "CLI synonym:",
4214
4291
  " `plays` is accepted anywhere `motions` is accepted",
@@ -4410,6 +4487,92 @@ const HELP_TOPICS = new Map([
4410
4487
  " }"
4411
4488
  ].join("\n")],
4412
4489
 
4490
+ ["motions update", [
4491
+ "Usage:",
4492
+ ` ${MOTIONS_UPDATE_USAGE.slice("Usage: ".length)}`,
4493
+ "",
4494
+ "Status: implemented",
4495
+ "",
4496
+ "Purpose:",
4497
+ " Change one motion or play's lifecycle status.",
4498
+ "",
4499
+ "Input shape:",
4500
+ " motn_id: motn_ prefix id",
4501
+ " status: draft | preparing | active | paused | archived",
4502
+ "",
4503
+ "Behavior:",
4504
+ " Updates only the motion status. Other motion configuration stays unchanged.",
4505
+ "",
4506
+ "API:",
4507
+ " PATCH /api/v1/accounts/:account_id/motions/:id.json",
4508
+ "",
4509
+ "JSON body:",
4510
+ " {",
4511
+ " \"motion\": {",
4512
+ " \"status\": \"paused\"",
4513
+ " }",
4514
+ " }"
4515
+ ].join("\n")],
4516
+
4517
+ ["motions activate", [
4518
+ "Usage:",
4519
+ " audienti motions activate <motn_id> [--json] [--account <acct_id>]",
4520
+ "",
4521
+ "Status: implemented",
4522
+ "",
4523
+ "Purpose:",
4524
+ " Shortcut for `audienti motions update <motn_id> --status active`.",
4525
+ "",
4526
+ "API:",
4527
+ " PATCH /api/v1/accounts/:account_id/motions/:id.json"
4528
+ ].join("\n")],
4529
+
4530
+ ["motions pause", [
4531
+ "Usage:",
4532
+ " audienti motions pause <motn_id> [--json] [--account <acct_id>]",
4533
+ "",
4534
+ "Status: implemented",
4535
+ "",
4536
+ "Purpose:",
4537
+ " Shortcut for `audienti motions update <motn_id> --status paused`.",
4538
+ "",
4539
+ "API:",
4540
+ " PATCH /api/v1/accounts/:account_id/motions/:id.json"
4541
+ ].join("\n")],
4542
+
4543
+ ["motions archive", [
4544
+ "Usage:",
4545
+ " audienti motions archive <motn_id> [--json] [--account <acct_id>]",
4546
+ "",
4547
+ "Status: implemented",
4548
+ "",
4549
+ "Purpose:",
4550
+ " Shortcut for `audienti motions update <motn_id> --status archived`.",
4551
+ "",
4552
+ "API:",
4553
+ " PATCH /api/v1/accounts/:account_id/motions/:id.json"
4554
+ ].join("\n")],
4555
+
4556
+ ["motions delete", [
4557
+ "Usage:",
4558
+ ` ${MOTIONS_DELETE_USAGE.slice("Usage: ".length)}`,
4559
+ "",
4560
+ "Status: implemented",
4561
+ "",
4562
+ "Purpose:",
4563
+ " Delete one motion or play through the same cleanup path the app uses.",
4564
+ "",
4565
+ "Input shape:",
4566
+ " motn_id: motn_ prefix id",
4567
+ " confirm: one of yes, true, Y, y",
4568
+ "",
4569
+ "Behavior:",
4570
+ " Removes the motion, its managed custom signals, and its dedicated finder agent. Prospect records remain in the account.",
4571
+ "",
4572
+ "API:",
4573
+ " DELETE /api/v1/accounts/:account_id/motions/:id.json"
4574
+ ].join("\n")],
4575
+
4413
4576
  ["motions move-prospects", [
4414
4577
  "Usage:",
4415
4578
  ` ${MOTIONS_MOVE_PROSPECTS_USAGE.slice("Usage: ".length)}`,
@@ -5233,6 +5396,9 @@ const HELP_TOPICS = new Map([
5233
5396
  " audienti motions create --payload <file.json>",
5234
5397
  " audienti motions clone <motn_id> --name \"New subset motion\"",
5235
5398
  " audienti motions move-prospects <source_motn_id> --target <target_motn_id> <prsp_id> [prsp_id...]",
5399
+ " audienti motions activate <motn_id>",
5400
+ " audienti motions pause <motn_id>",
5401
+ " audienti motions delete <motn_id> --confirm yes",
5236
5402
  " audienti motions status <motn_id>",
5237
5403
  "",
5238
5404
  "3. Add a new prospect from LinkedIn and poll enrichment",