@intercom/cli 0.3.0 → 0.3.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/dist/index.js CHANGED
@@ -2225,6 +2225,39 @@ function registerGuidanceCommand(fin) {
2225
2225
  return table({ columns: ["ID", "NAME"], rows });
2226
2226
  }, items);
2227
2227
  });
2228
+ guidance.command("create").description("Create a guidance item").option(
2229
+ "-f, --field <key=value>",
2230
+ "Field to set (repeatable)",
2231
+ (v, acc) => [...acc, v],
2232
+ []
2233
+ ).option("--json", "Output as JSON").option("--jq <expr>", "Filter JSON output with jq expression").option("--verbose", "Show HTTP request/response details").addHelpText(
2234
+ "after",
2235
+ `
2236
+ Examples:
2237
+ $ intercom fin guidance create -f title="Brand Voice" -f prompt="Be friendly and concise." -f category=tone
2238
+ $ intercom fin guidance create -f title="Escalation Rules" -f prompt="Always escalate billing issues." -f category=behavior
2239
+
2240
+ Required fields: title, prompt, category
2241
+ Categories: tone, clarification, content, spam_detection, other, copilot,
2242
+ voice_tone, voice_clarification, voice_routing, voice_content
2243
+ Optional fields: state (live or paused, default: paused), audiences`
2244
+ ).action(async function() {
2245
+ const opts = this.optsWithGlobals();
2246
+ const client = await resolveClient(opts);
2247
+ const body = parseFieldArgs(opts.field ?? []);
2248
+ const result = await client.post("/fin-sdk/guidance", body);
2249
+ const r = result;
2250
+ render(
2251
+ result,
2252
+ opts,
2253
+ () => detail({
2254
+ ID: String(r.id ?? ""),
2255
+ Title: r.title != null ? String(r.title) : void 0,
2256
+ State: r.state != null ? String(r.state) : void 0,
2257
+ Message: r.message != null ? String(r.message) : void 0
2258
+ })
2259
+ );
2260
+ });
2228
2261
  guidance.command("get <id>").description("Download a guidance item by ID and print its YAML content").option("--json", "Output as JSON").option("--verbose", "Show HTTP request/response details").action(async function(id) {
2229
2262
  const opts = this.optsWithGlobals();
2230
2263
  const client = await resolveClient(opts);