@flowapt/flowiq-cli 0.2.4 → 0.2.5

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/README.md CHANGED
@@ -416,6 +416,13 @@ Media headers: pass `media_header.file_url` (a public URL) — the edge function
416
416
  uploads it to Meta server-side. Approval is async; re-`pull` for the
417
417
  authoritative Meta status.
418
418
 
419
+ `template_data` is FlowIQ's own send-time mapping (slot labels, default header
420
+ image) stored alongside the template. Omit it and a default is synthesized
421
+ server-side (`auto_synthesized: true`; the response says
422
+ `template_data_synthesized: true`) so the row always exists for `status` and
423
+ broadcast mapping suggestions — pass your own only when you want real slot
424
+ labels (e.g. `"body_params": {"1": "first_name", "2": "order_number"}`).
425
+
419
426
  ### Org — `flowiq org create` / `flowiq org info <organization_id>`
420
427
 
421
428
  Create a brand-new organization, or look one up (read-only; raw store/Meta
@@ -545,6 +552,19 @@ flowiq test cleanup <organization_id> --confirm # delete the stress contact
545
552
  `--agent <id>` targets a specific (non-active) agent. `test stress cleanup` is
546
553
  destructive and requires `--confirm`.
547
554
 
555
+ ### Guide — `flowiq guide`
556
+
557
+ Read the bundled docs in the terminal — no digging through node_modules.
558
+
559
+ ```bash
560
+ flowiq guide # the team guide (TEAM-GUIDE.md), paged; q to quit
561
+ flowiq guide --reference # this full command reference (README.md)
562
+ flowiq guide --no-pager # plain print (also automatic when piped)
563
+ ```
564
+
565
+ Both files ship inside the npm package, so what you read always matches the
566
+ version you have installed.
567
+
548
568
  ## Environment variable overrides
549
569
 
550
570
  | Var | Default | Use |
package/TEAM-GUIDE.md CHANGED
@@ -34,6 +34,10 @@ Confirm with:
34
34
  flowiq auth whoami
35
35
  ```
36
36
 
37
+ This guide travels with the CLI — read it any time with `flowiq guide`
38
+ (`--reference` for the full command reference). It always matches the version
39
+ you have installed.
40
+
37
41
  > **Approving someone else's login:** when a teammate runs `auth login`, they
38
42
  > read you their code (or you open the link they send). On `/cli-auth`, check
39
43
  > the code AND the device name match what they told you, then Approve.
@@ -84,6 +88,7 @@ flowiq auth whoami
84
88
  | Close a client's change request (after verifying the fix!) | `flowiq au resolve <update_id> --note "what changed"` — the client reads the note |
85
89
  | Check an org's platform + active agent | `flowiq org info <org_id>` |
86
90
  | Work a Pin Board task | `flowiq pin list-remote open` → `pull` → edit → `push` |
91
+ | Re-read this guide / the full command reference | `flowiq guide` / `flowiq guide --reference` |
87
92
 
88
93
  The flow is the same everywhere: **pull → edit the JSON → push**. Slugs are the
89
94
  filename the pull printed (e.g. `phytoceutics`), or pass a file path.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowapt/flowiq-cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Command-line tool for FlowIQ staff: round-trip agent prompts, questionnaires, fine-tuning, pin-board tasks, webhooks, templates, agent-updates, chat exports, and live agent testing without ever touching service-role credentials.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,32 @@
1
+ // flowiq guide — read the bundled team guide (TEAM-GUIDE.md) or the full
2
+ // command reference (README.md) right in the terminal. Both files ship inside
3
+ // the npm tarball, so what this prints always matches the installed CLI
4
+ // version — no drift between the tool and its docs.
5
+ import { readFileSync, existsSync } from "node:fs";
6
+ import { fileURLToPath } from "node:url";
7
+ import path from "node:path";
8
+ import { spawnSync } from "node:child_process";
9
+
10
+ const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
11
+
12
+ export function show(opts = {}) {
13
+ const file = opts.reference ? "README.md" : "TEAM-GUIDE.md";
14
+ const fullPath = path.join(PKG_ROOT, file);
15
+
16
+ if (!existsSync(fullPath)) {
17
+ console.error(`Could not find ${file} in the installed package (${PKG_ROOT}).`);
18
+ console.error("Reinstall the CLI: npm i -g @flowapt/flowiq-cli");
19
+ process.exit(1);
20
+ }
21
+
22
+ // Interactive terminal → page it (quit with q); piped/redirected or
23
+ // --no-pager → plain print.
24
+ if (process.stdout.isTTY && opts.pager !== false) {
25
+ const pager = process.env.PAGER || "less";
26
+ const args = pager === "less" ? ["-R", fullPath] : [fullPath];
27
+ const res = spawnSync(pager, args, { stdio: "inherit" });
28
+ if (!res.error) return;
29
+ // pager missing → fall through to plain print
30
+ }
31
+ process.stdout.write(readFileSync(fullPath, "utf8"));
32
+ }
package/src/index.js CHANGED
@@ -27,6 +27,7 @@ import * as customToolsCmd from "./commands/custom-tools.js";
27
27
  import * as broadcastCmd from "./commands/broadcast.js";
28
28
  import * as segmentsCmd from "./commands/segments.js";
29
29
  import * as keywordsCmd from "./commands/keywords.js";
30
+ import * as guideCmd from "./commands/guide.js";
30
31
 
31
32
  // Read version from package.json so it stays in sync with the published npm
32
33
  // version automatically (single source of truth — bumping package.json on each
@@ -448,5 +449,12 @@ export function run(argv) {
448
449
  .description("List local keyword snapshots")
449
450
  .action(() => keywordsCmd.list());
450
451
 
452
+ // guide (bundled docs — always match the installed version)
453
+ program.command("guide")
454
+ .description("Read the team guide (how we use this CLI); --reference for the full command reference")
455
+ .option("--reference", "show the full command reference (README) instead of the team guide")
456
+ .option("--no-pager", "print straight to stdout instead of paging")
457
+ .action((opts) => guideCmd.show(opts));
458
+
451
459
  program.parseAsync(argv);
452
460
  }