@sonisoft/now-sdk-ext-cli 5.6.0 → 5.7.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.
@@ -2086,6 +2086,97 @@
2086
2086
  "list.js"
2087
2087
  ]
2088
2088
  },
2089
+ "auth:open": {
2090
+ "aliases": [],
2091
+ "args": {},
2092
+ "description": "Open a verified UI session in a dedicated desktop browser using a stored SDK alias.",
2093
+ "examples": [
2094
+ {
2095
+ "command": "<%= config.bin %> <%= command.id %> -a bcbsscdev --cred-store",
2096
+ "description": "Open the alias in Edge"
2097
+ },
2098
+ {
2099
+ "command": "<%= config.bin %> <%= command.id %> -a dev206299 --browser chrome",
2100
+ "description": "Open in Chrome"
2101
+ },
2102
+ {
2103
+ "command": "<%= config.bin %> <%= command.id %> -a dev206299 --cdp http://127.0.0.1:9222",
2104
+ "description": "Inject into an already-debuggable browser"
2105
+ }
2106
+ ],
2107
+ "flags": {
2108
+ "json": {
2109
+ "description": "Format output as json.",
2110
+ "helpGroup": "GLOBAL",
2111
+ "name": "json",
2112
+ "allowNo": false,
2113
+ "type": "boolean"
2114
+ },
2115
+ "auth": {
2116
+ "char": "a",
2117
+ "description": "Stored SDK credential alias.",
2118
+ "name": "auth",
2119
+ "required": true,
2120
+ "hasDynamicHelp": false,
2121
+ "multiple": false,
2122
+ "type": "option"
2123
+ },
2124
+ "browser": {
2125
+ "description": "Desktop browser to launch. Ignored when --cdp is set.",
2126
+ "name": "browser",
2127
+ "default": "edge",
2128
+ "hasDynamicHelp": false,
2129
+ "multiple": false,
2130
+ "options": [
2131
+ "edge",
2132
+ "chrome",
2133
+ "brave"
2134
+ ],
2135
+ "type": "option"
2136
+ },
2137
+ "cdp": {
2138
+ "description": "Existing DevTools URL. Skips launching a browser.",
2139
+ "name": "cdp",
2140
+ "hasDynamicHelp": false,
2141
+ "multiple": false,
2142
+ "type": "option"
2143
+ },
2144
+ "cred-store": {
2145
+ "description": "Use the headless credential store.",
2146
+ "name": "cred-store",
2147
+ "allowNo": false,
2148
+ "type": "boolean"
2149
+ },
2150
+ "force": {
2151
+ "description": "Replace an existing regular output file.",
2152
+ "name": "force",
2153
+ "allowNo": false,
2154
+ "type": "boolean"
2155
+ },
2156
+ "output": {
2157
+ "description": "Optional owner-only Playwright storage-state file.",
2158
+ "name": "output",
2159
+ "hasDynamicHelp": false,
2160
+ "multiple": false,
2161
+ "type": "option"
2162
+ }
2163
+ },
2164
+ "hasDynamicHelp": false,
2165
+ "hiddenAliases": [],
2166
+ "id": "auth:open",
2167
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2168
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2169
+ "pluginType": "core",
2170
+ "strict": true,
2171
+ "enableJsonFlag": true,
2172
+ "isESM": true,
2173
+ "relativePath": [
2174
+ "dist",
2175
+ "commands",
2176
+ "auth",
2177
+ "open.js"
2178
+ ]
2179
+ },
2089
2180
  "auth:use": {
2090
2181
  "aliases": [],
2091
2182
  "args": {
@@ -2128,16 +2219,24 @@
2128
2219
  "use.js"
2129
2220
  ]
2130
2221
  },
