@nuelink/nuelink-cli 1.7.0 → 1.7.1

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.1
4
+
5
+ - Add the `posts:create --ai-generated <boolean>` option and `aiGenerated` support for JSON post payloads.
6
+
3
7
  ## 1.7.0
4
8
 
5
9
  - Add `posts:create --googlemybusiness-post <json>` support for Google Business Profile STANDARD, EVENT, and OFFER post settings.
package/README.md CHANGED
@@ -290,6 +290,7 @@ Example `post.json`:
290
290
  {
291
291
  "title": "CLI Post Title",
292
292
  "caption": "Post body from CLI",
293
+ "aiGenerated": true,
293
294
  "publishMode": "DRAFT"
294
295
  }
295
296
  ```
@@ -305,6 +306,7 @@ nuelink-cli posts:create \
305
306
  --alt "is this fine" \
306
307
  --link "https://nuelink.com" \
307
308
  --auto-thread-text true \
309
+ --ai-generated true \
308
310
  --publish-mode DRAFT \
309
311
  --post-as-story true \
310
312
  --comment "this is a comment" \
@@ -354,6 +356,10 @@ nuelink-cli posts:create \
354
356
  integer (minimum `1`). Provide it together with `--comment`; the JSON/API field
355
357
  is `comment.delay` and uses the same minutes unit.
356
358
 
359
+ Use `--ai-generated true` when the post content was generated by AI. The CLI maps
360
+ it to the API's top-level `aiGenerated` boolean; omitting the option uses the API
361
+ default of `false`. JSON payloads can set `aiGenerated` directly.
362
+
357
363
  Review each mutation preview, then repeat the same command without `--dry-run`
358
364
  only when you intend to send it. `--dry-run` is supported for mutations; GET
359
365
  commands reject it instead of silently suppressing the read. Before executing a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuelink/nuelink-cli",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "The official Nuelink CLI for automating social media workflows from your terminal. Schedule posts, upload media, manage brands, and integrate Nuelink into scripts, CI/CD pipelines, and AI agents.",
5
5
  "license": "MIT",
6
6
  "author": "Nuelink",
package/src/commands.js CHANGED
@@ -882,6 +882,7 @@ function registerCommands(program, runtimeApiKey, cliVersion) {
882
882
  .option("--alt <text>", "Alt text")
883
883
  .option("--link <url>", "Post link")
884
884
  .option("--auto-thread-text <boolean>", "Automatically thread text: true/false (defaults to true)")
885
+ .option("--ai-generated <boolean>", "Mark the post as AI-generated: true/false (defaults to false)")
885
886
  .option("--publish-mode <mode>", `Publish mode (${VALID_PUBLISH_MODES.join(", ")})`, "DRAFT")
886
887
  .option("--scheduled-at <value>", "Publish datetime (YYYY-MM-DD HH:mm:ss) or null")
887
888
  .option("--post-as-story <boolean>", "Post as story: true/false")
@@ -207,6 +207,9 @@ function validateRawPostPayload(payload) {
207
207
  if (payload.autoThreadText !== undefined && payload.autoThreadText !== null && typeof payload.autoThreadText !== "boolean") {
208
208
  throw new Error("Invalid autoThreadText. Expected a boolean or null.");
209
209
  }
210
+ if (payload.aiGenerated !== undefined && payload.aiGenerated !== null && typeof payload.aiGenerated !== "boolean") {
211
+ throw new Error("Invalid aiGenerated. Expected a boolean or null.");
212
+ }
210
213
  if (payload.link !== undefined && payload.link !== null) {
211
214
  validateHttpUrl(payload.link, "link");
212
215
  }
@@ -273,6 +276,7 @@ function buildPostPayload(options) {
273
276
  const publishMode = normalizePublishMode(options.publishMode);
274
277
  const scheduledAt = validateScheduledAt(options.scheduledAt);
275
278
  const autoThreadText = parseBooleanStrict(options.autoThreadText, "auto-thread-text") ?? true;
279
+ const aiGenerated = parseBooleanStrict(options.aiGenerated, "ai-generated");
276
280
 
277
281
  if (publishMode === "SCHEDULE" && !scheduledAt) {
278
282
  throw new Error("scheduledAt is required when publishMode is SCHEDULE.");
@@ -428,6 +432,7 @@ function buildPostPayload(options) {
428
432
  publishMode,
429
433
  scheduledAt,
430
434
  autoThreadText,
435
+ ...(aiGenerated !== undefined ? { aiGenerated } : {}),
431
436
  ...(parseBooleanStrict(options.postAsStory, "post-as-story") !== undefined
432
437
  ? { postAsStory: parseBooleanStrict(options.postAsStory, "post-as-story") }
433
438
  : {}),
package/test/cli.test.mjs CHANGED
@@ -876,6 +876,20 @@ test("posts:add-json rejects invalid autoThreadText values", async () => {
876
876
  assert.match(result.stderr, /Invalid autoThreadText/);
877
877
  });
878
878
 
879
+ test("posts:add-json rejects non-boolean aiGenerated values", async () => {
880
+ const homeDir = await setupTempHome();
881
+
882
+ const result = runCli({
883
+ args: ["posts:add-json", "--brand-id", "10", "--collection-id", "20", "--payload", "-"],
884
+ homeDir,
885
+ capturePath: path.join(homeDir, "capture-posts-invalid-ai-generated.json"),
886
+ input: JSON.stringify({ caption: "post", publishMode: "DRAFT", aiGenerated: "true" }),
887
+ });
888
+
889
+ assert.equal(result.status, 1);
890
+ assert.match(result.stderr, /Invalid aiGenerated/);
891
+ });
892
+
879
893
  test("posts:add-json rejects invalid Google Business post fields", async () => {
880
894
  const homeDir = await setupTempHome();
881
895
  const invalidGoogleBusinessOptions = [
@@ -1060,6 +1074,8 @@ test("posts:create builds full payload from options", async () => {
1060
1074
  "https://nuelink.com",
1061
1075
  "--auto-thread-text",
1062
1076
  "true",
1077
+ "--ai-generated",
1078
+ "true",
1063
1079
  "--publish-mode",
1064
1080
  "DRAFT",
1065
1081
  "--post-as-story",
@@ -1120,6 +1136,7 @@ test("posts:create builds full payload from options", async () => {
1120
1136
  assert.equal(capture.body.title, "title here");
1121
1137
  assert.equal(capture.body.caption, "body here");
1122
1138
  assert.equal(capture.body.autoThreadText, true);
1139
+ assert.equal(capture.body.aiGenerated, true);
1123
1140
  assert.equal(capture.body.postAsStory, true);
1124
1141
  assert.equal(capture.body.comment.delay, 30);
1125
1142
  assert.deepEqual(capture.body.media, [
@@ -1142,6 +1159,27 @@ test("posts:create builds full payload from options", async () => {
1142
1159
  });
1143
1160
  });
1144
1161
 
1162
+ test("posts:create preserves an explicit false ai-generated value", async () => {
1163
+ const homeDir = await setupTempHome();
1164
+ const capturePath = path.join(homeDir, "capture-ai-generated-false.json");
1165
+ const result = runCli({
1166
+ args: [
1167
+ "posts:create",
1168
+ "--brand-id", "10",
1169
+ "--collection-id", "20",
1170
+ "--caption", "Post body",
1171
+ "--publish-mode", "DRAFT",
1172
+ "--ai-generated", "false",
1173
+ ],
1174
+ homeDir,
1175
+ capturePath,
1176
+ });
1177
+
1178
+ assert.equal(result.status, 0, result.stderr);
1179
+ const capture = JSON.parse(await readFile(capturePath, "utf8"));
1180
+ assert.equal(capture.body.aiGenerated, false);
1181
+ });
1182
+
1145
1183
  test("posts:create requires a Google Business Profile type in its post JSON option", async () => {
1146
1184
  const homeDir = await setupTempHome();
1147
1185
  const capturePath = path.join(homeDir, "capture-gmb-post-without-type.json");