2131
- "behavior:details": {
2222
+ "batch:create": {
2132
2223
  "aliases": [],
2133
2224
  "args": {},
2134
- "description": "Retrieve known behavior artifacts without rediscovery. Repeat --reference kind:source_table:sys_id for up to 50 records. Add --details scripts, --details definitions or --details dependencies to include bodies immediately. Source references are returned by behavior discovery; flows also accept flows:sys_hub_flow:<sys_id>.",
2225
+ "description": "Batch create records on a ServiceNow instance from a JSON file.",
2135
2226
  "examples": [
2136
- "<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json"
2227
+ {
2228
+ "command": "<%= config.bin %> <%= command.id %> --file ./records.json --auth dev",
2229
+ "description": "Create records from a JSON file"
2230
+ },
2231
+ {
2232
+ "command": "<%= config.bin %> <%= command.id %> --file ./records.json --no-transaction --auth dev",
2233
+ "description": "Create records without transactional mode"
2234
+ }
2137
2235
  ],
2138
2236
  "flags": {
2139
2237
  "json": {
2140
- "description": "Emit one JSON document",
2238
+ "description": "Format output as json.",
2239
+ "helpGroup": "GLOBAL",
2141
2240
  "name": "json",
2142
2241
  "allowNo": false,
2143
2242
  "type": "boolean"
@@ -2216,53 +2315,26 @@
2216
2315
  "allowNo": false,
2217
2316
  "type": "boolean"
2218
2317
  },
2219
- "dependency-depth": {
2220
- "description": "Expand one dependency level; requires --details dependencies",
2221
- "name": "dependency-depth",
2222
- "default": 0,
2223
- "hasDynamicHelp": false,
2224
- "multiple": false,
2225
- "type": "option"
2226
- },
2227
- "details": {
2228
- "description": "Include selected detail now; repeat for multiple kinds",
2229
- "name": "details",
2230
- "hasDynamicHelp": false,
2231
- "multiple": true,
2232
- "options": [
2233
- "scripts",
2234
- "definitions",
2235
- "dependencies"
2236
- ],
2237
- "type": "option"
2238
- },
2239
- "max-bytes": {
2240
- "description": "Maximum JSON response bytes; omissions include retrieval references",
2241
- "name": "max-bytes",
2242
- "default": 65536,
2243
- "hasDynamicHelp": false,
2244
- "multiple": false,
2245
- "type": "option"
2246
- },
2247
- "scope": {
2248
- "description": "Transaction scope for flow definition reads",
2249
- "name": "scope",
2318
+ "file": {
2319
+ "char": "f",
2320
+ "description": "Path to JSON file with create operations",
2321
+ "name": "file",
2322
+ "required": true,
2250
2323
  "hasDynamicHelp": false,
2251
2324
  "multiple": false,
2252
2325
  "type": "option"
2253
2326
  },
2254
- "reference": {
2255
- "description": "kind:source_table:sys_id; repeat for a batch",
2256
- "name": "reference",
2257
- "required": true,
2258
- "hasDynamicHelp": false,
2259
- "multiple": true,
2260
- "type": "option"
2327
+ "transaction": {
2328
+ "description": "Stop on first error (transactional)",
2329
+ "name": "transaction",
2330
+ "required": false,
2331
+ "allowNo": false,
2332
+ "type": "boolean"
2261
2333
  }
2262
2334
  },
2263
2335
  "hasDynamicHelp": false,
2264
2336
  "hiddenAliases": [],
2265
- "id": "behavior:details",
2337
+ "id": "batch:create",
2266
2338
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2267
2339
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2268
2340
  "pluginType": "core",
@@ -2272,21 +2344,28 @@
2272
2344
  "relativePath": [
2273
2345
  "dist",
2274
2346
  "commands",
2275
- "behavior",
2276
- "details.js"
2347
+ "batch",
2348
+ "create.js"
2277
2349
  ]
2278
2350
  },
2279
- "behavior": {
2351
+ "batch:update": {
2280
2352
  "aliases": [],
2281
2353
  "args": {},
2282
- "description": "Discover table behavior: rules, UI actions/scripts, UI/data policies, workflows, flows and state models. Active and applicable inherited behavior is included by default. Conditions describe configuration, not a prediction of execution. Select categories and details to control output size.",
2354
+ "description": "Batch update records on a ServiceNow instance from a JSON file.",
2283
2355
  "examples": [
2284
- "<%= config.bin %> <%= command.id %> --table incident --auth dev --json",
2285
- "<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json"
2356
+ {
2357
+ "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --auth dev",
2358
+ "description": "Update records from a JSON file"
2359
+ },
2360
+ {
2361
+ "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --stop-on-error --auth dev",
2362
+ "description": "Update records and stop on first error"
2363
+ }
2286
2364
  ],
2287
2365
  "flags": {
2288
2366
  "json": {
2289
- "description": "Emit one JSON document",
2367
+ "description": "Format output as json.",
2368
+ "helpGroup": "GLOBAL",
2290
2369
  "name": "json",
2291
2370
  "allowNo": false,
2292
2371
  "type": "boolean"
@@ -2365,112 +2444,26 @@
2365
2444
  "allowNo": false,
2366
2445
  "type": "boolean"
2367
2446
  },
2368
- "dependency-depth": {
2369
- "description": "Expand one dependency level; requires --details dependencies",
2370
- "name": "dependency-depth",
2371
- "default": 0,
2372
- "hasDynamicHelp": false,
2373
- "multiple": false,
2374
- "type": "option"
2375
- },
2376
- "details": {
2377
- "description": "Include selected detail now; repeat for multiple kinds",
2378
- "name": "details",
2379
- "hasDynamicHelp": false,
2380
- "multiple": true,
2381
- "options": [
2382
- "scripts",
2383
- "definitions",
2384
- "dependencies"
2385
- ],
2386
- "type": "option"
2387
- },
2388
- "max-bytes": {
2389
- "description": "Maximum JSON response bytes; omissions include retrieval references",
2390
- "name": "max-bytes",
2391
- "default": 65536,
2392
- "hasDynamicHelp": false,
2393
- "multiple": false,
2394
- "type": "option"
2395
- },
2396
- "scope": {
2397
- "description": "Transaction scope for flow definition reads",
2398
- "name": "scope",
2399
- "hasDynamicHelp": false,
2400
- "multiple": false,
2401
- "type": "option"
2402
- },
2403
- "category": {
2404
- "description": "Category to inspect; repeat to select several, default all",
2405
- "name": "category",
2406
- "hasDynamicHelp": false,
2407
- "multiple": true,
2408
- "options": [
2409
- "business_rules",
2410
- "ui_actions",
2411
- "client_scripts",
2412
- "ui_policies",
2413
- "data_policies",
2414
- "workflows",
2415
- "flows",
2416
- "state_models"
2417
- ],
2418
- "type": "option"
2419
- },
2420
- "cursor": {
2421
- "description": "Continuation token; requires exactly one --category and the same filters",
2422
- "name": "cursor",
2447
+ "file": {
2448
+ "char": "f",
2449
+ "description": "Path to JSON file with update operations",
2450
+ "name": "file",
2451
+ "required": true,
2423
2452
  "hasDynamicHelp": false,
2424
2453
  "multiple": false,
2425
2454
  "type": "option"
2426
2455
  },
2427
- "include-inactive": {
2428
- "description": "Include inactive/published and draft candidates when discoverable",
2429
- "name": "include-inactive",
2456
+ "stop-on-error": {
2457
+ "description": "Stop processing on first error",
2458
+ "name": "stop-on-error",
2459
+ "required": false,
2430
2460
  "allowNo": false,
2431
2461
  "type": "boolean"
2432
- },
2433
- "include-inherited": {
2434
- "description": "Include applicable ancestor behavior",
2435
- "name": "include-inherited",
2436
- "allowNo": true,
2437
- "type": "boolean"
2438
- },
2439
- "limit": {
2440
- "description": "Maximum items per category",
2441
- "name": "limit",
2442
- "default": 50,
2443
- "hasDynamicHelp": false,
2444
- "multiple": false,
2445
- "type": "option"
2446
- },
2447
- "name": {
2448
- "description": "Metadata name contains this text",
2449
- "name": "name",
2450
- "hasDynamicHelp": false,
2451
- "multiple": false,
2452
- "type": "option"
2453
- },
2454
- "sys-id": {
2455
- "description": "Metadata source sys_id to include; repeat for multiple records",
2456
- "name": "sys-id",
2457
- "hasDynamicHelp": false,
2458
- "multiple": true,
2459
- "type": "option"
2460
- },
2461
- "table": {
2462
- "char": "t",
2463
- "description": "Target table name",
2464
- "name": "table",
2465
- "required": true,
2466
- "hasDynamicHelp": false,
2467
- "multiple": false,
2468
- "type": "option"
2469
2462
  }
2470
2463
  },
2471
2464
  "hasDynamicHelp": false,
2472
2465
  "hiddenAliases": [],
2473
- "id": "behavior",
2466
+ "id": "batch:update",
2474
2467
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2475
2468
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2476
2469
  "pluginType": "core",
@@ -2480,28 +2473,20 @@
2480
2473
  "relativePath": [
2481
2474
  "dist",
2482
2475
  "commands",
2483
- "behavior",
2484
- "index.js"
2476
+ "batch",
2477
+ "update.js"
2485
2478
  ]
2486
2479
  },
2487
- "batch:create": {
2480
+ "behavior:details": {
2488
2481
  "aliases": [],
2489
2482
  "args": {},
2490
- "description": "Batch create records on a ServiceNow instance from a JSON file.",
2483
+ "description": "Retrieve known behavior artifacts without rediscovery. Repeat --reference kind:source_table:sys_id for up to 50 records. Add --details scripts, --details definitions or --details dependencies to include bodies immediately. Source references are returned by behavior discovery; flows also accept flows:sys_hub_flow:<sys_id>.",
2491
2484
  "examples": [
2492
- {
2493
- "command": "<%= config.bin %> <%= command.id %> --file ./records.json --auth dev",
2494
- "description": "Create records from a JSON file"
2495
- },
2496
- {
2497
- "command": "<%= config.bin %> <%= command.id %> --file ./records.json --no-transaction --auth dev",
2498
- "description": "Create records without transactional mode"
2499
- }
2485
+ "<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json"
2500
2486
  ],
2501
2487
  "flags": {
2502
2488
  "json": {
2503
- "description": "Format output as json.",
2504
- "helpGroup": "GLOBAL",
2489
+ "description": "Emit one JSON document",
2505
2490
  "name": "json",
2506
2491
  "allowNo": false,
2507
2492
  "type": "boolean"
@@ -2580,26 +2565,53 @@
2580
2565
  "allowNo": false,
2581
2566
  "type": "boolean"
2582
2567
  },
2583
- "file": {
2584
- "char": "f",
2585
- "description": "Path to JSON file with create operations",
2586
- "name": "file",
2587
- "required": true,
2568
+ "dependency-depth": {
2569
+ "description": "Expand one dependency level; requires --details dependencies",
2570
+ "name": "dependency-depth",
2571
+ "default": 0,
2588
2572
  "hasDynamicHelp": false,
2589
2573
  "multiple": false,
2590
2574
  "type": "option"
2591
2575
  },
2592
- "transaction": {
2593
- "description": "Stop on first error (transactional)",
2594
- "name": "transaction",
2595
- "required": false,
2596
- "allowNo": false,
2597
- "type": "boolean"
2576
+ "details": {
2577
+ "description": "Include selected detail now; repeat for multiple kinds",
2578
+ "name": "details",
2579
+ "hasDynamicHelp": false,
2580
+ "multiple": true,
2581
+ "options": [
2582
+ "scripts",
2583
+ "definitions",
2584
+ "dependencies"
2585
+ ],
2586
+ "type": "option"
2587
+ },
2588
+ "max-bytes": {
2589
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2590
+ "name": "max-bytes",
2591
+ "default": 65536,
2592
+ "hasDynamicHelp": false,
2593
+ "multiple": false,
2594
+ "type": "option"
2595
+ },
2596
+ "scope": {
2597
+ "description": "Transaction scope for flow definition reads",
2598
+ "name": "scope",
2599
+ "hasDynamicHelp": false,
2600
+ "multiple": false,
2601
+ "type": "option"
2602
+ },
2603
+ "reference": {
2604
+ "description": "kind:source_table:sys_id; repeat for a batch",
2605
+ "name": "reference",
2606
+ "required": true,
2607
+ "hasDynamicHelp": false,
2608
+ "multiple": true,
2609
+ "type": "option"
2598
2610
  }
2599
2611
  },
2600
2612
  "hasDynamicHelp": false,
2601
2613
  "hiddenAliases": [],
2602
- "id": "batch:create",
2614
+ "id": "behavior:details",
2603
2615
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2604
2616
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2605
2617
  "pluginType": "core",
@@ -2609,28 +2621,21 @@
2609
2621
  "relativePath": [
2610
2622
  "dist",
2611
2623
  "commands",
2612
- "batch",
2613
- "create.js"
2624
+ "behavior",
2625
+ "details.js"
2614
2626
  ]
2615
2627
  },
2616
- "batch:update": {
2628
+ "behavior": {
2617
2629
  "aliases": [],
2618
2630
  "args": {},
2619
- "description": "Batch update records on a ServiceNow instance from a JSON file.",
2631
+ "description": "Discover table behavior: rules, UI actions/scripts, UI/data policies, workflows, flows and state models. Active and applicable inherited behavior is included by default. Conditions describe configuration, not a prediction of execution. Select categories and details to control output size.",
2620
2632
  "examples": [
2621
- {
2622
- "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --auth dev",
2623
- "description": "Update records from a JSON file"
2624
- },
2625
- {
2626
- "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --stop-on-error --auth dev",
2627
- "description": "Update records and stop on first error"
2628
- }
2633
+ "<%= config.bin %> <%= command.id %> --table incident --auth dev --json",
2634
+ "<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json"
2629
2635
  ],
2630
2636
  "flags": {
2631
2637
  "json": {
2632
- "description": "Format output as json.",
2633
- "helpGroup": "GLOBAL",
2638
+ "description": "Emit one JSON document",
2634
2639
  "name": "json",
2635
2640
  "allowNo": false,
2636
2641
  "type": "boolean"
@@ -2709,26 +2714,112 @@
2709
2714
  "allowNo": false,
2710
2715
  "type": "boolean"
2711
2716
  },
2712
- "file": {
2713
- "char": "f",
2714
- "description": "Path to JSON file with update operations",
2715
- "name": "file",
2717
+ "dependency-depth": {
2718
+ "description": "Expand one dependency level; requires --details dependencies",
2719
+ "name": "dependency-depth",
2720
+ "default": 0,
2721
+ "hasDynamicHelp": false,
2722
+ "multiple": false,
2723
+ "type": "option"
2724
+ },
2725
+ "details": {
2726
+ "description": "Include selected detail now; repeat for multiple kinds",
2727
+ "name": "details",
2728
+ "hasDynamicHelp": false,
2729
+ "multiple": true,
2730
+ "options": [
2731
+ "scripts",
2732
+ "definitions",
2733
+ "dependencies"
2734
+ ],
2735
+ "type": "option"
2736
+ },
2737
+ "max-bytes": {
2738
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2739
+ "name": "max-bytes",
2740
+ "default": 65536,
2741
+ "hasDynamicHelp": false,
2742
+ "multiple": false,
2743
+ "type": "option"
2744
+ },
2745
+ "scope": {
2746
+ "description": "Transaction scope for flow definition reads",
2747
+ "name": "scope",
2748
+ "hasDynamicHelp": false,
2749
+ "multiple": false,
2750
+ "type": "option"
2751
+ },
2752
+ "category": {
2753
+ "description": "Category to inspect; repeat to select several, default all",
2754
+ "name": "category",
2755
+ "hasDynamicHelp": false,
2756
+ "multiple": true,
2757
+ "options": [
2758
+ "business_rules",
2759
+ "ui_actions",
2760
+ "client_scripts",
2761
+ "ui_policies",
2762
+ "data_policies",
2763
+ "workflows",
2764
+ "flows",
2765
+ "state_models"
2766
+ ],
2767
+ "type": "option"
2768
+ },
2769
+ "cursor": {
2770
+ "description": "Continuation token; requires exactly one --category and the same filters",
2771
+ "name": "cursor",
2772
+ "hasDynamicHelp": false,
2773
+ "multiple": false,
2774
+ "type": "option"
2775
+ },
2776
+ "include-inactive": {
2777
+ "description": "Include inactive/published and draft candidates when discoverable",
2778
+ "name": "include-inactive",
2779
+ "allowNo": false,
2780
+ "type": "boolean"
2781
+ },
2782
+ "include-inherited": {
2783
+ "description": "Include applicable ancestor behavior",
2784
+ "name": "include-inherited",
2785
+ "allowNo": true,
2786
+ "type": "boolean"
2787
+ },
2788
+ "limit": {
2789
+ "description": "Maximum items per category",
2790
+ "name": "limit",
2791
+ "default": 50,
2792
+ "hasDynamicHelp": false,
2793
+ "multiple": false,
2794
+ "type": "option"
2795
+ },
2796
+ "name": {
2797
+ "description": "Metadata name contains this text",
2798
+ "name": "name",
2799
+ "hasDynamicHelp": false,
2800
+ "multiple": false,
2801
+ "type": "option"
2802
+ },
2803
+ "sys-id": {
2804
+ "description": "Metadata source sys_id to include; repeat for multiple records",
2805
+ "name": "sys-id",
2806
+ "hasDynamicHelp": false,
2807
+ "multiple": true,
2808
+ "type": "option"
2809
+ },
2810
+ "table": {
2811
+ "char": "t",
2812
+ "description": "Target table name",
2813
+ "name": "table",
2716
2814
  "required": true,
2717
2815
  "hasDynamicHelp": false,
2718
2816
  "multiple": false,
2719
2817
  "type": "option"
2720
- },
2721
- "stop-on-error": {
2722
- "description": "Stop processing on first error",
2723
- "name": "stop-on-error",
2724
- "required": false,
2725
- "allowNo": false,
2726
- "type": "boolean"
2727
2818
  }
2728
2819
  },
2729
2820
  "hasDynamicHelp": false,
2730
2821
  "hiddenAliases": [],
2731
- "id": "batch:update",
2822
+ "id": "behavior",
2732
2823
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2733
2824
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2734
2825
  "pluginType": "core",
@@ -2738,8 +2829,8 @@
2738
2829
  "relativePath": [
2739
2830
  "dist",
2740
2831
  "commands",
2741
- "batch",
2742
- "update.js"
2832
+ "behavior",
2833
+ "index.js"
2743
2834
  ]
2744
2835
  },
2745
2836
  "bulk:delete": {
@@ -3109,24 +3200,305 @@
3109
3200
  "description": "Execute and save output to a file",
3110
3201
  "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
3111
3202
  },
3112
- {
3113
- "description": "Execute and pipe output to grep for filtering",
3114
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
3203
+ {
3204
+ "description": "Execute and pipe output to grep for filtering",
3205
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
3206
+ },
3207
+ {
3208
+ "description": "Execute with debug logging to troubleshoot issues",
3209
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
3210
+ },
3211
+ {
3212
+ "description": "Execute with parameters for template replacement",
3213
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
3214
+ }
3215
+ ],
3216
+ "flags": {
3217
+ "json": {
3218
+ "description": "Format output as json.",
3219
+ "helpGroup": "GLOBAL",
3220
+ "name": "json",
3221
+ "allowNo": false,
3222
+ "type": "boolean"
3223
+ },
3224
+ "auth": {
3225
+ "char": "a",
3226
+ "description": "Auth alias to use.",
3227
+ "name": "auth",
3228
+ "required": false,
3229
+ "hasDynamicHelp": false,
3230
+ "multiple": false,
3231
+ "type": "option"
3232
+ },
3233
+ "cred-store": {
3234
+ "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
3235
+ "helpGroup": "GLOBAL",
3236
+ "name": "cred-store",
3237
+ "required": false,
3238
+ "allowNo": false,
3239
+ "type": "boolean"
3240
+ },
3241
+ "deny-execute": {
3242
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
3243
+ "helpGroup": "GLOBAL",
3244
+ "name": "deny-execute",
3245
+ "required": false,
3246
+ "allowNo": false,
3247
+ "type": "boolean"
3248
+ },
3249
+ "deny-write": {
3250
+ "description": "Refuse any change to instance data for this invocation.",
3251
+ "helpGroup": "GLOBAL",
3252
+ "name": "deny-write",
3253
+ "required": false,
3254
+ "allowNo": false,
3255
+ "type": "boolean"
3256
+ },
3257
+ "log-dir": {
3258
+ "description": "Directory to write log files to. Implies --log-file.",
3259
+ "helpGroup": "GLOBAL",
3260
+ "name": "log-dir",
3261
+ "required": false,
3262
+ "hasDynamicHelp": false,
3263
+ "multiple": false,
3264
+ "type": "option"
3265
+ },
3266
+ "log-file": {
3267
+ "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
3268
+ "helpGroup": "GLOBAL",
3269
+ "name": "log-file",
3270
+ "required": false,
3271
+ "allowNo": false,
3272
+ "type": "boolean"
3273
+ },
3274
+ "log-level": {
3275
+ "helpGroup": "GLOBAL",
3276
+ "name": "log-level",
3277
+ "summary": "Specify level for logging.",
3278
+ "default": "info",
3279
+ "hasDynamicHelp": false,
3280
+ "multiple": false,
3281
+ "options": [
3282
+ "debug",
3283
+ "warn",
3284
+ "error",
3285
+ "info",
3286
+ "trace"
3287
+ ],
3288
+ "type": "option"
3289
+ },
3290
+ "read-only": {
3291
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
3292
+ "helpGroup": "GLOBAL",
3293
+ "name": "read-only",
3294
+ "required": false,
3295
+ "allowNo": false,
3296
+ "type": "boolean"
3297
+ },
3298
+ "params": {
3299
+ "char": "p",
3300
+ "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
3301
+ "name": "params",
3302
+ "required": false,
3303
+ "hasDynamicHelp": false,
3304
+ "multiple": false,
3305
+ "type": "option"
3306
+ }
3307
+ },
3308
+ "hasDynamicHelp": false,
3309
+ "hiddenAliases": [],
3310
+ "id": "exec",
3311
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3312
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3313
+ "pluginType": "core",
3314
+ "strict": true,
3315
+ "enableJsonFlag": true,
3316
+ "autocomplete": {},
3317
+ "isESM": true,
3318
+ "relativePath": [
3319
+ "dist",
3320
+ "commands",
3321
+ "exec",
3322
+ "index.js"
3323
+ ]
3324
+ },
3325
+ "flow:action": {
3326
+ "aliases": [],
3327
+ "args": {},
3328
+ "description": "Execute a Flow Designer action by scoped name.\n\nRuns an action using the sn_fd.FlowAPI ScriptableFlowRunner.\n\nFeatures:\n • Execute actions by scoped name\n • Pass input values as JSON\n • Foreground or background execution mode\n • Returns context ID, outputs, and debug information",
3329
+ "examples": [
3330
+ {
3331
+ "description": "Run an action",
3332
+ "command": "<%= config.bin %> <%= command.id %> --name global.create_record --inputs '{\"table\":\"incident\",\"values\":{\"short_description\":\"Test\"}}' --auth dev"
3333
+ }
3334
+ ],
3335
+ "flags": {
3336
+ "json": {
3337
+ "char": "j",
3338
+ "description": "Output results as JSON",
3339
+ "name": "json",
3340
+ "required": false,
3341
+ "allowNo": false,
3342
+ "type": "boolean"
3343
+ },
3344
+ "auth": {
3345
+ "char": "a",
3346
+ "description": "Auth alias to use.",
3347
+ "name": "auth",
3348
+ "required": false,
3349
+ "hasDynamicHelp": false,
3350
+ "multiple": false,
3351
+ "type": "option"
3352
+ },
3353
+ "cred-store": {
3354
+ "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
3355
+ "helpGroup": "GLOBAL",
3356
+ "name": "cred-store",
3357
+ "required": false,
3358
+ "allowNo": false,
3359
+ "type": "boolean"
3360
+ },
3361
+ "deny-execute": {
3362
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
3363
+ "helpGroup": "GLOBAL",
3364
+ "name": "deny-execute",
3365
+ "required": false,
3366
+ "allowNo": false,
3367
+ "type": "boolean"
3368
+ },
3369
+ "deny-write": {
3370
+ "description": "Refuse any change to instance data for this invocation.",
3371
+ "helpGroup": "GLOBAL",
3372
+ "name": "deny-write",
3373
+ "required": false,
3374
+ "allowNo": false,
3375
+ "type": "boolean"
3376
+ },
3377
+ "log-dir": {
3378
+ "description": "Directory to write log files to. Implies --log-file.",
3379
+ "helpGroup": "GLOBAL",
3380
+ "name": "log-dir",
3381
+ "required": false,
3382
+ "hasDynamicHelp": false,
3383
+ "multiple": false,
3384
+ "type": "option"
3385
+ },
3386
+ "log-file": {
3387
+ "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
3388
+ "helpGroup": "GLOBAL",
3389
+ "name": "log-file",
3390
+ "required": false,
3391
+ "allowNo": false,
3392
+ "type": "boolean"
3393
+ },
3394
+ "log-level": {
3395
+ "helpGroup": "GLOBAL",
3396
+ "name": "log-level",
3397
+ "summary": "Specify level for logging.",
3398
+ "default": "info",
3399
+ "hasDynamicHelp": false,
3400
+ "multiple": false,
3401
+ "options": [
3402
+ "debug",
3403
+ "warn",
3404
+ "error",
3405
+ "info",
3406
+ "trace"
3407
+ ],
3408
+ "type": "option"
3409
+ },
3410
+ "read-only": {
3411
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
3412
+ "helpGroup": "GLOBAL",
3413
+ "name": "read-only",
3414
+ "required": false,
3415
+ "allowNo": false,
3416
+ "type": "boolean"
3417
+ },
3418
+ "name": {
3419
+ "char": "n",
3420
+ "description": "Scoped name of the action (e.g. global.create_record)",
3421
+ "name": "name",
3422
+ "required": true,
3423
+ "hasDynamicHelp": false,
3424
+ "multiple": false,
3425
+ "type": "option"
3426
+ },
3427
+ "inputs": {
3428
+ "char": "i",
3429
+ "description": "JSON object of input name-value pairs",
3430
+ "name": "inputs",
3431
+ "required": false,
3432
+ "hasDynamicHelp": false,
3433
+ "multiple": false,
3434
+ "type": "option"
3435
+ },
3436
+ "mode": {
3437
+ "char": "m",
3438
+ "description": "Execution mode",
3439
+ "name": "mode",
3440
+ "required": false,
3441
+ "default": "foreground",
3442
+ "hasDynamicHelp": false,
3443
+ "multiple": false,
3444
+ "options": [
3445
+ "foreground",
3446
+ "background"
3447
+ ],
3448
+ "type": "option"
3449
+ },
3450
+ "scope": {
3451
+ "description": "Scope context for script execution",
3452
+ "name": "scope",
3453
+ "required": false,
3454
+ "hasDynamicHelp": false,
3455
+ "multiple": false,
3456
+ "type": "option"
3115
3457
  },
3458
+ "quick": {
3459
+ "description": "Skip execution detail records for better performance",
3460
+ "name": "quick",
3461
+ "required": false,
3462
+ "allowNo": false,
3463
+ "type": "boolean"
3464
+ }
3465
+ },
3466
+ "hasDynamicHelp": false,
3467
+ "hiddenAliases": [],
3468
+ "id": "flow:action",
3469
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3470
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3471
+ "pluginType": "core",
3472
+ "strict": true,
3473
+ "enableJsonFlag": true,
3474
+ "isESM": true,
3475
+ "relativePath": [
3476
+ "dist",
3477
+ "commands",
3478
+ "flow",
3479
+ "action.js"
3480
+ ]
3481
+ },
3482
+ "flow:cancel": {
3483
+ "aliases": [],
3484
+ "args": {},
3485
+ "description": "Cancel a running or paused flow execution.\n\nCancels a flow context that is in QUEUED, IN_PROGRESS, or WAITING state.",
3486
+ "examples": [
3116
3487
  {
3117
- "description": "Execute with debug logging to troubleshoot issues",
3118
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
3488
+ "description": "Cancel a running flow",
3489
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
3119
3490
  },
3120
3491
  {
3121
- "description": "Execute with parameters for template replacement",
3122
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
3492
+ "description": "Cancel with a reason",
3493
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --reason \"No longer needed\" --auth dev"
3123
3494
  }
3124
3495
  ],
3125
3496
  "flags": {
3126
3497
  "json": {
3127
- "description": "Format output as json.",
3128
- "helpGroup": "GLOBAL",
3498
+ "char": "j",
3499
+ "description": "Output results as JSON",
3129
3500
  "name": "json",
3501
+ "required": false,
3130
3502
  "allowNo": false,
3131
3503
  "type": "boolean"
3132
3504
  },
@@ -3204,10 +3576,27 @@
3204
3576
  "allowNo": false,
3205
3577
  "type": "boolean"
3206
3578
  },
3207
- "params": {
3208
- "char": "p",
3209
- "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
3210
- "name": "params",
3579
+ "context-id": {
3580
+ "char": "c",
3581
+ "description": "Flow execution context sys_id",
3582
+ "name": "context-id",
3583
+ "required": true,
3584
+ "hasDynamicHelp": false,
3585
+ "multiple": false,
3586
+ "type": "option"
3587
+ },
3588
+ "reason": {
3589
+ "char": "r",
3590
+ "description": "Cancellation reason",
3591
+ "name": "reason",
3592
+ "required": false,
3593
+ "hasDynamicHelp": false,
3594
+ "multiple": false,
3595
+ "type": "option"
3596
+ },
3597
+ "scope": {
3598
+ "description": "Scope context for script execution",
3599
+ "name": "scope",
3211
3600
  "required": false,
3212
3601
  "hasDynamicHelp": false,
3213
3602
  "multiple": false,
@@ -3216,29 +3605,36 @@
3216
3605
  },
3217
3606
  "hasDynamicHelp": false,
3218
3607
  "hiddenAliases": [],
3219
- "id": "exec",
3608
+ "id": "flow:cancel",
3220
3609
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3221
3610
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3222
3611
  "pluginType": "core",
3223
3612
  "strict": true,
3224
3613
  "enableJsonFlag": true,
3225
- "autocomplete": {},
3226
3614
  "isESM": true,
3227
3615
  "relativePath": [
3228
3616
  "dist",
3229
3617
  "commands",
3230
- "exec",
3231
- "index.js"
3618
+ "flow",
3619
+ "cancel.js"
3232
3620
  ]
3233
3621
  },
3234
- "flow:action": {
3622
+ "flow:copy": {
3235
3623
  "aliases": [],
3236
3624
  "args": {},
3237
- "description": "Execute a Flow Designer action by scoped name.\n\nRuns an action using the sn_fd.FlowAPI ScriptableFlowRunner.\n\nFeatures:\n • Execute actions by scoped name\n • Pass input values as JSON\n • Foreground or background execution mode\n • Returns context ID, outputs, and debug information",
3625
+ "description": "Copy an existing flow into a target scoped application.\n\nThis is the ServiceNow best practice before modifying any flow — OOB and shared flows must never be modified directly; always copy first. The copied flow lands in draft/unpublished state in the target scope.\n\nEnables the full CLI-driven flow development lifecycle:\n copy → pull (now-sdk transform) → modify → push → test → publish\n\nFeatures:\n • Copy flows by sys_id or scoped name\n • Specify a display name for the new copy\n • Target any scoped application by sys_id\n • Returns the new flow sys_id for use in subsequent commands",
3238
3626
  "examples": [
3239
3627
  {
3240
- "description": "Run an action",
3241
- "command": "<%= config.bin %> <%= command.id %> --name global.create_record --inputs '{\"table\":\"incident\",\"values\":{\"short_description\":\"Test\"}}' --auth dev"
3628
+ "description": "Copy an OOB flow into your app scope",
3629
+ "command": "<%= config.bin %> <%= command.id %> --source-flow-id e89e3ade731310108ef62d2b04f6a744 --name \"Copy of Change - Standard\" --target-scope 4a5a6115402946939ee48e3fe80f60f8 --auth dev"
3630
+ },
3631
+ {
3632
+ "description": "Copy by scoped name",
3633
+ "command": "<%= config.bin %> <%= command.id %> -s global.change__standard -n \"My Custom Change Flow\" -t 4a5a6115402946939ee48e3fe80f60f8 --auth dev"
3634
+ },
3635
+ {
3636
+ "description": "Copy with JSON output for scripting",
3637
+ "command": "<%= config.bin %> <%= command.id %> -s e89e3ade731310108ef62d2b04f6a744 -n \"Copy\" -t 4a5a6115402946939ee48e3fe80f60f8 --json --auth dev"
3242
3638
  }
3243
3639
  ],
3244
3640
  "flags": {
@@ -3324,57 +3720,37 @@
3324
3720
  "allowNo": false,
3325
3721
  "type": "boolean"
3326
3722
  },
3327
- "name": {
3328
- "char": "n",
3329
- "description": "Scoped name of the action (e.g. global.create_record)",
3330
- "name": "name",
3723
+ "source-flow-id": {
3724
+ "char": "s",
3725
+ "description": "Source flow sys_id or scoped name (e.g. global.change__standard)",
3726
+ "name": "source-flow-id",
3331
3727
  "required": true,
3332
3728
  "hasDynamicHelp": false,
3333
3729
  "multiple": false,
3334
3730
  "type": "option"
3335
3731
  },
3336
- "inputs": {
3337
- "char": "i",
3338
- "description": "JSON object of input name-value pairs",
3339
- "name": "inputs",
3340
- "required": false,
3341
- "hasDynamicHelp": false,
3342
- "multiple": false,
3343
- "type": "option"
3344
- },
3345
- "mode": {
3346
- "char": "m",
3347
- "description": "Execution mode",
3348
- "name": "mode",
3349
- "required": false,
3350
- "default": "foreground",
3732
+ "name": {
3733
+ "char": "n",
3734
+ "description": "Display name for the new copied flow",
3735
+ "name": "name",
3736
+ "required": true,
3351
3737
  "hasDynamicHelp": false,
3352
3738
  "multiple": false,
3353
- "options": [
3354
- "foreground",
3355
- "background"
3356
- ],
3357
3739
  "type": "option"
3358
3740
  },
3359
- "scope": {
3360
- "description": "Scope context for script execution",
3361
- "name": "scope",
3362
- "required": false,
3741
+ "target-scope": {
3742
+ "char": "t",
3743
+ "description": "Scope sys_id of the target application (use `nex scope` to find scope sys_ids)",
3744
+ "name": "target-scope",
3745
+ "required": true,
3363
3746
  "hasDynamicHelp": false,
3364
3747
  "multiple": false,
3365
3748
  "type": "option"
3366
- },
3367
- "quick": {
3368
- "description": "Skip execution detail records for better performance",
3369
- "name": "quick",
3370
- "required": false,
3371
- "allowNo": false,
3372
- "type": "boolean"
3373
3749
  }
3374
3750
  },
3375
3751
  "hasDynamicHelp": false,
3376
3752
  "hiddenAliases": [],
3377
- "id": "flow:action",
3753
+ "id": "flow:copy",
3378
3754
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3379
3755
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3380
3756
  "pluginType": "core",
@@ -3385,27 +3761,39 @@
3385
3761
  "dist",
3386
3762
  "commands",
3387
3763
  "flow",
3388
- "action.js"
3764
+ "copy.js"
3389
3765
  ]
3390
3766
  },
3391
- "flow:cancel": {
3767
+ "flow:definition": {
3392
3768
  "aliases": [],
3393
3769
  "args": {},
3394
- "description": "Cancel a running or paused flow execution.\n\nCancels a flow context that is in QUEUED, IN_PROGRESS, or WAITING state.",
3770
+ "description": "Retrieve the read-only design-time definition of a flow, subflow, or action.\n\nReturns what the artifact IS, not what a run of it did: triggers, actions, nested subflows, flow logic, inputs and outputs as Workflow Studio stores them. Nothing is executed, published or modified, and no flow context is created or required.\n\nThis is the design-time counterpart to `flow details`, which describes one past execution and needs a context sys_id.\n\nThe type is never inferred from the sys_id: --type selects the artifact that is asked for, and a sys_id of a different type fails with a type_mismatch rather than being relabelled.\n\nWith --json, stdout carries exactly one JSON document — the complete typed result including the untouched ServiceNow payload — so it can be piped or redirected. Without it, a short summary is printed; definition bodies, step scripts and input values are never printed or logged.",
3395
3771
  "examples": [
3396
3772
  {
3397
- "description": "Cancel a running flow",
3398
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
3773
+ "description": "Summarise a flow definition",
3774
+ "command": "<%= config.bin %> <%= command.id %> --sys-id 887dda5583237210fdb8f7b6feaad32c --auth dev"
3399
3775
  },
3400
3776
  {
3401
- "description": "Cancel with a reason",
3402
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --reason \"No longer needed\" --auth dev"
3777
+ "description": "Retrieve a subflow definition",
3778
+ "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type subflow --auth dev"
3779
+ },
3780
+ {
3781
+ "description": "Retrieve a custom action definition with its ordered steps",
3782
+ "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type action --auth dev"
3783
+ },
3784
+ {
3785
+ "description": "Redirect the full JSON definition to a file",
3786
+ "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --json --auth dev > flow.json"
3787
+ },
3788
+ {
3789
+ "description": "Pipe the JSON definition into another tool",
3790
+ "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type action --json --auth dev | jq .summary.steps"
3403
3791
  }
3404
3792
  ],
3405
3793
  "flags": {
3406
3794
  "json": {
3407
3795
  "char": "j",
3408
- "description": "Output results as JSON",
3796
+ "description": "Output the complete typed result as JSON",
3409
3797
  "name": "json",
3410
3798
  "required": false,
3411
3799
  "allowNo": false,
@@ -3485,26 +3873,32 @@
3485
3873
  "allowNo": false,
3486
3874
  "type": "boolean"
3487
3875
  },
3488
- "context-id": {
3489
- "char": "c",
3490
- "description": "Flow execution context sys_id",
3491
- "name": "context-id",
3876
+ "sys-id": {
3877
+ "char": "i",
3878
+ "description": "sys_id of the flow, subflow, or action to retrieve",
3879
+ "name": "sys-id",
3492
3880
  "required": true,
3493
3881
  "hasDynamicHelp": false,
3494
3882
  "multiple": false,
3495
3883
  "type": "option"
3496
3884
  },
3497
- "reason": {
3498
- "char": "r",
3499
- "description": "Cancellation reason",
3500
- "name": "reason",
3885
+ "type": {
3886
+ "char": "t",
3887
+ "description": "Artifact type to retrieve. Must match what the sys_id actually is.",
3888
+ "name": "type",
3501
3889
  "required": false,
3890
+ "default": "flow",
3502
3891
  "hasDynamicHelp": false,
3503
3892
  "multiple": false,
3893
+ "options": [
3894
+ "flow",
3895
+ "subflow",
3896
+ "action"
3897
+ ],
3504
3898
  "type": "option"
3505
3899
  },
3506
3900
  "scope": {
3507
- "description": "Scope context for script execution",
3901
+ "description": "Scope sys_id or name for the transaction scope parameter. Optional — ServiceNow resolves the artifact's own scope when omitted.",
3508
3902
  "name": "scope",
3509
3903
  "required": false,
3510
3904
  "hasDynamicHelp": false,
@@ -3514,7 +3908,7 @@
3514
3908
  },
3515
3909
  "hasDynamicHelp": false,
3516
3910
  "hiddenAliases": [],
3517
- "id": "flow:cancel",
3911
+ "id": "flow:definition",
3518
3912
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3519
3913
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3520
3914
  "pluginType": "core",
@@ -3525,25 +3919,25 @@
3525
3919
  "dist",
3526
3920
  "commands",
3527
3921
  "flow",
3528
- "cancel.js"
3922
+ "definition.js"
3529
3923
  ]
3530
3924
  },
3531
- "flow:copy": {
3925
+ "flow:details": {
3532
3926
  "aliases": [],
3533
3927
  "args": {},
3534
- "description": "Copy an existing flow into a target scoped application.\n\nThis is the ServiceNow best practice before modifying any flow — OOB and shared flows must never be modified directly; always copy first. The copied flow lands in draft/unpublished state in the target scope.\n\nEnables the full CLI-driven flow development lifecycle:\n copy → pull (now-sdk transform) → modify → push → test → publish\n\nFeatures:\n • Copy flows by sys_id or scoped name\n • Specify a display name for the new copy\n • Target any scoped application by sys_id\n • Returns the new flow sys_id for use in subsequent commands",
3928
+ "description": "Get rich execution details for a flow context.\n\nReturns per-action timing, inputs, outputs, and high-level metadata (state, runtime, who ran it, test vs production). This is the primary diagnostic command after flow test or flow run.\n\nUses the ProcessFlow operations API (GET /api/now/processflow/operations/flow/context/{id}), the same endpoint Flow Designer uses to display execution details.\n\nNOTE: Requires flow operations logging to be enabled on the instance. If the execution report is unavailable, a notice will explain why.\n\nTypical workflow:\n flow test → flow details → diagnose → modify flow → flow test again",
3535
3929
  "examples": [
3536
3930
  {
3537
- "description": "Copy an OOB flow into your app scope",
3538
- "command": "<%= config.bin %> <%= command.id %> --source-flow-id e89e3ade731310108ef62d2b04f6a744 --name \"Copy of Change - Standard\" --target-scope 4a5a6115402946939ee48e3fe80f60f8 --auth dev"
3931
+ "description": "Get execution details after testing a flow",
3932
+ "command": "<%= config.bin %> <%= command.id %> --context-id d4e5f6789012345678abcdef01234567 --auth dev"
3539
3933
  },
3540
3934
  {
3541
- "description": "Copy by scoped name",
3542
- "command": "<%= config.bin %> <%= command.id %> -s global.change__standard -n \"My Custom Change Flow\" -t 4a5a6115402946939ee48e3fe80f60f8 --auth dev"
3935
+ "description": "Get details with explicit scope",
3936
+ "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --scope x_myapp --auth dev"
3543
3937
  },
3544
3938
  {
3545
- "description": "Copy with JSON output for scripting",
3546
- "command": "<%= config.bin %> <%= command.id %> -s e89e3ade731310108ef62d2b04f6a744 -n \"Copy\" -t 4a5a6115402946939ee48e3fe80f60f8 --json --auth dev"
3939
+ "description": "Get details with JSON output for scripting",
3940
+ "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --json --auth dev"
3547
3941
  }
3548
3942
  ],
3549
3943
  "flags": {
@@ -3629,37 +4023,35 @@
3629
4023
  "allowNo": false,
3630
4024
  "type": "boolean"
3631
4025
  },
3632
- "source-flow-id": {
3633
- "char": "s",
3634
- "description": "Source flow sys_id or scoped name (e.g. global.change__standard)",
3635
- "name": "source-flow-id",
4026
+ "context-id": {
4027
+ "char": "c",
4028
+ "description": "Flow context sys_id returned by flow test, flow run, flow subflow, or flow action",
4029
+ "name": "context-id",
3636
4030
  "required": true,
3637
4031
  "hasDynamicHelp": false,
3638
4032
  "multiple": false,
3639
4033
  "type": "option"
3640
4034
  },
3641
- "name": {
3642
- "char": "n",
3643
- "description": "Display name for the new copied flow",
3644
- "name": "name",
3645
- "required": true,
4035
+ "scope": {
4036
+ "description": "Scope sys_id for the ProcessFlow API transaction scope parameter",
4037
+ "name": "scope",
4038
+ "required": false,
3646
4039
  "hasDynamicHelp": false,
3647
4040
  "multiple": false,
3648
4041
  "type": "option"
3649
4042
  },
3650
- "target-scope": {
3651
- "char": "t",
3652
- "description": "Scope sys_id of the target application (use `nex scope` to find scope sys_ids)",
3653
- "name": "target-scope",
3654
- "required": true,
3655
- "hasDynamicHelp": false,
3656
- "multiple": false,
3657
- "type": "option"
4043
+ "include-definition": {
4044
+ "char": "d",
4045
+ "description": "Include the full flow definition snapshot in the response",
4046
+ "name": "include-definition",
4047
+ "required": false,
4048
+ "allowNo": false,
4049
+ "type": "boolean"
3658
4050
  }
3659
4051
  },
3660
4052
  "hasDynamicHelp": false,
3661
4053
  "hiddenAliases": [],
3662
- "id": "flow:copy",
4054
+ "id": "flow:details",
3663
4055
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3664
4056
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3665
4057
  "pluginType": "core",
@@ -3670,39 +4062,23 @@
3670
4062
  "dist",
3671
4063
  "commands",
3672
4064
  "flow",
3673
- "copy.js"
4065
+ "details.js"
3674
4066
  ]
3675
4067
  },
3676
- "flow:definition": {
4068
+ "flow:error": {
3677
4069
  "aliases": [],
3678
4070
  "args": {},
3679
- "description": "Retrieve the read-only design-time definition of a flow, subflow, or action.\n\nReturns what the artifact IS, not what a run of it did: triggers, actions, nested subflows, flow logic, inputs and outputs as Workflow Studio stores them. Nothing is executed, published or modified, and no flow context is created or required.\n\nThis is the design-time counterpart to `flow details`, which describes one past execution and needs a context sys_id.\n\nThe type is never inferred from the sys_id: --type selects the artifact that is asked for, and a sys_id of a different type fails with a type_mismatch rather than being relabelled.\n\nWith --json, stdout carries exactly one JSON document — the complete typed result including the untouched ServiceNow payload — so it can be piped or redirected. Without it, a short summary is printed; definition bodies, step scripts and input values are never printed or logged.",
4071
+ "description": "Retrieve error details from a failed flow execution.\n\nGets the error message from a flow context that ended in an error state.",
3680
4072
  "examples": [
3681
4073
  {
3682
- "description": "Summarise a flow definition",
3683
- "command": "<%= config.bin %> <%= command.id %> --sys-id 887dda5583237210fdb8f7b6feaad32c --auth dev"
3684
- },
3685
- {
3686
- "description": "Retrieve a subflow definition",
3687
- "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type subflow --auth dev"
3688
- },
3689
- {
3690
- "description": "Retrieve a custom action definition with its ordered steps",
3691
- "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type action --auth dev"
3692
- },
3693
- {
3694
- "description": "Redirect the full JSON definition to a file",
3695
- "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --json --auth dev > flow.json"
3696
- },
3697
- {
3698
- "description": "Pipe the JSON definition into another tool",
3699
- "command": "<%= config.bin %> <%= command.id %> -i 887dda5583237210fdb8f7b6feaad32c --type action --json --auth dev | jq .summary.steps"
4074
+ "description": "Get flow error details",
4075
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
3700
4076
  }
3701
4077
  ],
3702
4078
  "flags": {
3703
4079
  "json": {
3704
4080
  "char": "j",
3705
- "description": "Output the complete typed result as JSON",
4081
+ "description": "Output results as JSON",
3706
4082
  "name": "json",
3707
4083
  "required": false,
3708
4084
  "allowNo": false,
@@ -3782,32 +4158,17 @@
3782
4158
  "allowNo": false,
3783
4159
  "type": "boolean"
3784
4160
  },
3785
- "sys-id": {
3786
- "char": "i",
3787
- "description": "sys_id of the flow, subflow, or action to retrieve",
3788
- "name": "sys-id",
4161
+ "context-id": {
4162
+ "char": "c",
4163
+ "description": "Flow execution context sys_id",
4164
+ "name": "context-id",
3789
4165
  "required": true,
3790
4166
  "hasDynamicHelp": false,
3791
4167
  "multiple": false,
3792
4168
  "type": "option"
3793
4169
  },
3794
- "type": {
3795
- "char": "t",
3796
- "description": "Artifact type to retrieve. Must match what the sys_id actually is.",
3797
- "name": "type",
3798
- "required": false,
3799
- "default": "flow",
3800
- "hasDynamicHelp": false,
3801
- "multiple": false,
3802
- "options": [
3803
- "flow",
3804
- "subflow",
3805
- "action"
3806
- ],
3807
- "type": "option"
3808
- },
3809
4170
  "scope": {
3810
- "description": "Scope sys_id or name for the transaction scope parameter. Optional — ServiceNow resolves the artifact's own scope when omitted.",
4171
+ "description": "Scope context for script execution",
3811
4172
  "name": "scope",
3812
4173
  "required": false,
3813
4174
  "hasDynamicHelp": false,
@@ -3817,7 +4178,7 @@
3817
4178
  },
3818
4179
  "hasDynamicHelp": false,
3819
4180
  "hiddenAliases": [],
3820
- "id": "flow:definition",
4181
+ "id": "flow:error",
3821
4182
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3822
4183
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3823
4184
  "pluginType": "core",
@@ -3828,24 +4189,24 @@
3828
4189
  "dist",
3829
4190
  "commands",
3830
4191
  "flow",
3831
- "definition.js"
4192
+ "error.js"
3832
4193
  ]
3833
4194
  },
3834
- "flow:details": {
4195
+ "flow:logs": {
3835
4196
  "aliases": [],
3836
4197
  "args": {},
3837
- "description": "Get rich execution details for a flow context.\n\nReturns per-action timing, inputs, outputs, and high-level metadata (state, runtime, who ran it, test vs production). This is the primary diagnostic command after flow test or flow run.\n\nUses the ProcessFlow operations API (GET /api/now/processflow/operations/flow/context/{id}), the same endpoint Flow Designer uses to display execution details.\n\nNOTE: Requires flow operations logging to be enabled on the instance. If the execution report is unavailable, a notice will explain why.\n\nTypical workflow:\n flow test → flow details → diagnose → modify flow → flow test again",
4198
+ "description": "Retrieve flow execution log entries for a given context.\n\nLog entries include error messages, step-level debug output, and cancellation reasons. Use this alongside flow details to get the full picture of what happened during an execution.\n\nQueries sys_flow_log entries and maps numeric log levels to human-readable names (ERROR, WARN, INFO, DEBUG).\n\nNOTE: Log entries may be empty for simple successful executions, or if the flow reporting level is set to NONE. Errors and warnings are always logged regardless of the reporting level setting.",
3838
4199
  "examples": [
3839
4200
  {
3840
- "description": "Get execution details after testing a flow",
4201
+ "description": "Get flow execution logs",
3841
4202
  "command": "<%= config.bin %> <%= command.id %> --context-id d4e5f6789012345678abcdef01234567 --auth dev"
3842
4203
  },
3843
4204
  {
3844
- "description": "Get details with explicit scope",
3845
- "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --scope x_myapp --auth dev"
4205
+ "description": "Get latest 10 log entries in reverse order",
4206
+ "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --limit 10 --order desc --auth dev"
3846
4207
  },
3847
4208
  {
3848
- "description": "Get details with JSON output for scripting",
4209
+ "description": "Get logs with JSON output for scripting",
3849
4210
  "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --json --auth dev"
3850
4211
  }
3851
4212
  ],
@@ -3941,26 +4302,34 @@
3941
4302
  "multiple": false,
3942
4303
  "type": "option"
3943
4304
  },
3944
- "scope": {
3945
- "description": "Scope sys_id for the ProcessFlow API transaction scope parameter",
3946
- "name": "scope",
4305
+ "limit": {
4306
+ "char": "l",
4307
+ "description": "Maximum number of log entries to return",
4308
+ "name": "limit",
3947
4309
  "required": false,
4310
+ "default": 100,
3948
4311
  "hasDynamicHelp": false,
3949
4312
  "multiple": false,
3950
4313
  "type": "option"
3951
4314
  },
3952
- "include-definition": {
3953
- "char": "d",
3954
- "description": "Include the full flow definition snapshot in the response",
3955
- "name": "include-definition",
4315
+ "order": {
4316
+ "char": "o",
4317
+ "description": "Order direction: asc (oldest first) or desc (newest first)",
4318
+ "name": "order",
3956
4319
  "required": false,
3957
- "allowNo": false,
3958
- "type": "boolean"
4320
+ "default": "asc",
4321
+ "hasDynamicHelp": false,
4322
+ "multiple": false,
4323
+ "options": [
4324
+ "asc",
4325
+ "desc"
4326
+ ],
4327
+ "type": "option"
3959
4328
  }
3960
4329
  },
3961
4330
  "hasDynamicHelp": false,
3962
4331
  "hiddenAliases": [],
3963
- "id": "flow:details",
4332
+ "id": "flow:logs",
3964
4333
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3965
4334
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3966
4335
  "pluginType": "core",
@@ -3971,17 +4340,21 @@
3971
4340
  "dist",
3972
4341
  "commands",
3973
4342
  "flow",
3974
- "details.js"
4343
+ "logs.js"
3975
4344
  ]
3976
4345
  },
3977
- "flow:error": {
4346
+ "flow:message": {
3978
4347
  "aliases": [],
3979
4348
  "args": {},
3980
- "description": "Retrieve error details from a failed flow execution.\n\nGets the error message from a flow context that ended in an error state.",
4349
+ "description": "Send a message to a paused flow execution.\n\nSends a message to a flow context that is in a WAITING state (e.g. waiting on a \"Wait for Message\" action). Supports an optional JSON payload.",
3981
4350
  "examples": [
3982
4351
  {
3983
- "description": "Get flow error details",
3984
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
4352
+ "description": "Send a message to resume a waiting flow",
4353
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --message \"approved\" --auth dev"
4354
+ },
4355
+ {
4356
+ "description": "Send a message with a JSON payload",
4357
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --message \"data_ready\" --payload '{\"status\":\"ok\"}' --auth dev"
3985
4358
  }
3986
4359
  ],
3987
4360
  "flags": {
@@ -4076,6 +4449,24 @@
4076
4449
  "multiple": false,
4077
4450
  "type": "option"
4078
4451
  },
4452
+ "message": {
4453
+ "char": "m",
4454
+ "description": "Message to send to the flow",
4455
+ "name": "message",
4456
+ "required": true,
4457
+ "hasDynamicHelp": false,
4458
+ "multiple": false,
4459
+ "type": "option"
4460
+ },
4461
+ "payload": {
4462
+ "char": "p",
4463
+ "description": "Optional JSON payload to include with the message",
4464
+ "name": "payload",
4465
+ "required": false,
4466
+ "hasDynamicHelp": false,
4467
+ "multiple": false,
4468
+ "type": "option"
4469
+ },
4079
4470
  "scope": {
4080
4471
  "description": "Scope context for script execution",
4081
4472
  "name": "scope",
@@ -4087,7 +4478,7 @@
4087
4478
  },
4088
4479
  "hasDynamicHelp": false,
4089
4480
  "hiddenAliases": [],
4090
- "id": "flow:error",
4481
+ "id": "flow:message",
4091
4482
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4092
4483
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4093
4484
  "pluginType": "core",
@@ -4098,25 +4489,21 @@
4098
4489
  "dist",
4099
4490
  "commands",
4100
4491
  "flow",
4101
- "error.js"
4492
+ "message.js"
4102
4493
  ]
4103
4494
  },
4104
- "flow:logs": {
4495
+ "flow:outputs": {
4105
4496
  "aliases": [],
4106
4497
  "args": {},
4107
- "description": "Retrieve flow execution log entries for a given context.\n\nLog entries include error messages, step-level debug output, and cancellation reasons. Use this alongside flow details to get the full picture of what happened during an execution.\n\nQueries sys_flow_log entries and maps numeric log levels to human-readable names (ERROR, WARN, INFO, DEBUG).\n\nNOTE: Log entries may be empty for simple successful executions, or if the flow reporting level is set to NONE. Errors and warnings are always logged regardless of the reporting level setting.",
4498
+ "description": "Retrieve outputs from a completed flow execution.\n\nGets the output name-value pairs from a flow, subflow, or action execution context.",
4108
4499
  "examples": [
4109
4500
  {
4110
- "description": "Get flow execution logs",
4111
- "command": "<%= config.bin %> <%= command.id %> --context-id d4e5f6789012345678abcdef01234567 --auth dev"
4112
- },
4113
- {
4114
- "description": "Get latest 10 log entries in reverse order",
4115
- "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --limit 10 --order desc --auth dev"
4501
+ "description": "Get flow outputs",
4502
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
4116
4503
  },
4117
4504
  {
4118
- "description": "Get logs with JSON output for scripting",
4119
- "command": "<%= config.bin %> <%= command.id %> -c d4e5f6789012345678abcdef01234567 --json --auth dev"
4505
+ "description": "Get outputs as JSON",
4506
+ "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --json --auth dev"
4120
4507
  }
4121
4508
  ],
4122
4509
  "flags": {
@@ -4204,41 +4591,25 @@
4204
4591
  },
4205
4592
  "context-id": {
4206
4593
  "char": "c",
4207
- "description": "Flow context sys_id returned by flow test, flow run, flow subflow, or flow action",
4594
+ "description": "Flow execution context sys_id",
4208
4595
  "name": "context-id",
4209
4596
  "required": true,
4210
4597
  "hasDynamicHelp": false,
4211
4598
  "multiple": false,
4212
4599
  "type": "option"
4213
4600
  },
4214
- "limit": {
4215
- "char": "l",
4216
- "description": "Maximum number of log entries to return",
4217
- "name": "limit",
4218
- "required": false,
4219
- "default": 100,
4220
- "hasDynamicHelp": false,
4221
- "multiple": false,
4222
- "type": "option"
4223
- },
4224
- "order": {
4225
- "char": "o",
4226
- "description": "Order direction: asc (oldest first) or desc (newest first)",
4227
- "name": "order",
4601
+ "scope": {
4602
+ "description": "Scope context for script execution",
4603
+ "name": "scope",
4228
4604
  "required": false,
4229
- "default": "asc",
4230
4605
  "hasDynamicHelp": false,
4231
4606
  "multiple": false,
4232
- "options": [
4233
- "asc",
4234
- "desc"
4235
- ],
4236
4607
  "type": "option"
4237
4608
  }
4238
4609
  },
4239
4610
  "hasDynamicHelp": false,
4240
4611
  "hiddenAliases": [],
4241
- "id": "flow:logs",
4612
+ "id": "flow:outputs",
4242
4613
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4243
4614
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4244
4615
  "pluginType": "core",
@@ -4249,21 +4620,25 @@
4249
4620
  "dist",
4250
4621
  "commands",
4251
4622
  "flow",
4252
- "logs.js"
4623
+ "outputs.js"
4253
4624
  ]
4254
4625
  },
4255
- "flow:message": {
4626
+ "flow:run": {
4256
4627
  "aliases": [],
4257
4628
  "args": {},
4258
- "description": "Send a message to a paused flow execution.\n\nSends a message to a flow context that is in a WAITING state (e.g. waiting on a \"Wait for Message\" action). Supports an optional JSON payload.",
4629
+ "description": "Execute a published Flow Designer flow by scoped name.\n\nRuns a flow using the sn_fd.FlowAPI ScriptableFlowRunner. Supports foreground (synchronous) and background (asynchronous) execution modes.\n\nNote: This command requires the flow to be published. For testing flows that are not yet published (draft/saved state), use `flow test` instead.\n\nFeatures:\n • Execute flows by scoped name (e.g. global.my_flow)\n • Pass input values as JSON\n • Foreground or background execution mode\n • Quick mode to skip execution detail records\n • Returns context ID, outputs, and debug information",
4259
4630
  "examples": [
4260
4631
  {
4261
- "description": "Send a message to resume a waiting flow",
4262
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --message \"approved\" --auth dev"
4632
+ "description": "Run a flow in foreground mode",
4633
+ "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --auth dev"
4263
4634
  },
4264
4635
  {
4265
- "description": "Send a message with a JSON payload",
4266
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --message \"data_ready\" --payload '{\"status\":\"ok\"}' --auth dev"
4636
+ "description": "Run with inputs",
4637
+ "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --inputs '{\"record_sys_id\":\"abc123\"}' --auth dev"
4638
+ },
4639
+ {
4640
+ "description": "Run in background mode",
4641
+ "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --mode background --auth dev"
4267
4642
  }
4268
4643
  ],
4269
4644
  "flags": {
@@ -4349,45 +4724,57 @@
4349
4724
  "allowNo": false,
4350
4725
  "type": "boolean"
4351
4726
  },
4352
- "context-id": {
4353
- "char": "c",
4354
- "description": "Flow execution context sys_id",
4355
- "name": "context-id",
4727
+ "name": {
4728
+ "char": "n",
4729
+ "description": "Scoped name of the flow (e.g. global.my_flow)",
4730
+ "name": "name",
4356
4731
  "required": true,
4357
4732
  "hasDynamicHelp": false,
4358
4733
  "multiple": false,
4359
4734
  "type": "option"
4360
4735
  },
4361
- "message": {
4362
- "char": "m",
4363
- "description": "Message to send to the flow",
4364
- "name": "message",
4365
- "required": true,
4736
+ "inputs": {
4737
+ "char": "i",
4738
+ "description": "JSON object of input name-value pairs",
4739
+ "name": "inputs",
4740
+ "required": false,
4366
4741
  "hasDynamicHelp": false,
4367
4742
  "multiple": false,
4368
4743
  "type": "option"
4369
4744
  },
4370
- "payload": {
4371
- "char": "p",
4372
- "description": "Optional JSON payload to include with the message",
4373
- "name": "payload",
4745
+ "mode": {
4746
+ "char": "m",
4747
+ "description": "Execution mode",
4748
+ "name": "mode",
4374
4749
  "required": false,
4750
+ "default": "foreground",
4375
4751
  "hasDynamicHelp": false,
4376
4752
  "multiple": false,
4753
+ "options": [
4754
+ "foreground",
4755
+ "background"
4756
+ ],
4377
4757
  "type": "option"
4378
4758
  },
4379
4759
  "scope": {
4380
- "description": "Scope context for script execution",
4760
+ "description": "Scope context for script execution (e.g. global, x_myapp)",
4381
4761
  "name": "scope",
4382
4762
  "required": false,
4383
4763
  "hasDynamicHelp": false,
4384
4764
  "multiple": false,
4385
4765
  "type": "option"
4766
+ },
4767
+ "quick": {
4768
+ "description": "Skip execution detail records for better performance",
4769
+ "name": "quick",
4770
+ "required": false,
4771
+ "allowNo": false,
4772
+ "type": "boolean"
4386
4773
  }
4387
4774
  },
4388
4775
  "hasDynamicHelp": false,
4389
4776
  "hiddenAliases": [],
4390
- "id": "flow:message",
4777
+ "id": "flow:run",
4391
4778
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4392
4779
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4393
4780
  "pluginType": "core",
@@ -4398,21 +4785,17 @@
4398
4785
  "dist",
4399
4786
  "commands",
4400
4787
  "flow",
4401
- "message.js"
4788
+ "run.js"
4402
4789
  ]
4403
4790
  },
4404
- "flow:outputs": {
4791
+ "flow:status": {
4405
4792
  "aliases": [],
4406
4793
  "args": {},
4407
- "description": "Retrieve outputs from a completed flow execution.\n\nGets the output name-value pairs from a flow, subflow, or action execution context.",
4794
+ "description": "Get the status of a flow execution context.\n\nQueries sys_flow_context to retrieve the current state of a flow execution.\n\nPossible states: QUEUED, IN_PROGRESS, WAITING, COMPLETE, CANCELLED, ERROR",
4408
4795
  "examples": [
4409
4796
  {
4410
- "description": "Get flow outputs",
4797
+ "description": "Check flow execution status",
4411
4798
  "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
4412
- },
4413
- {
4414
- "description": "Get outputs as JSON",
4415
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --json --auth dev"
4416
4799
  }
4417
4800
  ],
4418
4801
  "flags": {
@@ -4518,7 +4901,7 @@
4518
4901
  },
4519
4902
  "hasDynamicHelp": false,
4520
4903
  "hiddenAliases": [],
4521
- "id": "flow:outputs",
4904
+ "id": "flow:status",
4522
4905
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4523
4906
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4524
4907
  "pluginType": "core",
@@ -4529,25 +4912,21 @@
4529
4912
  "dist",
4530
4913
  "commands",
4531
4914
  "flow",
4532
- "outputs.js"
4915
+ "status.js"
4533
4916
  ]
4534
4917
  },
4535
- "flow:run": {
4918
+ "flow:subflow": {
4536
4919
  "aliases": [],
4537
4920
  "args": {},
4538
- "description": "Execute a published Flow Designer flow by scoped name.\n\nRuns a flow using the sn_fd.FlowAPI ScriptableFlowRunner. Supports foreground (synchronous) and background (asynchronous) execution modes.\n\nNote: This command requires the flow to be published. For testing flows that are not yet published (draft/saved state), use `flow test` instead.\n\nFeatures:\n • Execute flows by scoped name (e.g. global.my_flow)\n • Pass input values as JSON\n • Foreground or background execution mode\n • Quick mode to skip execution detail records\n • Returns context ID, outputs, and debug information",
4921
+ "description": "Execute a published Flow Designer subflow by scoped name.\n\nRuns a subflow using the sn_fd.FlowAPI ScriptableFlowRunner.\n\nNote: This command requires the subflow to be published. For testing flows that are not yet published (draft/saved state), use `flow test` instead.\n\nFeatures:\n • Execute subflows by scoped name\n • Pass input values as JSON\n • Foreground or background execution mode\n • Returns context ID, outputs, and debug information",
4539
4922
  "examples": [
4540
4923
  {
4541
- "description": "Run a flow in foreground mode",
4542
- "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --auth dev"
4924
+ "description": "Run a subflow",
4925
+ "command": "<%= config.bin %> <%= command.id %> --name global.my_subflow --auth dev"
4543
4926
  },
4544
4927
  {
4545
4928
  "description": "Run with inputs",
4546
- "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --inputs '{\"record_sys_id\":\"abc123\"}' --auth dev"
4547
- },
4548
- {
4549
- "description": "Run in background mode",
4550
- "command": "<%= config.bin %> <%= command.id %> --name global.my_flow --mode background --auth dev"
4929
+ "command": "<%= config.bin %> <%= command.id %> --name x_myapp.process_record --inputs '{\"table\":\"incident\",\"sys_id\":\"abc123\"}' --auth dev"
4551
4930
  }
4552
4931
  ],
4553
4932
  "flags": {
@@ -4635,7 +5014,7 @@
4635
5014
  },
4636
5015
  "name": {
4637
5016
  "char": "n",
4638
- "description": "Scoped name of the flow (e.g. global.my_flow)",
5017
+ "description": "Scoped name of the subflow (e.g. global.my_subflow)",
4639
5018
  "name": "name",
4640
5019
  "required": true,
4641
5020
  "hasDynamicHelp": false,
@@ -4666,7 +5045,7 @@
4666
5045
  "type": "option"
4667
5046
  },
4668
5047
  "scope": {
4669
- "description": "Scope context for script execution (e.g. global, x_myapp)",
5048
+ "description": "Scope context for script execution",
4670
5049
  "name": "scope",
4671
5050
  "required": false,
4672
5051
  "hasDynamicHelp": false,
@@ -4683,7 +5062,7 @@
4683
5062
  },
4684
5063
  "hasDynamicHelp": false,
4685
5064
  "hiddenAliases": [],
4686
- "id": "flow:run",
5065
+ "id": "flow:subflow",
4687
5066
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4688
5067
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4689
5068
  "pluginType": "core",
@@ -4694,17 +5073,25 @@
4694
5073
  "dist",
4695
5074
  "commands",
4696
5075
  "flow",
4697
- "run.js"
5076
+ "subflow.js"
4698
5077
  ]
4699
5078
  },
4700
- "flow:status": {
5079
+ "flow:test": {
4701
5080
  "aliases": [],
4702
5081
  "args": {},
4703
- "description": "Get the status of a flow execution context.\n\nQueries sys_flow_context to retrieve the current state of a flow execution.\n\nPossible states: QUEUED, IN_PROGRESS, WAITING, COMPLETE, CANCELLED, ERROR",
5082
+ "description": "Test a Flow Designer flow without requiring it to be published.\n\nInvokes the same API as the \"Test\" button in Flow Designer, running the flow in its current saved (draft) state. Unlike `flow run` which requires a published flow and uses sn_fd.FlowAPI, `flow test` works on unpublished drafts via the ProcessFlow REST API.\n\nFeatures:\n • Test flows by sys_id or scoped name\n • Pass trigger output values as JSON via --output-map\n • Auto-resolves scope from flow definition if not provided\n • Synchronous or asynchronous execution",
4704
5083
  "examples": [
4705
5084
  {
4706
- "description": "Check flow execution status",
4707
- "command": "<%= config.bin %> <%= command.id %> --context-id abc123def456 --auth dev"
5085
+ "description": "Test a flow by sys_id",
5086
+ "command": "<%= config.bin %> <%= command.id %> --flow-id 887dda5583237210fdb8f7b6feaad32c --output-map '{\"current\":\"0ecd7552db252200a6a2b31be0b8f5e6\",\"table_name\":\"change_request\"}' --auth dev"
5087
+ },
5088
+ {
5089
+ "description": "Test a flow by scoped name with explicit scope",
5090
+ "command": "<%= config.bin %> <%= command.id %> -f x_myapp.my_flow -o '{\"current\":\"abc123\",\"table_name\":\"incident\"}' --scope x_myapp --auth dev"
5091
+ },
5092
+ {
5093
+ "description": "Test with JSON output",
5094
+ "command": "<%= config.bin %> <%= command.id %> -f 887dda5583237210fdb8f7b6feaad32c -o '{\"current\":\"abc123\"}' --json --auth dev"
4708
5095
  }
4709
5096
  ],
4710
5097
  "flags": {
@@ -4790,27 +5177,43 @@
4790
5177
  "allowNo": false,
4791
5178
  "type": "boolean"
4792
5179
  },
4793
- "context-id": {
4794
- "char": "c",
4795
- "description": "Flow execution context sys_id",
4796
- "name": "context-id",
5180
+ "flow-id": {
5181
+ "char": "f",
5182
+ "description": "Flow sys_id or scoped name (e.g. x_myapp.my_flow)",
5183
+ "name": "flow-id",
5184
+ "required": true,
5185
+ "hasDynamicHelp": false,
5186
+ "multiple": false,
5187
+ "type": "option"
5188
+ },
5189
+ "output-map": {
5190
+ "char": "o",
5191
+ "description": "JSON mapping of trigger output variable names to test values (e.g. '{\"current\":\"<sys_id>\",\"table_name\":\"change_request\"}')",
5192
+ "name": "output-map",
4797
5193
  "required": true,
4798
5194
  "hasDynamicHelp": false,
4799
5195
  "multiple": false,
4800
5196
  "type": "option"
4801
5197
  },
4802
5198
  "scope": {
4803
- "description": "Scope context for script execution",
5199
+ "description": "Scope sys_id for transaction scope (auto-resolved from flow definition if omitted)",
4804
5200
  "name": "scope",
4805
5201
  "required": false,
4806
5202
  "hasDynamicHelp": false,
4807
5203
  "multiple": false,
4808
5204
  "type": "option"
5205
+ },
5206
+ "synchronous": {
5207
+ "description": "Run test synchronously (default: true)",
5208
+ "name": "synchronous",
5209
+ "required": false,
5210
+ "allowNo": true,
5211
+ "type": "boolean"
4809
5212
  }
4810
5213
  },
4811
5214
  "hasDynamicHelp": false,
4812
5215
  "hiddenAliases": [],
4813
- "id": "flow:status",
5216
+ "id": "flow:test",
4814
5217
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4815
5218
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4816
5219
  "pluginType": "core",
@@ -4821,21 +5224,29 @@
4821
5224
  "dist",
4822
5225
  "commands",
4823
5226
  "flow",
4824
- "status.js"
5227
+ "test.js"
4825
5228
  ]
4826
5229
  },
4827
- "flow:subflow": {
5230
+ "health:check": {
4828
5231
  "aliases": [],
4829
5232
  "args": {},
4830
- "description": "Execute a published Flow Designer subflow by scoped name.\n\nRuns a subflow using the sn_fd.FlowAPI ScriptableFlowRunner.\n\nNote: This command requires the subflow to be published. For testing flows that are not yet published (draft/saved state), use `flow test` instead.\n\nFeatures:\n • Execute subflows by scoped name\n • Pass input values as JSON\n • Foreground or background execution mode\n • Returns context ID, outputs, and debug information",
5233
+ "description": "Run a consolidated health check on a ServiceNow instance.\n\nPerforms comprehensive diagnostics including version info, cluster status, stuck job detection, semaphore counts, and operational record counts.\n\nFeatures:\n • Instance version and build information\n • Cluster node status\n • Stuck job detection with configurable threshold\n • Active semaphore count\n • Operational counts (incidents, changes, problems)\n • Color-coded status indicators\n • JSON output for CI/CD monitoring",
4831
5234
  "examples": [
4832
5235
  {
4833
- "description": "Run a subflow",
4834
- "command": "<%= config.bin %> <%= command.id %> --name global.my_subflow --auth dev"
5236
+ "description": "Run full health check",
5237
+ "command": "<%= config.bin %> <%= command.id %> --auth dev"
4835
5238
  },
4836
5239
  {
4837
- "description": "Run with inputs",
4838
- "command": "<%= config.bin %> <%= command.id %> --name x_myapp.process_record --inputs '{\"table\":\"incident\",\"sys_id\":\"abc123\"}' --auth dev"
5240
+ "description": "Check only version and stuck jobs",
5241
+ "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
5242
+ },
5243
+ {
5244
+ "description": "Health check with custom stuck job threshold",
5245
+ "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
5246
+ },
5247
+ {
5248
+ "description": "Health check as JSON",
5249
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
4839
5250
  }
4840
5251
  ],
4841
5252
  "flags": {
@@ -4921,57 +5332,54 @@
4921
5332
  "allowNo": false,
4922
5333
  "type": "boolean"
4923
5334
  },
4924
- "name": {
4925
- "char": "n",
4926
- "description": "Scoped name of the subflow (e.g. global.my_subflow)",
4927
- "name": "name",
4928
- "required": true,
4929
- "hasDynamicHelp": false,
4930
- "multiple": false,
4931
- "type": "option"
5335
+ "include-version": {
5336
+ "description": "Include instance version information",
5337
+ "name": "include-version",
5338
+ "required": false,
5339
+ "allowNo": true,
5340
+ "type": "boolean"
4932
5341
  },
4933
- "inputs": {
4934
- "char": "i",
4935
- "description": "JSON object of input name-value pairs",
4936
- "name": "inputs",
5342
+ "include-cluster": {
5343
+ "description": "Include cluster node status",
5344
+ "name": "include-cluster",
4937
5345
  "required": false,
4938
- "hasDynamicHelp": false,
4939
- "multiple": false,
4940
- "type": "option"
5346
+ "allowNo": true,
5347
+ "type": "boolean"
4941
5348
  },
4942
- "mode": {
4943
- "char": "m",
4944
- "description": "Execution mode",
4945
- "name": "mode",
5349
+ "include-stuck-jobs": {
5350
+ "description": "Include stuck job detection",
5351
+ "name": "include-stuck-jobs",
4946
5352
  "required": false,
4947
- "default": "foreground",
4948
- "hasDynamicHelp": false,
4949
- "multiple": false,
4950
- "options": [
4951
- "foreground",
4952
- "background"
4953
- ],
4954
- "type": "option"
5353
+ "allowNo": true,
5354
+ "type": "boolean"
4955
5355
  },
4956
- "scope": {
4957
- "description": "Scope context for script execution",
4958
- "name": "scope",
5356
+ "include-semaphores": {
5357
+ "description": "Include active semaphore count",
5358
+ "name": "include-semaphores",
4959
5359
  "required": false,
4960
- "hasDynamicHelp": false,
4961
- "multiple": false,
4962
- "type": "option"
5360
+ "allowNo": true,
5361
+ "type": "boolean"
4963
5362
  },
4964
- "quick": {
4965
- "description": "Skip execution detail records for better performance",
4966
- "name": "quick",
5363
+ "include-operational-counts": {
5364
+ "description": "Include operational record counts (incidents, changes, problems)",
5365
+ "name": "include-operational-counts",
4967
5366
  "required": false,
4968
- "allowNo": false,
5367
+ "allowNo": true,
4969
5368
  "type": "boolean"
5369
+ },
5370
+ "stuck-job-threshold": {
5371
+ "description": "Minutes threshold for a job to be considered stuck",
5372
+ "name": "stuck-job-threshold",
5373
+ "required": false,
5374
+ "default": 30,
5375
+ "hasDynamicHelp": false,
5376
+ "multiple": false,
5377
+ "type": "option"
4970
5378
  }
4971
5379
  },
4972
5380
  "hasDynamicHelp": false,
4973
5381
  "hiddenAliases": [],
4974
- "id": "flow:subflow",
5382
+ "id": "health:check",
4975
5383
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4976
5384
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4977
5385
  "pluginType": "core",
@@ -4981,34 +5389,53 @@
4981
5389
  "relativePath": [
4982
5390
  "dist",
4983
5391
  "commands",
4984
- "flow",
4985
- "subflow.js"
5392
+ "health",
5393
+ "check.js"
4986
5394
  ]
4987
5395
  },
4988
- "flow:test": {
5396
+ "log": {
4989
5397
  "aliases": [],
4990
5398
  "args": {},
4991
- "description": "Test a Flow Designer flow without requiring it to be published.\n\nInvokes the same API as the \"Test\" button in Flow Designer, running the flow in its current saved (draft) state. Unlike `flow run` which requires a published flow and uses sn_fd.FlowAPI, `flow test` works on unpublished drafts via the ProcessFlow REST API.\n\nFeatures:\n • Test flows by sys_id or scoped name\n • Pass trigger output values as JSON via --output-map\n • Auto-resolves scope from flow definition if not provided\n • Synchronous or asynchronous execution",
5399
+ "description": "Tail and monitor ServiceNow system logs in real-time with beautiful formatting.\n\nThis command provides real-time log monitoring with enhanced visual formatting using color-coded output that makes logs easy to scan and understand at a glance. Automatically highlights errors, warnings, success messages, and important keywords.\n\nKey Features:\n • Real-time log tailing (like Unix tail -f)\n • Powerful filtering with multiple operators (CONTAINS, REGEX, EQUALS, etc.)\n • Smart keyword highlighting (errors in red, warnings in yellow, etc.)\n • Beautiful color-coded console output with chalk\n • Export logs to file with automatic appending\n • Fast 1-second default polling interval\n • Timestamps and sequence numbers for each log\n • Graceful shutdown with Ctrl+C\n • Clean output without colors (--no-color flag)\n\nSmart Highlighting:\n • Error terms (error, exception, failed) - highlighted in RED\n • Warning terms (warn, warning, deprecated) - highlighted in YELLOW\n • Success terms (success, completed, done) - highlighted in GREEN\n • System terms (system, user, transaction) - highlighted in BLUE\n\nFiltering:\n • Apply filters using --filter flag with syntax: \"field OPERATOR value\"\n • Supports case-sensitive and case-insensitive operations\n • Multiple filters are combined with AND logic\n • Operators: CONTAINS, CONTAINS_CI, EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI,\n ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_CONTAINS_CI, NOT_EQUALS, NOT_EQUALS_CI\n\nUse Cases:\n • Monitor logs during application development\n • Debug issues in real-time\n • Track system events during deployments\n • Filter logs for specific application or component\n • Quickly spot errors and warnings\n • Collect logs for analysis or audit trails\n\n⚠️ IMPORTANT NOTES:\n • Press Ctrl+C to stop tailing and exit gracefully\n • Log files are created/appended automatically\n • Uses ChannelAjax when available for better performance\n • Default poll interval is 1 second for real-time monitoring",
4992
5400
  "examples": [
4993
5401
  {
4994
- "description": "Test a flow by sys_id",
4995
- "command": "<%= config.bin %> <%= command.id %> --flow-id 887dda5583237210fdb8f7b6feaad32c --output-map '{\"current\":\"0ecd7552db252200a6a2b31be0b8f5e6\",\"table_name\":\"change_request\"}' --auth dev"
5402
+ "description": "Tail all logs in real-time",
5403
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance"
4996
5404
  },
4997
5405
  {
4998
- "description": "Test a flow by scoped name with explicit scope",
4999
- "command": "<%= config.bin %> <%= command.id %> -f x_myapp.my_flow -o '{\"current\":\"abc123\",\"table_name\":\"incident\"}' --scope x_myapp --auth dev"
5406
+ "description": "Tail logs and save to a file",
5407
+ "command": "<%= config.bin %> <%= command.id %> --output ./logs/instance-logs.txt --auth dev-instance"
5000
5408
  },
5001
5409
  {
5002
- "description": "Test with JSON output",
5003
- "command": "<%= config.bin %> <%= command.id %> -f 887dda5583237210fdb8f7b6feaad32c -o '{\"current\":\"abc123\"}' --json --auth dev"
5410
+ "description": "Tail logs with custom polling interval (500ms for faster updates)",
5411
+ "command": "<%= config.bin %> <%= command.id %> --interval 500 --auth dev-instance"
5412
+ },
5413
+ {
5414
+ "description": "Filter logs containing specific text (case-insensitive)",
5415
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS_CI error\" --auth dev-instance"
5416
+ },
5417
+ {
5418
+ "description": "Filter logs with multiple conditions (AND logic)",
5419
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS x_acme_app\" --filter \"message CONTAINS error\" --auth dev-instance"
5420
+ },
5421
+ {
5422
+ "description": "Filter logs using regex pattern",
5423
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message REGEX .*exception.*\" --auth dev-instance"
5424
+ },
5425
+ {
5426
+ "description": "Filter logs by message starting with a pattern",
5427
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message STARTS_WITH [ERROR]\" --auth dev-instance"
5428
+ },
5429
+ {
5430
+ "description": "Tail logs without colored output",
5431
+ "command": "<%= config.bin %> <%= command.id %> --no-color --auth dev-instance"
5004
5432
  }
5005
5433
  ],
5006
5434
  "flags": {
5007
5435
  "json": {
5008
- "char": "j",
5009
- "description": "Output results as JSON",
5436
+ "description": "Format output as json.",
5437
+ "helpGroup": "GLOBAL",
5010
5438
  "name": "json",
5011
- "required": false,
5012
5439
  "allowNo": false,
5013
5440
  "type": "boolean"
5014
5441
  },
@@ -5086,43 +5513,45 @@
5086
5513
  "allowNo": false,
5087
5514
  "type": "boolean"
5088
5515
  },
5089
- "flow-id": {
5090
- "char": "f",
5091
- "description": "Flow sys_id or scoped name (e.g. x_myapp.my_flow)",
5092
- "name": "flow-id",
5093
- "required": true,
5094
- "hasDynamicHelp": false,
5095
- "multiple": false,
5096
- "type": "option"
5097
- },
5098
- "output-map": {
5516
+ "output": {
5099
5517
  "char": "o",
5100
- "description": "JSON mapping of trigger output variable names to test values (e.g. '{\"current\":\"<sys_id>\",\"table_name\":\"change_request\"}')",
5101
- "name": "output-map",
5102
- "required": true,
5518
+ "description": "Output file path to save logs. Creates parent directories if needed.",
5519
+ "name": "output",
5520
+ "required": false,
5103
5521
  "hasDynamicHelp": false,
5104
5522
  "multiple": false,
5105
5523
  "type": "option"
5106
5524
  },
5107
- "scope": {
5108
- "description": "Scope sys_id for transaction scope (auto-resolved from flow definition if omitted)",
5109
- "name": "scope",
5525
+ "interval": {
5526
+ "char": "i",
5527
+ "description": "Polling interval in milliseconds",
5528
+ "name": "interval",
5110
5529
  "required": false,
5530
+ "default": 1000,
5111
5531
  "hasDynamicHelp": false,
5112
5532
  "multiple": false,
5113
5533
  "type": "option"
5114
5534
  },
5115
- "synchronous": {
5116
- "description": "Run test synchronously (default: true)",
5117
- "name": "synchronous",
5535
+ "no-color": {
5536
+ "description": "Disable colored output",
5537
+ "name": "no-color",
5118
5538
  "required": false,
5119
- "allowNo": true,
5539
+ "allowNo": false,
5120
5540
  "type": "boolean"
5541
+ },
5542
+ "filter": {
5543
+ "char": "f",
5544
+ "description": "Filter logs by field and value. Syntax: field OPERATOR value. Operators: CONTAINS, CONTAINS_CI (case-insensitive), EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI, ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_EQUALS. Field defaults to \"message\" if omitted. Multiple filters are combined with AND logic.",
5545
+ "name": "filter",
5546
+ "required": false,
5547
+ "hasDynamicHelp": false,
5548
+ "multiple": true,
5549
+ "type": "option"
5121
5550
  }
5122
5551
  },
5123
5552
  "hasDynamicHelp": false,
5124
5553
  "hiddenAliases": [],
5125
- "id": "flow:test",
5554
+ "id": "log",
5126
5555
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5127
5556
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5128
5557
  "pluginType": "core",
@@ -5132,8 +5561,8 @@
5132
5561
  "relativePath": [
5133
5562
  "dist",
5134
5563
  "commands",
5135
- "flow",
5136
- "test.js"
5564
+ "log",
5565
+ "index.js"
5137
5566
  ]
5138
5567
  },
5139
5568
  "policy:status": {
@@ -9901,288 +10330,30 @@
9901
10330
  "isESM": true,
9902
10331
  "relativePath": [
9903
10332
  "dist",
9904
- "commands",
9905
- "update-set",
9906
- "move.js"
9907
- ]
9908
- },
9909
- "workflow:create": {
9910
- "aliases": [],
9911
- "args": {},
9912
- "description": "Create a complete workflow from a JSON specification file.",
9913
- "examples": [
9914
- {
9915
- "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
9916
- "description": "Create a workflow from a JSON spec file"
9917
- },
9918
- {
9919
- "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
9920
- "description": "Create a workflow and output result as JSON"
9921
- }
9922
- ],
9923
- "flags": {
9924
- "json": {
9925
- "description": "Format output as json.",
9926
- "helpGroup": "GLOBAL",
9927
- "name": "json",
9928
- "allowNo": false,
9929
- "type": "boolean"
9930
- },
9931
- "auth": {
9932
- "char": "a",
9933
- "description": "Auth alias to use.",
9934
- "name": "auth",
9935
- "required": false,
9936
- "hasDynamicHelp": false,
9937
- "multiple": false,
9938
- "type": "option"
9939
- },
9940
- "cred-store": {
9941
- "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
9942
- "helpGroup": "GLOBAL",
9943
- "name": "cred-store",
9944
- "required": false,
9945
- "allowNo": false,
9946
- "type": "boolean"
9947
- },
9948
- "deny-execute": {
9949
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
9950
- "helpGroup": "GLOBAL",
9951
- "name": "deny-execute",
9952
- "required": false,
9953
- "allowNo": false,
9954
- "type": "boolean"
9955
- },
9956
- "deny-write": {
9957
- "description": "Refuse any change to instance data for this invocation.",
9958
- "helpGroup": "GLOBAL",
9959
- "name": "deny-write",
9960
- "required": false,
9961
- "allowNo": false,
9962
- "type": "boolean"
9963
- },
9964
- "log-dir": {
9965
- "description": "Directory to write log files to. Implies --log-file.",
9966
- "helpGroup": "GLOBAL",
9967
- "name": "log-dir",
9968
- "required": false,
9969
- "hasDynamicHelp": false,
9970
- "multiple": false,
9971
- "type": "option"
9972
- },
9973
- "log-file": {
9974
- "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
9975
- "helpGroup": "GLOBAL",
9976
- "name": "log-file",
9977
- "required": false,
9978
- "allowNo": false,
9979
- "type": "boolean"
9980
- },
9981
- "log-level": {
9982
- "helpGroup": "GLOBAL",
9983
- "name": "log-level",
9984
- "summary": "Specify level for logging.",
9985
- "default": "info",
9986
- "hasDynamicHelp": false,
9987
- "multiple": false,
9988
- "options": [
9989
- "debug",
9990
- "warn",
9991
- "error",
9992
- "info",
9993
- "trace"
9994
- ],
9995
- "type": "option"
9996
- },
9997
- "read-only": {
9998
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
9999
- "helpGroup": "GLOBAL",
10000
- "name": "read-only",
10001
- "required": false,
10002
- "allowNo": false,
10003
- "type": "boolean"
10004
- },
10005
- "spec": {
10006
- "char": "s",
10007
- "description": "Path to workflow JSON specification file",
10008
- "name": "spec",
10009
- "required": true,
10010
- "hasDynamicHelp": false,
10011
- "multiple": false,
10012
- "type": "option"
10013
- }
10014
- },
10015
- "hasDynamicHelp": false,
10016
- "hiddenAliases": [],
10017
- "id": "workflow:create",
10018
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10019
- "pluginName": "@sonisoft/now-sdk-ext-cli",
10020
- "pluginType": "core",
10021
- "strict": true,
10022
- "enableJsonFlag": true,
10023
- "isESM": true,
10024
- "relativePath": [
10025
- "dist",
10026
- "commands",
10027
- "workflow",
10028
- "create.js"
10029
- ]
10030
- },
10031
- "workflow:publish": {
10032
- "aliases": [],
10033
- "args": {},
10034
- "description": "Publish a workflow version.",
10035
- "examples": [
10036
- {
10037
- "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
10038
- "description": "Publish a workflow version"
10039
- },
10040
- {
10041
- "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
10042
- "description": "Publish a workflow version and output as JSON"
10043
- }
10044
- ],
10045
- "flags": {
10046
- "json": {
10047
- "description": "Format output as json.",
10048
- "helpGroup": "GLOBAL",
10049
- "name": "json",
10050
- "allowNo": false,
10051
- "type": "boolean"
10052
- },
10053
- "auth": {
10054
- "char": "a",
10055
- "description": "Auth alias to use.",
10056
- "name": "auth",
10057
- "required": false,
10058
- "hasDynamicHelp": false,
10059
- "multiple": false,
10060
- "type": "option"
10061
- },
10062
- "cred-store": {
10063
- "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
10064
- "helpGroup": "GLOBAL",
10065
- "name": "cred-store",
10066
- "required": false,
10067
- "allowNo": false,
10068
- "type": "boolean"
10069
- },
10070
- "deny-execute": {
10071
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
10072
- "helpGroup": "GLOBAL",
10073
- "name": "deny-execute",
10074
- "required": false,
10075
- "allowNo": false,
10076
- "type": "boolean"
10077
- },
10078
- "deny-write": {
10079
- "description": "Refuse any change to instance data for this invocation.",
10080
- "helpGroup": "GLOBAL",
10081
- "name": "deny-write",
10082
- "required": false,
10083
- "allowNo": false,
10084
- "type": "boolean"
10085
- },
10086
- "log-dir": {
10087
- "description": "Directory to write log files to. Implies --log-file.",
10088
- "helpGroup": "GLOBAL",
10089
- "name": "log-dir",
10090
- "required": false,
10091
- "hasDynamicHelp": false,
10092
- "multiple": false,
10093
- "type": "option"
10094
- },
10095
- "log-file": {
10096
- "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
10097
- "helpGroup": "GLOBAL",
10098
- "name": "log-file",
10099
- "required": false,
10100
- "allowNo": false,
10101
- "type": "boolean"
10102
- },
10103
- "log-level": {
10104
- "helpGroup": "GLOBAL",
10105
- "name": "log-level",
10106
- "summary": "Specify level for logging.",
10107
- "default": "info",
10108
- "hasDynamicHelp": false,
10109
- "multiple": false,
10110
- "options": [
10111
- "debug",
10112
- "warn",
10113
- "error",
10114
- "info",
10115
- "trace"
10116
- ],
10117
- "type": "option"
10118
- },
10119
- "read-only": {
10120
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
10121
- "helpGroup": "GLOBAL",
10122
- "name": "read-only",
10123
- "required": false,
10124
- "allowNo": false,
10125
- "type": "boolean"
10126
- },
10127
- "start-activity": {
10128
- "char": "s",
10129
- "description": "Sys ID of the start activity",
10130
- "name": "start-activity",
10131
- "required": true,
10132
- "hasDynamicHelp": false,
10133
- "multiple": false,
10134
- "type": "option"
10135
- },
10136
- "version-id": {
10137
- "char": "v",
10138
- "description": "Sys ID of the workflow version to publish",
10139
- "name": "version-id",
10140
- "required": true,
10141
- "hasDynamicHelp": false,
10142
- "multiple": false,
10143
- "type": "option"
10144
- }
10145
- },
10146
- "hasDynamicHelp": false,
10147
- "hiddenAliases": [],
10148
- "id": "workflow:publish",
10149
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10150
- "pluginName": "@sonisoft/now-sdk-ext-cli",
10151
- "pluginType": "core",
10152
- "strict": true,
10153
- "enableJsonFlag": true,
10154
- "isESM": true,
10155
- "relativePath": [
10156
- "dist",
10157
- "commands",
10158
- "workflow",
10159
- "publish.js"
10333
+ "commands",
10334
+ "update-set",
10335
+ "move.js"
10160
10336
  ]
10161
10337
  },
10162
- "xml:export": {
10338
+ "workflow:create": {
10163
10339
  "aliases": [],
10164
10340
  "args": {},
10165
- "description": "Export a single ServiceNow record as XML.\n\nDownloads the XML representation of a specific record from a ServiceNow table. Without --output, the XML is printed to stdout. With --output, the XML is written to the specified file path.\n\nFeatures:\n • Export any record by table and sys_id\n • Print XML to stdout for piping to other tools\n • Save directly to a file with --output\n • JSON output mode for CI/CD integration",
10341
+ "description": "Create a complete workflow from a JSON specification file.",
10166
10342
  "examples": [
10167
10343
  {
10168
- "description": "Export a record to stdout",
10169
- "command": "<%= config.bin %> <%= command.id %> --table sys_script_include --sys-id abc123def456 --auth dev"
10170
- },
10171
- {
10172
- "description": "Export and save to a file",
10173
- "command": "<%= config.bin %> <%= command.id %> --table incident --sys-id abc123 --output ./export.xml --auth dev"
10344
+ "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
10345
+ "description": "Create a workflow from a JSON spec file"
10174
10346
  },
10175
10347
  {
10176
- "description": "Export as JSON metadata",
10177
- "command": "<%= config.bin %> <%= command.id %> --table sys_script --sys-id abc123 --json --auth dev"
10348
+ "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
10349
+ "description": "Create a workflow and output result as JSON"
10178
10350
  }
10179
10351
  ],
10180
10352
  "flags": {
10181
10353
  "json": {
10182
- "char": "j",
10183
- "description": "Output results as JSON",
10354
+ "description": "Format output as json.",
10355
+ "helpGroup": "GLOBAL",
10184
10356
  "name": "json",
10185
- "required": false,
10186
10357
  "allowNo": false,
10187
10358
  "type": "boolean"
10188
10359
  },
@@ -10260,37 +10431,19 @@
10260
10431
  "allowNo": false,
10261
10432
  "type": "boolean"
10262
10433
  },
10263
- "table": {
10264
- "char": "t",
10265
- "description": "Table name of the record to export",
10266
- "name": "table",
10267
- "required": true,
10268
- "hasDynamicHelp": false,
10269
- "multiple": false,
10270
- "type": "option"
10271
- },
10272
- "sys-id": {
10434
+ "spec": {
10273
10435
  "char": "s",
10274
- "description": "Sys ID of the record to export",
10275
- "name": "sys-id",
10436
+ "description": "Path to workflow JSON specification file",
10437
+ "name": "spec",
10276
10438
  "required": true,
10277
10439
  "hasDynamicHelp": false,
10278
10440
  "multiple": false,
10279
10441
  "type": "option"
10280
- },
10281
- "output": {
10282
- "char": "o",
10283
- "description": "File path to write the exported XML to. If omitted, XML is printed to stdout.",
10284
- "name": "output",
10285
- "required": false,
10286
- "hasDynamicHelp": false,
10287
- "multiple": false,
10288
- "type": "option"
10289
10442
  }
10290
10443
  },
10291
10444
  "hasDynamicHelp": false,
10292
10445
  "hiddenAliases": [],
10293
- "id": "xml:export",
10446
+ "id": "workflow:create",
10294
10447
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10295
10448
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10296
10449
  "pluginType": "core",
@@ -10300,30 +10453,29 @@
10300
10453
  "relativePath": [
10301
10454
  "dist",
10302
10455
  "commands",
10303
- "xml",
10304
- "export.js"
10456
+ "workflow",
10457
+ "create.js"
10305
10458
  ]
10306
10459
  },
10307
- "xml:import": {
10460
+ "workflow:publish": {
10308
10461
  "aliases": [],
10309
10462
  "args": {},
10310
- "description": "Import XML records into a ServiceNow instance.\n\nReads an XML file and imports its contents into the specified target table. The XML should be in ServiceNow unload format.\n\nFeatures:\n • Import from local XML files\n • Target a specific table\n • JSON output mode for CI/CD integration",
10463
+ "description": "Publish a workflow version.",
10311
10464
  "examples": [
10312
10465
  {
10313
- "description": "Import records from an XML file",
10314
- "command": "<%= config.bin %> <%= command.id %> --file ./export.xml --table sys_script_include --auth dev"
10466
+ "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
10467
+ "description": "Publish a workflow version"
10315
10468
  },
10316
10469
  {
10317
- "description": "Import with JSON output",
10318
- "command": "<%= config.bin %> <%= command.id %> --file ./records.xml --table incident --json --auth dev"
10470
+ "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
10471
+ "description": "Publish a workflow version and output as JSON"
10319
10472
  }
10320
10473
  ],
10321
10474
  "flags": {
10322
10475
  "json": {
10323
- "char": "j",
10324
- "description": "Output results as JSON",
10476
+ "description": "Format output as json.",
10477
+ "helpGroup": "GLOBAL",
10325
10478
  "name": "json",
10326
- "required": false,
10327
10479
  "allowNo": false,
10328
10480
  "type": "boolean"
10329
10481
  },
@@ -10401,19 +10553,19 @@
10401
10553
  "allowNo": false,
10402
10554
  "type": "boolean"
10403
10555
  },
10404
- "file": {
10405
- "char": "f",
10406
- "description": "Path to the XML file to import",
10407
- "name": "file",
10556
+ "start-activity": {
10557
+ "char": "s",
10558
+ "description": "Sys ID of the start activity",
10559
+ "name": "start-activity",
10408
10560
  "required": true,
10409
10561
  "hasDynamicHelp": false,
10410
10562
  "multiple": false,
10411
10563
  "type": "option"
10412
10564
  },
10413
- "table": {
10414
- "char": "t",
10415
- "description": "Target table to import records into",
10416
- "name": "table",
10565
+ "version-id": {
10566
+ "char": "v",
10567
+ "description": "Sys ID of the workflow version to publish",
10568
+ "name": "version-id",
10417
10569
  "required": true,
10418
10570
  "hasDynamicHelp": false,
10419
10571
  "multiple": false,
@@ -10422,7 +10574,7 @@
10422
10574
  },
10423
10575
  "hasDynamicHelp": false,
10424
10576
  "hiddenAliases": [],
10425
- "id": "xml:import",
10577
+ "id": "workflow:publish",
10426
10578
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10427
10579
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10428
10580
  "pluginType": "core",
@@ -10432,53 +10584,34 @@
10432
10584
  "relativePath": [
10433
10585
  "dist",
10434
10586
  "commands",
10435
- "xml",
10436
- "import.js"
10587
+ "workflow",
10588
+ "publish.js"
10437
10589
  ]
10438
10590
  },
10439
- "log": {
10591
+ "xml:export": {
10440
10592
  "aliases": [],
10441
10593
  "args": {},
10442
- "description": "Tail and monitor ServiceNow system logs in real-time with beautiful formatting.\n\nThis command provides real-time log monitoring with enhanced visual formatting using color-coded output that makes logs easy to scan and understand at a glance. Automatically highlights errors, warnings, success messages, and important keywords.\n\nKey Features:\n • Real-time log tailing (like Unix tail -f)\n • Powerful filtering with multiple operators (CONTAINS, REGEX, EQUALS, etc.)\n • Smart keyword highlighting (errors in red, warnings in yellow, etc.)\n • Beautiful color-coded console output with chalk\n • Export logs to file with automatic appending\n • Fast 1-second default polling interval\n • Timestamps and sequence numbers for each log\n • Graceful shutdown with Ctrl+C\n • Clean output without colors (--no-color flag)\n\nSmart Highlighting:\n • Error terms (error, exception, failed) - highlighted in RED\n • Warning terms (warn, warning, deprecated) - highlighted in YELLOW\n • Success terms (success, completed, done) - highlighted in GREEN\n • System terms (system, user, transaction) - highlighted in BLUE\n\nFiltering:\n • Apply filters using --filter flag with syntax: \"field OPERATOR value\"\n • Supports case-sensitive and case-insensitive operations\n • Multiple filters are combined with AND logic\n • Operators: CONTAINS, CONTAINS_CI, EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI,\n ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_CONTAINS_CI, NOT_EQUALS, NOT_EQUALS_CI\n\nUse Cases:\n • Monitor logs during application development\n • Debug issues in real-time\n • Track system events during deployments\n • Filter logs for specific application or component\n • Quickly spot errors and warnings\n • Collect logs for analysis or audit trails\n\n⚠️ IMPORTANT NOTES:\n • Press Ctrl+C to stop tailing and exit gracefully\n • Log files are created/appended automatically\n • Uses ChannelAjax when available for better performance\n • Default poll interval is 1 second for real-time monitoring",
10594
+ "description": "Export a single ServiceNow record as XML.\n\nDownloads the XML representation of a specific record from a ServiceNow table. Without --output, the XML is printed to stdout. With --output, the XML is written to the specified file path.\n\nFeatures:\n • Export any record by table and sys_id\n • Print XML to stdout for piping to other tools\n • Save directly to a file with --output\n • JSON output mode for CI/CD integration",
10443
10595
  "examples": [
10444
10596
  {
10445
- "description": "Tail all logs in real-time",
10446
- "command": "<%= config.bin %> <%= command.id %> --auth dev-instance"
10447
- },
10448
- {
10449
- "description": "Tail logs and save to a file",
10450
- "command": "<%= config.bin %> <%= command.id %> --output ./logs/instance-logs.txt --auth dev-instance"
10451
- },
10452
- {
10453
- "description": "Tail logs with custom polling interval (500ms for faster updates)",
10454
- "command": "<%= config.bin %> <%= command.id %> --interval 500 --auth dev-instance"
10455
- },
10456
- {
10457
- "description": "Filter logs containing specific text (case-insensitive)",
10458
- "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS_CI error\" --auth dev-instance"
10459
- },
10460
- {
10461
- "description": "Filter logs with multiple conditions (AND logic)",
10462
- "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS x_acme_app\" --filter \"message CONTAINS error\" --auth dev-instance"
10463
- },
10464
- {
10465
- "description": "Filter logs using regex pattern",
10466
- "command": "<%= config.bin %> <%= command.id %> --filter \"message REGEX .*exception.*\" --auth dev-instance"
10597
+ "description": "Export a record to stdout",
10598
+ "command": "<%= config.bin %> <%= command.id %> --table sys_script_include --sys-id abc123def456 --auth dev"
10467
10599
  },
10468
10600
  {
10469
- "description": "Filter logs by message starting with a pattern",
10470
- "command": "<%= config.bin %> <%= command.id %> --filter \"message STARTS_WITH [ERROR]\" --auth dev-instance"
10601
+ "description": "Export and save to a file",
10602
+ "command": "<%= config.bin %> <%= command.id %> --table incident --sys-id abc123 --output ./export.xml --auth dev"
10471
10603
  },
10472
10604
  {
10473
- "description": "Tail logs without colored output",
10474
- "command": "<%= config.bin %> <%= command.id %> --no-color --auth dev-instance"
10605
+ "description": "Export as JSON metadata",
10606
+ "command": "<%= config.bin %> <%= command.id %> --table sys_script --sys-id abc123 --json --auth dev"
10475
10607
  }
10476
10608
  ],
10477
10609
  "flags": {
10478
10610
  "json": {
10479
- "description": "Format output as json.",
10480
- "helpGroup": "GLOBAL",
10611
+ "char": "j",
10612
+ "description": "Output results as JSON",
10481
10613
  "name": "json",
10614
+ "required": false,
10482
10615
  "allowNo": false,
10483
10616
  "type": "boolean"
10484
10617
  },
@@ -10556,45 +10689,37 @@
10556
10689
  "allowNo": false,
10557
10690
  "type": "boolean"
10558
10691
  },
10559
- "output": {
10560
- "char": "o",
10561
- "description": "Output file path to save logs. Creates parent directories if needed.",
10562
- "name": "output",
10563
- "required": false,
10692
+ "table": {
10693
+ "char": "t",
10694
+ "description": "Table name of the record to export",
10695
+ "name": "table",
10696
+ "required": true,
10564
10697
  "hasDynamicHelp": false,
10565
10698
  "multiple": false,
10566
10699
  "type": "option"
10567
10700
  },
10568
- "interval": {
10569
- "char": "i",
10570
- "description": "Polling interval in milliseconds",
10571
- "name": "interval",
10572
- "required": false,
10573
- "default": 1000,
10701
+ "sys-id": {
10702
+ "char": "s",
10703
+ "description": "Sys ID of the record to export",
10704
+ "name": "sys-id",
10705
+ "required": true,
10574
10706
  "hasDynamicHelp": false,
10575
10707
  "multiple": false,
10576
10708
  "type": "option"
10577
10709
  },
10578
- "no-color": {
10579
- "description": "Disable colored output",
10580
- "name": "no-color",
10581
- "required": false,
10582
- "allowNo": false,
10583
- "type": "boolean"
10584
- },
10585
- "filter": {
10586
- "char": "f",
10587
- "description": "Filter logs by field and value. Syntax: field OPERATOR value. Operators: CONTAINS, CONTAINS_CI (case-insensitive), EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI, ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_EQUALS. Field defaults to \"message\" if omitted. Multiple filters are combined with AND logic.",
10588
- "name": "filter",
10710
+ "output": {
10711
+ "char": "o",
10712
+ "description": "File path to write the exported XML to. If omitted, XML is printed to stdout.",
10713
+ "name": "output",
10589
10714
  "required": false,
10590
10715
  "hasDynamicHelp": false,
10591
- "multiple": true,
10716
+ "multiple": false,
10592
10717
  "type": "option"
10593
10718
  }
10594
10719
  },
10595
10720
  "hasDynamicHelp": false,
10596
10721
  "hiddenAliases": [],
10597
- "id": "log",
10722
+ "id": "xml:export",
10598
10723
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10599
10724
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10600
10725
  "pluginType": "core",
@@ -10604,30 +10729,22 @@
10604
10729
  "relativePath": [
10605
10730
  "dist",
10606
10731
  "commands",
10607
- "log",
10608
- "index.js"
10732
+ "xml",
10733
+ "export.js"
10609
10734
  ]
10610
10735
  },
10611
- "health:check": {
10736
+ "xml:import": {
10612
10737
  "aliases": [],
10613
10738
  "args": {},
10614
- "description": "Run a consolidated health check on a ServiceNow instance.\n\nPerforms comprehensive diagnostics including version info, cluster status, stuck job detection, semaphore counts, and operational record counts.\n\nFeatures:\n • Instance version and build information\n • Cluster node status\n • Stuck job detection with configurable threshold\n • Active semaphore count\n • Operational counts (incidents, changes, problems)\n • Color-coded status indicators\n • JSON output for CI/CD monitoring",
10739
+ "description": "Import XML records into a ServiceNow instance.\n\nReads an XML file and imports its contents into the specified target table. The XML should be in ServiceNow unload format.\n\nFeatures:\n • Import from local XML files\n • Target a specific table\n • JSON output mode for CI/CD integration",
10615
10740
  "examples": [
10616
10741
  {
10617
- "description": "Run full health check",
10618
- "command": "<%= config.bin %> <%= command.id %> --auth dev"
10619
- },
10620
- {
10621
- "description": "Check only version and stuck jobs",
10622
- "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
10623
- },
10624
- {
10625
- "description": "Health check with custom stuck job threshold",
10626
- "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
10742
+ "description": "Import records from an XML file",
10743
+ "command": "<%= config.bin %> <%= command.id %> --file ./export.xml --table sys_script_include --auth dev"
10627
10744
  },
10628
10745
  {
10629
- "description": "Health check as JSON",
10630
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
10746
+ "description": "Import with JSON output",
10747
+ "command": "<%= config.bin %> <%= command.id %> --file ./records.xml --table incident --json --auth dev"
10631
10748
  }
10632
10749
  ],
10633
10750
  "flags": {
@@ -10713,46 +10830,20 @@
10713
10830
  "allowNo": false,
10714
10831
  "type": "boolean"
10715
10832
  },
10716
- "include-version": {
10717
- "description": "Include instance version information",
10718
- "name": "include-version",
10719
- "required": false,
10720
- "allowNo": true,
10721
- "type": "boolean"
10722
- },
10723
- "include-cluster": {
10724
- "description": "Include cluster node status",
10725
- "name": "include-cluster",
10726
- "required": false,
10727
- "allowNo": true,
10728
- "type": "boolean"
10729
- },
10730
- "include-stuck-jobs": {
10731
- "description": "Include stuck job detection",
10732
- "name": "include-stuck-jobs",
10733
- "required": false,
10734
- "allowNo": true,
10735
- "type": "boolean"
10736
- },
10737
- "include-semaphores": {
10738
- "description": "Include active semaphore count",
10739
- "name": "include-semaphores",
10740
- "required": false,
10741
- "allowNo": true,
10742
- "type": "boolean"
10743
- },
10744
- "include-operational-counts": {
10745
- "description": "Include operational record counts (incidents, changes, problems)",
10746
- "name": "include-operational-counts",
10747
- "required": false,
10748
- "allowNo": true,
10749
- "type": "boolean"
10833
+ "file": {
10834
+ "char": "f",
10835
+ "description": "Path to the XML file to import",
10836
+ "name": "file",
10837
+ "required": true,
10838
+ "hasDynamicHelp": false,
10839
+ "multiple": false,
10840
+ "type": "option"
10750
10841
  },
10751
- "stuck-job-threshold": {
10752
- "description": "Minutes threshold for a job to be considered stuck",
10753
- "name": "stuck-job-threshold",
10754
- "required": false,
10755
- "default": 30,
10842
+ "table": {
10843
+ "char": "t",
10844
+ "description": "Target table to import records into",
10845
+ "name": "table",
10846
+ "required": true,
10756
10847
  "hasDynamicHelp": false,
10757
10848
  "multiple": false,
10758
10849
  "type": "option"
@@ -10760,7 +10851,7 @@
10760
10851
  },
10761
10852
  "hasDynamicHelp": false,
10762
10853
  "hiddenAliases": [],
10763
- "id": "health:check",
10854
+ "id": "xml:import",
10764
10855
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10765
10856
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10766
10857
  "pluginType": "core",
@@ -10770,10 +10861,10 @@
10770
10861
  "relativePath": [
10771
10862
  "dist",
10772
10863
  "commands",
10773
- "health",
10774
- "check.js"
10864
+ "xml",
10865
+ "import.js"
10775
10866
  ]
10776
10867
  }
10777
10868
  },
10778
- "version": "5.6.0"
10869
+ "version": "5.7.0"
10779
10870
  }