@sonisoft/now-sdk-ext-cli 5.4.0 → 5.5.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.
@@ -513,240 +513,6 @@
513
513
  "query.js"
514
514
  ]
515
515
  },
516
- "atf": {
517
- "aliases": [],
518
- "args": {},
519
- "description": "Execute ATF (Automated Test Framework) tests or test suites on a ServiceNow instance.\n\nThis command allows you to run automated tests and test suites remotely, making it perfect for CI/CD pipelines and automated testing workflows. You can execute individual tests, entire test suites, and configure execution parameters such as browser type, OS, and performance mode.\n\nFeatures:\n • Execute individual tests or complete test suites\n • Real-time progress monitoring\n • JSON output for CI/CD integration\n • Detailed test results and summaries\n • Browser and environment configuration\n • Performance testing mode support",
520
- "examples": [
521
- {
522
- "description": "Execute a single ATF test by sys_id",
523
- "command": "<%= config.bin %> <%= command.id %> --test-id f717a8c783103210621e78c6feaad396 --auth dev-instance"
524
- },
525
- {
526
- "description": "Execute a test suite by sys_id and wait for completion",
527
- "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --auth dev-instance --wait"
528
- },
529
- {
530
- "description": "Execute a test suite by name",
531
- "command": "<%= config.bin %> <%= command.id %> --suite-name \"Smoke Tests\" --auth dev-instance"
532
- },
533
- {
534
- "description": "Execute with specific browser configuration",
535
- "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --browser chrome --auth dev-instance"
536
- },
537
- {
538
- "description": "Execute as performance test with JSON output for CI/CD",
539
- "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --performance --json --auth dev-instance"
540
- },
541
- {
542
- "description": "Execute with custom poll interval (10 seconds)",
543
- "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --poll-interval 10000 --auth dev-instance"
544
- }
545
- ],
546
- "flags": {
547
- "json": {
548
- "char": "j",
549
- "description": "Output results as JSON",
550
- "name": "json",
551
- "required": false,
552
- "allowNo": false,
553
- "type": "boolean"
554
- },
555
- "auth": {
556
- "char": "a",
557
- "description": "Auth alias to use.",
558
- "name": "auth",
559
- "required": false,
560
- "hasDynamicHelp": false,
561
- "multiple": false,
562
- "type": "option"
563
- },
564
- "cred-store": {
565
- "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.",
566
- "helpGroup": "GLOBAL",
567
- "name": "cred-store",
568
- "required": false,
569
- "allowNo": false,
570
- "type": "boolean"
571
- },
572
- "deny-execute": {
573
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
574
- "helpGroup": "GLOBAL",
575
- "name": "deny-execute",
576
- "required": false,
577
- "allowNo": false,
578
- "type": "boolean"
579
- },
580
- "deny-write": {
581
- "description": "Refuse any change to instance data for this invocation.",
582
- "helpGroup": "GLOBAL",
583
- "name": "deny-write",
584
- "required": false,
585
- "allowNo": false,
586
- "type": "boolean"
587
- },
588
- "log-dir": {
589
- "description": "Directory to write log files to. Implies --log-file.",
590
- "helpGroup": "GLOBAL",
591
- "name": "log-dir",
592
- "required": false,
593
- "hasDynamicHelp": false,
594
- "multiple": false,
595
- "type": "option"
596
- },
597
- "log-file": {
598
- "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.",
599
- "helpGroup": "GLOBAL",
600
- "name": "log-file",
601
- "required": false,
602
- "allowNo": false,
603
- "type": "boolean"
604
- },
605
- "log-level": {
606
- "helpGroup": "GLOBAL",
607
- "name": "log-level",
608
- "summary": "Specify level for logging.",
609
- "default": "info",
610
- "hasDynamicHelp": false,
611
- "multiple": false,
612
- "options": [
613
- "debug",
614
- "warn",
615
- "error",
616
- "info",
617
- "trace"
618
- ],
619
- "type": "option"
620
- },
621
- "read-only": {
622
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
623
- "helpGroup": "GLOBAL",
624
- "name": "read-only",
625
- "required": false,
626
- "allowNo": false,
627
- "type": "boolean"
628
- },
629
- "test-id": {
630
- "char": "t",
631
- "description": "Test sys_id to execute",
632
- "exclusive": [
633
- "suite-id",
634
- "suite-name"
635
- ],
636
- "name": "test-id",
637
- "required": false,
638
- "hasDynamicHelp": false,
639
- "multiple": false,
640
- "type": "option"
641
- },
642
- "suite-id": {
643
- "char": "s",
644
- "description": "Test Suite sys_id to execute",
645
- "exclusive": [
646
- "test-id",
647
- "suite-name"
648
- ],
649
- "name": "suite-id",
650
- "required": false,
651
- "hasDynamicHelp": false,
652
- "multiple": false,
653
- "type": "option"
654
- },
655
- "suite-name": {
656
- "char": "n",
657
- "description": "Test Suite name to execute",
658
- "exclusive": [
659
- "test-id",
660
- "suite-id"
661
- ],
662
- "name": "suite-name",
663
- "required": false,
664
- "hasDynamicHelp": false,
665
- "multiple": false,
666
- "type": "option"
667
- },
668
- "wait": {
669
- "char": "w",
670
- "description": "Wait for test suite execution to complete and return results",
671
- "name": "wait",
672
- "required": false,
673
- "allowNo": false,
674
- "type": "boolean"
675
- },
676
- "poll-interval": {
677
- "char": "p",
678
- "description": "Polling interval in milliseconds when waiting for completion",
679
- "name": "poll-interval",
680
- "required": false,
681
- "default": 5000,
682
- "hasDynamicHelp": false,
683
- "multiple": false,
684
- "type": "option"
685
- },
686
- "browser": {
687
- "char": "b",
688
- "description": "Browser name for test execution (e.g., chrome, firefox)",
689
- "name": "browser",
690
- "required": false,
691
- "hasDynamicHelp": false,
692
- "multiple": false,
693
- "type": "option"
694
- },
695
- "browser-version": {
696
- "description": "Browser version for test execution",
697
- "name": "browser-version",
698
- "required": false,
699
- "hasDynamicHelp": false,
700
- "multiple": false,
701
- "type": "option"
702
- },
703
- "os-name": {
704
- "description": "Operating system name for test execution",
705
- "name": "os-name",
706
- "required": false,
707
- "hasDynamicHelp": false,
708
- "multiple": false,
709
- "type": "option"
710
- },
711
- "os-version": {
712
- "description": "Operating system version for test execution",
713
- "name": "os-version",
714
- "required": false,
715
- "hasDynamicHelp": false,
716
- "multiple": false,
717
- "type": "option"
718
- },
719
- "performance": {
720
- "description": "Run as performance test",
721
- "name": "performance",
722
- "required": false,
723
- "allowNo": false,
724
- "type": "boolean"
725
- },
726
- "cloud": {
727
- "description": "Run in cloud",
728
- "name": "cloud",
729
- "required": false,
730
- "allowNo": false,
731
- "type": "boolean"
732
- }
733
- },
734
- "hasDynamicHelp": false,
735
- "hiddenAliases": [],
736
- "id": "atf",
737
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
738
- "pluginName": "@sonisoft/now-sdk-ext-cli",
739
- "pluginType": "core",
740
- "strict": true,
741
- "enableJsonFlag": true,
742
- "isESM": true,
743
- "relativePath": [
744
- "dist",
745
- "commands",
746
- "atf",
747
- "index.js"
748
- ]
749
- },
750
516
  "app": {
751
517
  "aliases": [],
752
518
  "args": {},
@@ -1471,29 +1237,263 @@
1471
1237
  "uninstall.js"
1472
1238
  ]
1473
1239
  },
1474
- "attachment:get": {
1240
+ "atf": {
1475
1241
  "aliases": [],
1476
1242
  "args": {},
1477
- "description": "Get metadata for a specific attachment.",
1243
+ "description": "Execute ATF (Automated Test Framework) tests or test suites on a ServiceNow instance.\n\nThis command allows you to run automated tests and test suites remotely, making it perfect for CI/CD pipelines and automated testing workflows. You can execute individual tests, entire test suites, and configure execution parameters such as browser type, OS, and performance mode.\n\nFeatures:\n • Execute individual tests or complete test suites\n • Real-time progress monitoring\n • JSON output for CI/CD integration\n • Detailed test results and summaries\n • Browser and environment configuration\n • Performance testing mode support",
1478
1244
  "examples": [
1479
1245
  {
1480
- "command": "<%= config.bin %> <%= command.id %> --sys-id att123 --auth dev",
1481
- "description": "Get attachment metadata by sys_id"
1246
+ "description": "Execute a single ATF test by sys_id",
1247
+ "command": "<%= config.bin %> <%= command.id %> --test-id f717a8c783103210621e78c6feaad396 --auth dev-instance"
1482
1248
  },
1483
1249
  {
1484
- "command": "<%= config.bin %> <%= command.id %> -s att123 --json --auth dev",
1485
- "description": "Get attachment metadata as JSON"
1486
- }
1487
- ],
1488
- "flags": {
1489
- "json": {
1490
- "description": "Format output as json.",
1491
- "helpGroup": "GLOBAL",
1492
- "name": "json",
1493
- "allowNo": false,
1494
- "type": "boolean"
1250
+ "description": "Execute a test suite by sys_id and wait for completion",
1251
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --auth dev-instance --wait"
1495
1252
  },
1496
- "auth": {
1253
+ {
1254
+ "description": "Execute a test suite by name",
1255
+ "command": "<%= config.bin %> <%= command.id %> --suite-name \"Smoke Tests\" --auth dev-instance"
1256
+ },
1257
+ {
1258
+ "description": "Execute with specific browser configuration",
1259
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --browser chrome --auth dev-instance"
1260
+ },
1261
+ {
1262
+ "description": "Execute as performance test with JSON output for CI/CD",
1263
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --performance --json --auth dev-instance"
1264
+ },
1265
+ {
1266
+ "description": "Execute with custom poll interval (10 seconds)",
1267
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --poll-interval 10000 --auth dev-instance"
1268
+ }
1269
+ ],
1270
+ "flags": {
1271
+ "json": {
1272
+ "char": "j",
1273
+ "description": "Output results as JSON",
1274
+ "name": "json",
1275
+ "required": false,
1276
+ "allowNo": false,
1277
+ "type": "boolean"
1278
+ },
1279
+ "auth": {
1280
+ "char": "a",
1281
+ "description": "Auth alias to use.",
1282
+ "name": "auth",
1283
+ "required": false,
1284
+ "hasDynamicHelp": false,
1285
+ "multiple": false,
1286
+ "type": "option"
1287
+ },
1288
+ "cred-store": {
1289
+ "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.",
1290
+ "helpGroup": "GLOBAL",
1291
+ "name": "cred-store",
1292
+ "required": false,
1293
+ "allowNo": false,
1294
+ "type": "boolean"
1295
+ },
1296
+ "deny-execute": {
1297
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
1298
+ "helpGroup": "GLOBAL",
1299
+ "name": "deny-execute",
1300
+ "required": false,
1301
+ "allowNo": false,
1302
+ "type": "boolean"
1303
+ },
1304
+ "deny-write": {
1305
+ "description": "Refuse any change to instance data for this invocation.",
1306
+ "helpGroup": "GLOBAL",
1307
+ "name": "deny-write",
1308
+ "required": false,
1309
+ "allowNo": false,
1310
+ "type": "boolean"
1311
+ },
1312
+ "log-dir": {
1313
+ "description": "Directory to write log files to. Implies --log-file.",
1314
+ "helpGroup": "GLOBAL",
1315
+ "name": "log-dir",
1316
+ "required": false,
1317
+ "hasDynamicHelp": false,
1318
+ "multiple": false,
1319
+ "type": "option"
1320
+ },
1321
+ "log-file": {
1322
+ "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.",
1323
+ "helpGroup": "GLOBAL",
1324
+ "name": "log-file",
1325
+ "required": false,
1326
+ "allowNo": false,
1327
+ "type": "boolean"
1328
+ },
1329
+ "log-level": {
1330
+ "helpGroup": "GLOBAL",
1331
+ "name": "log-level",
1332
+ "summary": "Specify level for logging.",
1333
+ "default": "info",
1334
+ "hasDynamicHelp": false,
1335
+ "multiple": false,
1336
+ "options": [
1337
+ "debug",
1338
+ "warn",
1339
+ "error",
1340
+ "info",
1341
+ "trace"
1342
+ ],
1343
+ "type": "option"
1344
+ },
1345
+ "read-only": {
1346
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
1347
+ "helpGroup": "GLOBAL",
1348
+ "name": "read-only",
1349
+ "required": false,
1350
+ "allowNo": false,
1351
+ "type": "boolean"
1352
+ },
1353
+ "test-id": {
1354
+ "char": "t",
1355
+ "description": "Test sys_id to execute",
1356
+ "exclusive": [
1357
+ "suite-id",
1358
+ "suite-name"
1359
+ ],
1360
+ "name": "test-id",
1361
+ "required": false,
1362
+ "hasDynamicHelp": false,
1363
+ "multiple": false,
1364
+ "type": "option"
1365
+ },
1366
+ "suite-id": {
1367
+ "char": "s",
1368
+ "description": "Test Suite sys_id to execute",
1369
+ "exclusive": [
1370
+ "test-id",
1371
+ "suite-name"
1372
+ ],
1373
+ "name": "suite-id",
1374
+ "required": false,
1375
+ "hasDynamicHelp": false,
1376
+ "multiple": false,
1377
+ "type": "option"
1378
+ },
1379
+ "suite-name": {
1380
+ "char": "n",
1381
+ "description": "Test Suite name to execute",
1382
+ "exclusive": [
1383
+ "test-id",
1384
+ "suite-id"
1385
+ ],
1386
+ "name": "suite-name",
1387
+ "required": false,
1388
+ "hasDynamicHelp": false,
1389
+ "multiple": false,
1390
+ "type": "option"
1391
+ },
1392
+ "wait": {
1393
+ "char": "w",
1394
+ "description": "Wait for test suite execution to complete and return results",
1395
+ "name": "wait",
1396
+ "required": false,
1397
+ "allowNo": false,
1398
+ "type": "boolean"
1399
+ },
1400
+ "poll-interval": {
1401
+ "char": "p",
1402
+ "description": "Polling interval in milliseconds when waiting for completion",
1403
+ "name": "poll-interval",
1404
+ "required": false,
1405
+ "default": 5000,
1406
+ "hasDynamicHelp": false,
1407
+ "multiple": false,
1408
+ "type": "option"
1409
+ },
1410
+ "browser": {
1411
+ "char": "b",
1412
+ "description": "Browser name for test execution (e.g., chrome, firefox)",
1413
+ "name": "browser",
1414
+ "required": false,
1415
+ "hasDynamicHelp": false,
1416
+ "multiple": false,
1417
+ "type": "option"
1418
+ },
1419
+ "browser-version": {
1420
+ "description": "Browser version for test execution",
1421
+ "name": "browser-version",
1422
+ "required": false,
1423
+ "hasDynamicHelp": false,
1424
+ "multiple": false,
1425
+ "type": "option"
1426
+ },
1427
+ "os-name": {
1428
+ "description": "Operating system name for test execution",
1429
+ "name": "os-name",
1430
+ "required": false,
1431
+ "hasDynamicHelp": false,
1432
+ "multiple": false,
1433
+ "type": "option"
1434
+ },
1435
+ "os-version": {
1436
+ "description": "Operating system version for test execution",
1437
+ "name": "os-version",
1438
+ "required": false,
1439
+ "hasDynamicHelp": false,
1440
+ "multiple": false,
1441
+ "type": "option"
1442
+ },
1443
+ "performance": {
1444
+ "description": "Run as performance test",
1445
+ "name": "performance",
1446
+ "required": false,
1447
+ "allowNo": false,
1448
+ "type": "boolean"
1449
+ },
1450
+ "cloud": {
1451
+ "description": "Run in cloud",
1452
+ "name": "cloud",
1453
+ "required": false,
1454
+ "allowNo": false,
1455
+ "type": "boolean"
1456
+ }
1457
+ },
1458
+ "hasDynamicHelp": false,
1459
+ "hiddenAliases": [],
1460
+ "id": "atf",
1461
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
1462
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
1463
+ "pluginType": "core",
1464
+ "strict": true,
1465
+ "enableJsonFlag": true,
1466
+ "isESM": true,
1467
+ "relativePath": [
1468
+ "dist",
1469
+ "commands",
1470
+ "atf",
1471
+ "index.js"
1472
+ ]
1473
+ },
1474
+ "attachment:get": {
1475
+ "aliases": [],
1476
+ "args": {},
1477
+ "description": "Get metadata for a specific attachment.",
1478
+ "examples": [
1479
+ {
1480
+ "command": "<%= config.bin %> <%= command.id %> --sys-id att123 --auth dev",
1481
+ "description": "Get attachment metadata by sys_id"
1482
+ },
1483
+ {
1484
+ "command": "<%= config.bin %> <%= command.id %> -s att123 --json --auth dev",
1485
+ "description": "Get attachment metadata as JSON"
1486
+ }
1487
+ ],
1488
+ "flags": {
1489
+ "json": {
1490
+ "description": "Format output as json.",
1491
+ "helpGroup": "GLOBAL",
1492
+ "name": "json",
1493
+ "allowNo": false,
1494
+ "type": "boolean"
1495
+ },
1496
+ "auth": {
1497
1497
  "char": "a",
1498
1498
  "description": "Auth alias to use.",
1499
1499
  "name": "auth",
@@ -1881,199 +1881,10 @@
1881
1881
  "upload.js"
1882
1882
  ]
1883
1883
  },
1884
- "auth:delete": {
1884
+ "batch:create": {
1885
1885
  "aliases": [],
1886
- "args": {
1887
- "alias": {
1888
- "description": "Alias to remove",
1889
- "name": "alias",
1890
- "required": false
1891
- }
1892
- },
1893
- "description": "Remove a credential from the store.\n\nThis does not touch the OS keyring — a copy stored there before migrating remains.",
1894
- "examples": [
1895
- {
1896
- "command": "<%= config.bin %> <%= command.id %> dev206299",
1897
- "description": "Remove one alias"
1898
- },
1899
- {
1900
- "command": "<%= config.bin %> <%= command.id %> --all",
1901
- "description": "Remove every stored credential"
1902
- }
1903
- ],
1904
- "flags": {
1905
- "cred-store": {
1906
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
1907
- "helpGroup": "GLOBAL",
1908
- "name": "cred-store",
1909
- "required": false,
1910
- "allowNo": false,
1911
- "type": "boolean"
1912
- },
1913
- "all": {
1914
- "description": "Remove every stored credential",
1915
- "name": "all",
1916
- "required": false,
1917
- "allowNo": false,
1918
- "type": "boolean"
1919
- }
1920
- },
1921
- "hasDynamicHelp": false,
1922
- "hiddenAliases": [],
1923
- "id": "auth:delete",
1924
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
1925
- "pluginName": "@sonisoft/now-sdk-ext-cli",
1926
- "pluginType": "core",
1927
- "strict": true,
1928
- "enableJsonFlag": false,
1929
- "isESM": true,
1930
- "relativePath": [
1931
- "dist",
1932
- "commands",
1933
- "auth",
1934
- "delete.js"
1935
- ]
1936
- },
1937
- "auth:doctor": {
1938
- "aliases": [],
1939
- "args": {},
1940
- "description": "Diagnose credential storage: whether the SDK shim is active, which backend is in use, and what is stored.",
1941
- "examples": [
1942
- {
1943
- "command": "<%= config.bin %> <%= command.id %>",
1944
- "description": "Check credential storage health"
1945
- },
1946
- {
1947
- "command": "<%= config.bin %> <%= command.id %> --json",
1948
- "description": "Machine-readable output for CI"
1949
- }
1950
- ],
1951
- "flags": {
1952
- "json": {
1953
- "description": "Format output as json.",
1954
- "helpGroup": "GLOBAL",
1955
- "name": "json",
1956
- "allowNo": false,
1957
- "type": "boolean"
1958
- },
1959
- "cred-store": {
1960
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
1961
- "helpGroup": "GLOBAL",
1962
- "name": "cred-store",
1963
- "required": false,
1964
- "allowNo": false,
1965
- "type": "boolean"
1966
- }
1967
- },
1968
- "hasDynamicHelp": false,
1969
- "hiddenAliases": [],
1970
- "id": "auth:doctor",
1971
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
1972
- "pluginName": "@sonisoft/now-sdk-ext-cli",
1973
- "pluginType": "core",
1974
- "strict": true,
1975
- "enableJsonFlag": true,
1976
- "isESM": true,
1977
- "relativePath": [
1978
- "dist",
1979
- "commands",
1980
- "auth",
1981
- "doctor.js"
1982
- ]
1983
- },
1984
- "auth:list": {
1985
- "aliases": [],
1986
- "args": {},
1987
- "description": "List credentials in the headless-safe credential store.\n\nThese are the credentials the ServiceNow SDK reads via the sn-credstore shim, which works in non-interactive sessions where the OS keyring cannot be unlocked.\n\nSecrets are never printed.",
1988
- "examples": [
1989
- {
1990
- "command": "<%= config.bin %> <%= command.id %>",
1991
- "description": "List stored credentials"
1992
- },
1993
- {
1994
- "command": "<%= config.bin %> <%= command.id %> --json",
1995
- "description": "List as JSON for scripting"
1996
- }
1997
- ],
1998
- "flags": {
1999
- "json": {
2000
- "description": "Format output as json.",
2001
- "helpGroup": "GLOBAL",
2002
- "name": "json",
2003
- "allowNo": false,
2004
- "type": "boolean"
2005
- },
2006
- "cred-store": {
2007
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
2008
- "helpGroup": "GLOBAL",
2009
- "name": "cred-store",
2010
- "required": false,
2011
- "allowNo": false,
2012
- "type": "boolean"
2013
- }
2014
- },
2015
- "hasDynamicHelp": false,
2016
- "hiddenAliases": [],
2017
- "id": "auth:list",
2018
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2019
- "pluginName": "@sonisoft/now-sdk-ext-cli",
2020
- "pluginType": "core",
2021
- "strict": true,
2022
- "enableJsonFlag": true,
2023
- "isESM": true,
2024
- "relativePath": [
2025
- "dist",
2026
- "commands",
2027
- "auth",
2028
- "list.js"
2029
- ]
2030
- },
2031
- "auth:use": {
2032
- "aliases": [],
2033
- "args": {
2034
- "alias": {
2035
- "description": "Alias to make the default",
2036
- "name": "alias",
2037
- "required": true
2038
- }
2039
- },
2040
- "description": "Set the default credential alias.\n\nCommands run without --auth use this alias.",
2041
- "examples": [
2042
- {
2043
- "command": "<%= config.bin %> <%= command.id %> dev206299",
2044
- "description": "Make dev206299 the default"
2045
- }
2046
- ],
2047
- "flags": {
2048
- "cred-store": {
2049
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
2050
- "helpGroup": "GLOBAL",
2051
- "name": "cred-store",
2052
- "required": false,
2053
- "allowNo": false,
2054
- "type": "boolean"
2055
- }
2056
- },
2057
- "hasDynamicHelp": false,
2058
- "hiddenAliases": [],
2059
- "id": "auth:use",
2060
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2061
- "pluginName": "@sonisoft/now-sdk-ext-cli",
2062
- "pluginType": "core",
2063
- "strict": true,
2064
- "enableJsonFlag": false,
2065
- "isESM": true,
2066
- "relativePath": [
2067
- "dist",
2068
- "commands",
2069
- "auth",
2070
- "use.js"
2071
- ]
2072
- },
2073
- "batch:create": {
2074
- "aliases": [],
2075
- "args": {},
2076
- "description": "Batch create records on a ServiceNow instance from a JSON file.",
1886
+ "args": {},
1887
+ "description": "Batch create records on a ServiceNow instance from a JSON file.",
2077
1888
  "examples": [
2078
1889
  {
2079
1890
  "command": "<%= config.bin %> <%= command.id %> --file ./records.json --auth dev",
@@ -2328,34 +2139,17 @@
2328
2139
  "update.js"
2329
2140
  ]
2330
2141
  },
2331
- "bulk:delete": {
2142
+ "behavior:details": {
2332
2143
  "aliases": [],
2333
2144
  "args": {},
2334
- "description": "Bulk delete records matching an encoded query.\n\nFinds all records in a table matching the given query, then deletes each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without deleting)\n • Encoded query filtering\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2145
+ "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>.",
2335
2146
  "examples": [
2336
- {
2337
- "description": "Dry run — see how many records would be deleted",
2338
- "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --auth dev"
2339
- },
2340
- {
2341
- "description": "Execute the delete (requires --confirm)",
2342
- "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --confirm --auth dev"
2343
- },
2344
- {
2345
- "description": "Delete with custom limit",
2346
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=false^closed_at<2023-01-01\" --limit 1000 --confirm --auth dev"
2347
- },
2348
- {
2349
- "description": "Delete as JSON output",
2350
- "command": "<%= config.bin %> <%= command.id %> --table u_staging --query \"processed=true\" --confirm --json --auth dev"
2351
- }
2147
+ "<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json"
2352
2148
  ],
2353
2149
  "flags": {
2354
2150
  "json": {
2355
- "char": "j",
2356
- "description": "Output results as JSON",
2151
+ "description": "Emit one JSON document",
2357
2152
  "name": "json",
2358
- "required": false,
2359
2153
  "allowNo": false,
2360
2154
  "type": "boolean"
2361
2155
  },
@@ -2433,45 +2227,53 @@
2433
2227
  "allowNo": false,
2434
2228
  "type": "boolean"
2435
2229
  },
2436
- "table": {
2437
- "char": "t",
2438
- "description": "Table name to delete records from",
2439
- "name": "table",
2440
- "required": true,
2230
+ "dependency-depth": {
2231
+ "description": "Expand one dependency level; requires --details dependencies",
2232
+ "name": "dependency-depth",
2233
+ "default": 0,
2441
2234
  "hasDynamicHelp": false,
2442
2235
  "multiple": false,
2443
2236
  "type": "option"
2444
2237
  },
2445
- "query": {
2446
- "char": "q",
2447
- "description": "Encoded query to match records for deletion",
2448
- "name": "query",
2449
- "required": true,
2238
+ "details": {
2239
+ "description": "Include selected detail now; repeat for multiple kinds",
2240
+ "name": "details",
2450
2241
  "hasDynamicHelp": false,
2451
- "multiple": false,
2242
+ "multiple": true,
2243
+ "options": [
2244
+ "scripts",
2245
+ "definitions",
2246
+ "dependencies"
2247
+ ],
2452
2248
  "type": "option"
2453
2249
  },
2454
- "confirm": {
2455
- "description": "Execute the delete (without this flag, performs a dry run)",
2456
- "name": "confirm",
2457
- "required": false,
2458
- "allowNo": false,
2459
- "type": "boolean"
2250
+ "max-bytes": {
2251
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2252
+ "name": "max-bytes",
2253
+ "default": 65536,
2254
+ "hasDynamicHelp": false,
2255
+ "multiple": false,
2256
+ "type": "option"
2460
2257
  },
2461
- "limit": {
2462
- "char": "l",
2463
- "description": "Maximum number of records to delete (default 200, max 10000)",
2464
- "name": "limit",
2465
- "required": false,
2466
- "default": 200,
2258
+ "scope": {
2259
+ "description": "Transaction scope for flow definition reads",
2260
+ "name": "scope",
2467
2261
  "hasDynamicHelp": false,
2468
2262
  "multiple": false,
2469
2263
  "type": "option"
2264
+ },
2265
+ "reference": {
2266
+ "description": "kind:source_table:sys_id; repeat for a batch",
2267
+ "name": "reference",
2268
+ "required": true,
2269
+ "hasDynamicHelp": false,
2270
+ "multiple": true,
2271
+ "type": "option"
2470
2272
  }
2471
2273
  },
2472
2274
  "hasDynamicHelp": false,
2473
2275
  "hiddenAliases": [],
2474
- "id": "bulk:delete",
2276
+ "id": "behavior:details",
2475
2277
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2476
2278
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2477
2279
  "pluginType": "core",
@@ -2481,40 +2283,24 @@
2481
2283
  "relativePath": [
2482
2284
  "dist",
2483
2285
  "commands",
2484
- "bulk",
2485
- "delete.js"
2286
+ "behavior",
2287
+ "details.js"
2486
2288
  ]
2487
2289
  },
2488
- "bulk:update": {
2290
+ "behavior": {
2489
2291
  "aliases": [],
2490
2292
  "args": {},
2491
- "description": "Bulk update records matching an encoded query.\n\nFinds all records in a table matching the given query, then applies field updates to each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without modifying data)\n • Encoded query filtering\n • JSON field=value pairs for update data\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2293
+ "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.",
2492
2294
  "examples": [
2493
- {
2494
- "description": "Dry run — see how many records would be updated",
2495
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --auth dev"
2496
- },
2497
- {
2498
- "description": "Execute the update (requires --confirm)",
2499
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --confirm --auth dev"
2500
- },
2501
- {
2502
- "description": "Update with custom limit",
2503
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"state=1\" --data '{\"assignment_group\":\"group-sys-id\"}' --limit 500 --confirm --auth dev"
2504
- },
2505
- {
2506
- "description": "Update as JSON output",
2507
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --data '{\"state\":\"6\"}' --confirm --json --auth dev"
2508
- }
2509
- ],
2510
- "flags": {
2511
- "json": {
2512
- "char": "j",
2513
- "description": "Output results as JSON",
2514
- "name": "json",
2515
- "required": false,
2516
- "allowNo": false,
2517
- "type": "boolean"
2295
+ "<%= config.bin %> <%= command.id %> --table incident --auth dev --json",
2296
+ "<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json"
2297
+ ],
2298
+ "flags": {
2299
+ "json": {
2300
+ "description": "Emit one JSON document",
2301
+ "name": "json",
2302
+ "allowNo": false,
2303
+ "type": "boolean"
2518
2304
  },
2519
2305
  "auth": {
2520
2306
  "char": "a",
@@ -2590,46 +2376,104 @@
2590
2376
  "allowNo": false,
2591
2377
  "type": "boolean"
2592
2378
  },
2593
- "table": {
2594
- "char": "t",
2595
- "description": "Table name to update records in",
2596
- "name": "table",
2597
- "required": true,
2379
+ "dependency-depth": {
2380
+ "description": "Expand one dependency level; requires --details dependencies",
2381
+ "name": "dependency-depth",
2382
+ "default": 0,
2598
2383
  "hasDynamicHelp": false,
2599
2384
  "multiple": false,
2600
2385
  "type": "option"
2601
2386
  },
2602
- "query": {
2603
- "char": "q",
2604
- "description": "Encoded query to match records",
2605
- "name": "query",
2606
- "required": true,
2387
+ "details": {
2388
+ "description": "Include selected detail now; repeat for multiple kinds",
2389
+ "name": "details",
2390
+ "hasDynamicHelp": false,
2391
+ "multiple": true,
2392
+ "options": [
2393
+ "scripts",
2394
+ "definitions",
2395
+ "dependencies"
2396
+ ],
2397
+ "type": "option"
2398
+ },
2399
+ "max-bytes": {
2400
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2401
+ "name": "max-bytes",
2402
+ "default": 65536,
2607
2403
  "hasDynamicHelp": false,
2608
2404
  "multiple": false,
2609
2405
  "type": "option"
2610
2406
  },
2611
- "data": {
2612
- "char": "d",
2613
- "description": "JSON object of field=value pairs to apply (e.g. '{\"priority\":\"4\",\"state\":\"2\"}')",
2614
- "name": "data",
2615
- "required": true,
2407
+ "scope": {
2408
+ "description": "Transaction scope for flow definition reads",
2409
+ "name": "scope",
2616
2410
  "hasDynamicHelp": false,
2617
2411
  "multiple": false,
2618
2412
  "type": "option"
2619
2413
  },
2620
- "confirm": {
2621
- "description": "Execute the update (without this flag, performs a dry run)",
2622
- "name": "confirm",
2623
- "required": false,
2414
+ "category": {
2415
+ "description": "Category to inspect; repeat to select several, default all",
2416
+ "name": "category",
2417
+ "hasDynamicHelp": false,
2418
+ "multiple": true,
2419
+ "options": [
2420
+ "business_rules",
2421
+ "ui_actions",
2422
+ "client_scripts",
2423
+ "ui_policies",
2424
+ "data_policies",
2425
+ "workflows",
2426
+ "flows",
2427
+ "state_models"
2428
+ ],
2429
+ "type": "option"
2430
+ },
2431
+ "cursor": {
2432
+ "description": "Continuation token; requires exactly one --category and the same filters",
2433
+ "name": "cursor",
2434
+ "hasDynamicHelp": false,
2435
+ "multiple": false,
2436
+ "type": "option"
2437
+ },
2438
+ "include-inactive": {
2439
+ "description": "Include inactive/published and draft candidates when discoverable",
2440
+ "name": "include-inactive",
2624
2441
  "allowNo": false,
2625
2442
  "type": "boolean"
2626
2443
  },
2444
+ "include-inherited": {
2445
+ "description": "Include applicable ancestor behavior",
2446
+ "name": "include-inherited",
2447
+ "allowNo": true,
2448
+ "type": "boolean"
2449
+ },
2627
2450
  "limit": {
2628
- "char": "l",
2629
- "description": "Maximum number of records to update (default 200, max 10000)",
2451
+ "description": "Maximum items per category",
2630
2452
  "name": "limit",
2631
- "required": false,
2632
- "default": 200,
2453
+ "default": 50,
2454
+ "hasDynamicHelp": false,
2455
+ "multiple": false,
2456
+ "type": "option"
2457
+ },
2458
+ "name": {
2459
+ "description": "Metadata name contains this text",
2460
+ "name": "name",
2461
+ "hasDynamicHelp": false,
2462
+ "multiple": false,
2463
+ "type": "option"
2464
+ },
2465
+ "sys-id": {
2466
+ "description": "Metadata source sys_id to include; repeat for multiple records",
2467
+ "name": "sys-id",
2468
+ "hasDynamicHelp": false,
2469
+ "multiple": true,
2470
+ "type": "option"
2471
+ },
2472
+ "table": {
2473
+ "char": "t",
2474
+ "description": "Target table name",
2475
+ "name": "table",
2476
+ "required": true,
2633
2477
  "hasDynamicHelp": false,
2634
2478
  "multiple": false,
2635
2479
  "type": "option"
@@ -2637,7 +2481,7 @@
2637
2481
  },
2638
2482
  "hasDynamicHelp": false,
2639
2483
  "hiddenAliases": [],
2640
- "id": "bulk:update",
2484
+ "id": "behavior",
2641
2485
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2642
2486
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2643
2487
  "pluginType": "core",
@@ -2647,72 +2491,38 @@
2647
2491
  "relativePath": [
2648
2492
  "dist",
2649
2493
  "commands",
2650
- "bulk",
2651
- "update.js"
2494
+ "behavior",
2495
+ "index.js"
2652
2496
  ]
2653
2497
  },
2654
- "exec": {
2498
+ "bulk:delete": {
2655
2499
  "aliases": [],
2656
- "args": {
2657
- "scope": {
2658
- "description": "Scope to execute script in. Use \"global\" for global scope.",
2659
- "name": "scope",
2660
- "required": true
2661
- },
2662
- "file": {
2663
- "description": "File to execute in scripts background. If omitted, starts REPL mode.",
2664
- "name": "file",
2665
- "required": false
2666
- }
2667
- },
2668
- "description": "Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.\n\nThis command allows you to run JavaScript either from files or interactively via REPL mode. It mimics the functionality of the Scripts - Background interface in ServiceNow, providing a way to execute scripts programmatically without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.\n\nModes:\n • File Mode: Provide a file path to execute scripts from a file\n • REPL Mode: Omit the file path to start an interactive session\n\nFeatures:\n • Execute local JavaScript files remotely\n • Interactive REPL for ad-hoc script execution\n • Script parameterization with {placeholder} replacement\n • Multi-line script support in REPL\n • Scope-aware execution (global or custom scope)\n • Real-time console output capture\n • Pipe-able output for command chaining\n • Debug logging support\n • Useful for data migration, testing, and administrative tasks\n\nScript Parameterization:\n Use {paramName} placeholders in your script files, then provide values via --params:\n • Supports any JSON-serializable values (strings, numbers, booleans)\n • Multiple parameters supported\n • All occurrences of each placeholder are replaced\n • Example: {token}, {username}, {environment}\n\nREPL Controls:\n • Press Enter to add a new line\n • Type .exec or press Ctrl+D to execute the script\n • Type .clear to clear the current input\n • Type .exit or press Ctrl+C twice to exit REPL\n\n⚠️ IMPORTANT SECURITY WARNING:\nThis command executes scripts with the same permissions and risks as using Scripts - Background directly\nin ServiceNow. Always:\n • Review scripts before execution\n • Test in non-production environments first\n • Use appropriate scoping to limit access\n • Be aware of data modification risks\n • Follow your organization's security policies\n • Never execute untrusted scripts\n\nScript Capabilities:\n Scripts run with full GlideSystem API access and can:\n • Query and modify database records\n • Create, update, and delete data\n • Execute business rules and workflows\n • Access all APIs available in Scripts - Background\n • Use gs, GlideRecord, GlideAggregate, and other server-side APIs",
2500
+ "args": {},
2501
+ "description": "Bulk delete records matching an encoded query.\n\nFinds all records in a table matching the given query, then deletes each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without deleting)\n • Encoded query filtering\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2669
2502
  "examples": [
2670
2503
  {
2671
- "description": "Start REPL in global scope",
2672
- "command": "<%= config.bin %> <%= command.id %> global --auth dev-instance"
2673
- },
2674
- {
2675
- "description": "Start REPL in custom application scope",
2676
- "command": "<%= config.bin %> <%= command.id %> x_my_custom_app --auth dev-instance"
2677
- },
2678
- {
2679
- "description": "Execute a script file in global scope",
2680
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/cleanup.js --auth dev-instance"
2681
- },
2682
- {
2683
- "description": "Execute a script file in a custom application scope",
2684
- "command": "<%= config.bin %> <%= command.id %> x_my_custom_app ./scripts/app-config.js --auth dev-instance"
2685
- },
2686
- {
2687
- "description": "Execute a parameterized script with single parameter",
2688
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/query-user.js --auth dev-instance --params '{\"username\":\"admin\"}'"
2689
- },
2690
- {
2691
- "description": "Execute a parameterized script with multiple parameters",
2692
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/update-record.js --auth dev-instance --params '{\"table\":\"incident\",\"field\":\"priority\",\"value\":\"1\"}'"
2693
- },
2694
- {
2695
- "description": "Execute and save output to a file",
2696
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
2504
+ "description": "Dry run — see how many records would be deleted",
2505
+ "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --auth dev"
2697
2506
  },
2698
2507
  {
2699
- "description": "Execute and pipe output to grep for filtering",
2700
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
2508
+ "description": "Execute the delete (requires --confirm)",
2509
+ "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --confirm --auth dev"
2701
2510
  },
2702
2511
  {
2703
- "description": "Execute with debug logging to troubleshoot issues",
2704
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
2512
+ "description": "Delete with custom limit",
2513
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=false^closed_at<2023-01-01\" --limit 1000 --confirm --auth dev"
2705
2514
  },
2706
2515
  {
2707
- "description": "Execute with parameters for template replacement",
2708
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
2516
+ "description": "Delete as JSON output",
2517
+ "command": "<%= config.bin %> <%= command.id %> --table u_staging --query \"processed=true\" --confirm --json --auth dev"
2709
2518
  }
2710
2519
  ],
2711
2520
  "flags": {
2712
2521
  "json": {
2713
- "description": "Format output as json.",
2714
- "helpGroup": "GLOBAL",
2522
+ "char": "j",
2523
+ "description": "Output results as JSON",
2715
2524
  "name": "json",
2525
+ "required": false,
2716
2526
  "allowNo": false,
2717
2527
  "type": "boolean"
2718
2528
  },
@@ -2787,14 +2597,727 @@
2787
2597
  "helpGroup": "GLOBAL",
2788
2598
  "name": "read-only",
2789
2599
  "required": false,
2790
- "allowNo": false,
2600
+ "allowNo": false,
2601
+ "type": "boolean"
2602
+ },
2603
+ "table": {
2604
+ "char": "t",
2605
+ "description": "Table name to delete records from",
2606
+ "name": "table",
2607
+ "required": true,
2608
+ "hasDynamicHelp": false,
2609
+ "multiple": false,
2610
+ "type": "option"
2611
+ },
2612
+ "query": {
2613
+ "char": "q",
2614
+ "description": "Encoded query to match records for deletion",
2615
+ "name": "query",
2616
+ "required": true,
2617
+ "hasDynamicHelp": false,
2618
+ "multiple": false,
2619
+ "type": "option"
2620
+ },
2621
+ "confirm": {
2622
+ "description": "Execute the delete (without this flag, performs a dry run)",
2623
+ "name": "confirm",
2624
+ "required": false,
2625
+ "allowNo": false,
2626
+ "type": "boolean"
2627
+ },
2628
+ "limit": {
2629
+ "char": "l",
2630
+ "description": "Maximum number of records to delete (default 200, max 10000)",
2631
+ "name": "limit",
2632
+ "required": false,
2633
+ "default": 200,
2634
+ "hasDynamicHelp": false,
2635
+ "multiple": false,
2636
+ "type": "option"
2637
+ }
2638
+ },
2639
+ "hasDynamicHelp": false,
2640
+ "hiddenAliases": [],
2641
+ "id": "bulk:delete",
2642
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2643
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2644
+ "pluginType": "core",
2645
+ "strict": true,
2646
+ "enableJsonFlag": true,
2647
+ "isESM": true,
2648
+ "relativePath": [
2649
+ "dist",
2650
+ "commands",
2651
+ "bulk",
2652
+ "delete.js"
2653
+ ]
2654
+ },
2655
+ "bulk:update": {
2656
+ "aliases": [],
2657
+ "args": {},
2658
+ "description": "Bulk update records matching an encoded query.\n\nFinds all records in a table matching the given query, then applies field updates to each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without modifying data)\n • Encoded query filtering\n • JSON field=value pairs for update data\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2659
+ "examples": [
2660
+ {
2661
+ "description": "Dry run — see how many records would be updated",
2662
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --auth dev"
2663
+ },
2664
+ {
2665
+ "description": "Execute the update (requires --confirm)",
2666
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --confirm --auth dev"
2667
+ },
2668
+ {
2669
+ "description": "Update with custom limit",
2670
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"state=1\" --data '{\"assignment_group\":\"group-sys-id\"}' --limit 500 --confirm --auth dev"
2671
+ },
2672
+ {
2673
+ "description": "Update as JSON output",
2674
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --data '{\"state\":\"6\"}' --confirm --json --auth dev"
2675
+ }
2676
+ ],
2677
+ "flags": {
2678
+ "json": {
2679
+ "char": "j",
2680
+ "description": "Output results as JSON",
2681
+ "name": "json",
2682
+ "required": false,
2683
+ "allowNo": false,
2684
+ "type": "boolean"
2685
+ },
2686
+ "auth": {
2687
+ "char": "a",
2688
+ "description": "Auth alias to use.",
2689
+ "name": "auth",
2690
+ "required": false,
2691
+ "hasDynamicHelp": false,
2692
+ "multiple": false,
2693
+ "type": "option"
2694
+ },
2695
+ "cred-store": {
2696
+ "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.",
2697
+ "helpGroup": "GLOBAL",
2698
+ "name": "cred-store",
2699
+ "required": false,
2700
+ "allowNo": false,
2701
+ "type": "boolean"
2702
+ },
2703
+ "deny-execute": {
2704
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
2705
+ "helpGroup": "GLOBAL",
2706
+ "name": "deny-execute",
2707
+ "required": false,
2708
+ "allowNo": false,
2709
+ "type": "boolean"
2710
+ },
2711
+ "deny-write": {
2712
+ "description": "Refuse any change to instance data for this invocation.",
2713
+ "helpGroup": "GLOBAL",
2714
+ "name": "deny-write",
2715
+ "required": false,
2716
+ "allowNo": false,
2717
+ "type": "boolean"
2718
+ },
2719
+ "log-dir": {
2720
+ "description": "Directory to write log files to. Implies --log-file.",
2721
+ "helpGroup": "GLOBAL",
2722
+ "name": "log-dir",
2723
+ "required": false,
2724
+ "hasDynamicHelp": false,
2725
+ "multiple": false,
2726
+ "type": "option"
2727
+ },
2728
+ "log-file": {
2729
+ "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.",
2730
+ "helpGroup": "GLOBAL",
2731
+ "name": "log-file",
2732
+ "required": false,
2733
+ "allowNo": false,
2734
+ "type": "boolean"
2735
+ },
2736
+ "log-level": {
2737
+ "helpGroup": "GLOBAL",
2738
+ "name": "log-level",
2739
+ "summary": "Specify level for logging.",
2740
+ "default": "info",
2741
+ "hasDynamicHelp": false,
2742
+ "multiple": false,
2743
+ "options": [
2744
+ "debug",
2745
+ "warn",
2746
+ "error",
2747
+ "info",
2748
+ "trace"
2749
+ ],
2750
+ "type": "option"
2751
+ },
2752
+ "read-only": {
2753
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
2754
+ "helpGroup": "GLOBAL",
2755
+ "name": "read-only",
2756
+ "required": false,
2757
+ "allowNo": false,
2758
+ "type": "boolean"
2759
+ },
2760
+ "table": {
2761
+ "char": "t",
2762
+ "description": "Table name to update records in",
2763
+ "name": "table",
2764
+ "required": true,
2765
+ "hasDynamicHelp": false,
2766
+ "multiple": false,
2767
+ "type": "option"
2768
+ },
2769
+ "query": {
2770
+ "char": "q",
2771
+ "description": "Encoded query to match records",
2772
+ "name": "query",
2773
+ "required": true,
2774
+ "hasDynamicHelp": false,
2775
+ "multiple": false,
2776
+ "type": "option"
2777
+ },
2778
+ "data": {
2779
+ "char": "d",
2780
+ "description": "JSON object of field=value pairs to apply (e.g. '{\"priority\":\"4\",\"state\":\"2\"}')",
2781
+ "name": "data",
2782
+ "required": true,
2783
+ "hasDynamicHelp": false,
2784
+ "multiple": false,
2785
+ "type": "option"
2786
+ },
2787
+ "confirm": {
2788
+ "description": "Execute the update (without this flag, performs a dry run)",
2789
+ "name": "confirm",
2790
+ "required": false,
2791
+ "allowNo": false,
2792
+ "type": "boolean"
2793
+ },
2794
+ "limit": {
2795
+ "char": "l",
2796
+ "description": "Maximum number of records to update (default 200, max 10000)",
2797
+ "name": "limit",
2798
+ "required": false,
2799
+ "default": 200,
2800
+ "hasDynamicHelp": false,
2801
+ "multiple": false,
2802
+ "type": "option"
2803
+ }
2804
+ },
2805
+ "hasDynamicHelp": false,
2806
+ "hiddenAliases": [],
2807
+ "id": "bulk:update",
2808
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2809
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2810
+ "pluginType": "core",
2811
+ "strict": true,
2812
+ "enableJsonFlag": true,
2813
+ "isESM": true,
2814
+ "relativePath": [
2815
+ "dist",
2816
+ "commands",
2817
+ "bulk",
2818
+ "update.js"
2819
+ ]
2820
+ },
2821
+ "exec": {
2822
+ "aliases": [],
2823
+ "args": {
2824
+ "scope": {
2825
+ "description": "Scope to execute script in. Use \"global\" for global scope.",
2826
+ "name": "scope",
2827
+ "required": true
2828
+ },
2829
+ "file": {
2830
+ "description": "File to execute in scripts background. If omitted, starts REPL mode.",
2831
+ "name": "file",
2832
+ "required": false
2833
+ }
2834
+ },
2835
+ "description": "Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.\n\nThis command allows you to run JavaScript either from files or interactively via REPL mode. It mimics the functionality of the Scripts - Background interface in ServiceNow, providing a way to execute scripts programmatically without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.\n\nModes:\n • File Mode: Provide a file path to execute scripts from a file\n • REPL Mode: Omit the file path to start an interactive session\n\nFeatures:\n • Execute local JavaScript files remotely\n • Interactive REPL for ad-hoc script execution\n • Script parameterization with {placeholder} replacement\n • Multi-line script support in REPL\n • Scope-aware execution (global or custom scope)\n • Real-time console output capture\n • Pipe-able output for command chaining\n • Debug logging support\n • Useful for data migration, testing, and administrative tasks\n\nScript Parameterization:\n Use {paramName} placeholders in your script files, then provide values via --params:\n • Supports any JSON-serializable values (strings, numbers, booleans)\n • Multiple parameters supported\n • All occurrences of each placeholder are replaced\n • Example: {token}, {username}, {environment}\n\nREPL Controls:\n • Press Enter to add a new line\n • Type .exec or press Ctrl+D to execute the script\n • Type .clear to clear the current input\n • Type .exit or press Ctrl+C twice to exit REPL\n\n⚠️ IMPORTANT SECURITY WARNING:\nThis command executes scripts with the same permissions and risks as using Scripts - Background directly\nin ServiceNow. Always:\n • Review scripts before execution\n • Test in non-production environments first\n • Use appropriate scoping to limit access\n • Be aware of data modification risks\n • Follow your organization's security policies\n • Never execute untrusted scripts\n\nScript Capabilities:\n Scripts run with full GlideSystem API access and can:\n • Query and modify database records\n • Create, update, and delete data\n • Execute business rules and workflows\n • Access all APIs available in Scripts - Background\n • Use gs, GlideRecord, GlideAggregate, and other server-side APIs",
2836
+ "examples": [
2837
+ {
2838
+ "description": "Start REPL in global scope",
2839
+ "command": "<%= config.bin %> <%= command.id %> global --auth dev-instance"
2840
+ },
2841
+ {
2842
+ "description": "Start REPL in custom application scope",
2843
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app --auth dev-instance"
2844
+ },
2845
+ {
2846
+ "description": "Execute a script file in global scope",
2847
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/cleanup.js --auth dev-instance"
2848
+ },
2849
+ {
2850
+ "description": "Execute a script file in a custom application scope",
2851
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app ./scripts/app-config.js --auth dev-instance"
2852
+ },
2853
+ {
2854
+ "description": "Execute a parameterized script with single parameter",
2855
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/query-user.js --auth dev-instance --params '{\"username\":\"admin\"}'"
2856
+ },
2857
+ {
2858
+ "description": "Execute a parameterized script with multiple parameters",
2859
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/update-record.js --auth dev-instance --params '{\"table\":\"incident\",\"field\":\"priority\",\"value\":\"1\"}'"
2860
+ },
2861
+ {
2862
+ "description": "Execute and save output to a file",
2863
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
2864
+ },
2865
+ {
2866
+ "description": "Execute and pipe output to grep for filtering",
2867
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
2868
+ },
2869
+ {
2870
+ "description": "Execute with debug logging to troubleshoot issues",
2871
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
2872
+ },
2873
+ {
2874
+ "description": "Execute with parameters for template replacement",
2875
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
2876
+ }
2877
+ ],
2878
+ "flags": {
2879
+ "json": {
2880
+ "description": "Format output as json.",
2881
+ "helpGroup": "GLOBAL",
2882
+ "name": "json",
2883
+ "allowNo": false,
2884
+ "type": "boolean"
2885
+ },
2886
+ "auth": {
2887
+ "char": "a",
2888
+ "description": "Auth alias to use.",
2889
+ "name": "auth",
2890
+ "required": false,
2891
+ "hasDynamicHelp": false,
2892
+ "multiple": false,
2893
+ "type": "option"
2894
+ },
2895
+ "cred-store": {
2896
+ "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.",
2897
+ "helpGroup": "GLOBAL",
2898
+ "name": "cred-store",
2899
+ "required": false,
2900
+ "allowNo": false,
2901
+ "type": "boolean"
2902
+ },
2903
+ "deny-execute": {
2904
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
2905
+ "helpGroup": "GLOBAL",
2906
+ "name": "deny-execute",
2907
+ "required": false,
2908
+ "allowNo": false,
2909
+ "type": "boolean"
2910
+ },
2911
+ "deny-write": {
2912
+ "description": "Refuse any change to instance data for this invocation.",
2913
+ "helpGroup": "GLOBAL",
2914
+ "name": "deny-write",
2915
+ "required": false,
2916
+ "allowNo": false,
2917
+ "type": "boolean"
2918
+ },
2919
+ "log-dir": {
2920
+ "description": "Directory to write log files to. Implies --log-file.",
2921
+ "helpGroup": "GLOBAL",
2922
+ "name": "log-dir",
2923
+ "required": false,
2924
+ "hasDynamicHelp": false,
2925
+ "multiple": false,
2926
+ "type": "option"
2927
+ },
2928
+ "log-file": {
2929
+ "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.",
2930
+ "helpGroup": "GLOBAL",
2931
+ "name": "log-file",
2932
+ "required": false,
2933
+ "allowNo": false,
2934
+ "type": "boolean"
2935
+ },
2936
+ "log-level": {
2937
+ "helpGroup": "GLOBAL",
2938
+ "name": "log-level",
2939
+ "summary": "Specify level for logging.",
2940
+ "default": "info",
2941
+ "hasDynamicHelp": false,
2942
+ "multiple": false,
2943
+ "options": [
2944
+ "debug",
2945
+ "warn",
2946
+ "error",
2947
+ "info",
2948
+ "trace"
2949
+ ],
2950
+ "type": "option"
2951
+ },
2952
+ "read-only": {
2953
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
2954
+ "helpGroup": "GLOBAL",
2955
+ "name": "read-only",
2956
+ "required": false,
2957
+ "allowNo": false,
2958
+ "type": "boolean"
2959
+ },
2960
+ "params": {
2961
+ "char": "p",
2962
+ "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
2963
+ "name": "params",
2964
+ "required": false,
2965
+ "hasDynamicHelp": false,
2966
+ "multiple": false,
2967
+ "type": "option"
2968
+ }
2969
+ },
2970
+ "hasDynamicHelp": false,
2971
+ "hiddenAliases": [],
2972
+ "id": "exec",
2973
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2974
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2975
+ "pluginType": "core",
2976
+ "strict": true,
2977
+ "enableJsonFlag": true,
2978
+ "autocomplete": {},
2979
+ "isESM": true,
2980
+ "relativePath": [
2981
+ "dist",
2982
+ "commands",
2983
+ "exec",
2984
+ "index.js"
2985
+ ]
2986
+ },
2987
+ "auth:delete": {
2988
+ "aliases": [],
2989
+ "args": {
2990
+ "alias": {
2991
+ "description": "Alias to remove",
2992
+ "name": "alias",
2993
+ "required": false
2994
+ }
2995
+ },
2996
+ "description": "Remove a credential from the store.\n\nThis does not touch the OS keyring — a copy stored there before migrating remains.",
2997
+ "examples": [
2998
+ {
2999
+ "command": "<%= config.bin %> <%= command.id %> dev206299",
3000
+ "description": "Remove one alias"
3001
+ },
3002
+ {
3003
+ "command": "<%= config.bin %> <%= command.id %> --all",
3004
+ "description": "Remove every stored credential"
3005
+ }
3006
+ ],
3007
+ "flags": {
3008
+ "cred-store": {
3009
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3010
+ "helpGroup": "GLOBAL",
3011
+ "name": "cred-store",
3012
+ "required": false,
3013
+ "allowNo": false,
3014
+ "type": "boolean"
3015
+ },
3016
+ "all": {
3017
+ "description": "Remove every stored credential",
3018
+ "name": "all",
3019
+ "required": false,
3020
+ "allowNo": false,
3021
+ "type": "boolean"
3022
+ }
3023
+ },
3024
+ "hasDynamicHelp": false,
3025
+ "hiddenAliases": [],
3026
+ "id": "auth:delete",
3027
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3028
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3029
+ "pluginType": "core",
3030
+ "strict": true,
3031
+ "enableJsonFlag": false,
3032
+ "isESM": true,
3033
+ "relativePath": [
3034
+ "dist",
3035
+ "commands",
3036
+ "auth",
3037
+ "delete.js"
3038
+ ]
3039
+ },
3040
+ "auth:doctor": {
3041
+ "aliases": [],
3042
+ "args": {},
3043
+ "description": "Diagnose credential storage: whether the SDK shim is active, which backend is in use, and what is stored.",
3044
+ "examples": [
3045
+ {
3046
+ "command": "<%= config.bin %> <%= command.id %>",
3047
+ "description": "Check credential storage health"
3048
+ },
3049
+ {
3050
+ "command": "<%= config.bin %> <%= command.id %> --json",
3051
+ "description": "Machine-readable output for CI"
3052
+ }
3053
+ ],
3054
+ "flags": {
3055
+ "json": {
3056
+ "description": "Format output as json.",
3057
+ "helpGroup": "GLOBAL",
3058
+ "name": "json",
3059
+ "allowNo": false,
3060
+ "type": "boolean"
3061
+ },
3062
+ "cred-store": {
3063
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3064
+ "helpGroup": "GLOBAL",
3065
+ "name": "cred-store",
3066
+ "required": false,
3067
+ "allowNo": false,
3068
+ "type": "boolean"
3069
+ }
3070
+ },
3071
+ "hasDynamicHelp": false,
3072
+ "hiddenAliases": [],
3073
+ "id": "auth:doctor",
3074
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3075
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3076
+ "pluginType": "core",
3077
+ "strict": true,
3078
+ "enableJsonFlag": true,
3079
+ "isESM": true,
3080
+ "relativePath": [
3081
+ "dist",
3082
+ "commands",
3083
+ "auth",
3084
+ "doctor.js"
3085
+ ]
3086
+ },
3087
+ "auth:list": {
3088
+ "aliases": [],
3089
+ "args": {},
3090
+ "description": "List credentials in the headless-safe credential store.\n\nThese are the credentials the ServiceNow SDK reads via the sn-credstore shim, which works in non-interactive sessions where the OS keyring cannot be unlocked.\n\nSecrets are never printed.",
3091
+ "examples": [
3092
+ {
3093
+ "command": "<%= config.bin %> <%= command.id %>",
3094
+ "description": "List stored credentials"
3095
+ },
3096
+ {
3097
+ "command": "<%= config.bin %> <%= command.id %> --json",
3098
+ "description": "List as JSON for scripting"
3099
+ }
3100
+ ],
3101
+ "flags": {
3102
+ "json": {
3103
+ "description": "Format output as json.",
3104
+ "helpGroup": "GLOBAL",
3105
+ "name": "json",
3106
+ "allowNo": false,
3107
+ "type": "boolean"
3108
+ },
3109
+ "cred-store": {
3110
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3111
+ "helpGroup": "GLOBAL",
3112
+ "name": "cred-store",
3113
+ "required": false,
3114
+ "allowNo": false,
3115
+ "type": "boolean"
3116
+ }
3117
+ },
3118
+ "hasDynamicHelp": false,
3119
+ "hiddenAliases": [],
3120
+ "id": "auth:list",
3121
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3122
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3123
+ "pluginType": "core",
3124
+ "strict": true,
3125
+ "enableJsonFlag": true,
3126
+ "isESM": true,
3127
+ "relativePath": [
3128
+ "dist",
3129
+ "commands",
3130
+ "auth",
3131
+ "list.js"
3132
+ ]
3133
+ },
3134
+ "auth:use": {
3135
+ "aliases": [],
3136
+ "args": {
3137
+ "alias": {
3138
+ "description": "Alias to make the default",
3139
+ "name": "alias",
3140
+ "required": true
3141
+ }
3142
+ },
3143
+ "description": "Set the default credential alias.\n\nCommands run without --auth use this alias.",
3144
+ "examples": [
3145
+ {
3146
+ "command": "<%= config.bin %> <%= command.id %> dev206299",
3147
+ "description": "Make dev206299 the default"
3148
+ }
3149
+ ],
3150
+ "flags": {
3151
+ "cred-store": {
3152
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3153
+ "helpGroup": "GLOBAL",
3154
+ "name": "cred-store",
3155
+ "required": false,
3156
+ "allowNo": false,
3157
+ "type": "boolean"
3158
+ }
3159
+ },
3160
+ "hasDynamicHelp": false,
3161
+ "hiddenAliases": [],
3162
+ "id": "auth:use",
3163
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3164
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3165
+ "pluginType": "core",
3166
+ "strict": true,
3167
+ "enableJsonFlag": false,
3168
+ "isESM": true,
3169
+ "relativePath": [
3170
+ "dist",
3171
+ "commands",
3172
+ "auth",
3173
+ "use.js"
3174
+ ]
3175
+ },
3176
+ "health:check": {
3177
+ "aliases": [],
3178
+ "args": {},
3179
+ "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",
3180
+ "examples": [
3181
+ {
3182
+ "description": "Run full health check",
3183
+ "command": "<%= config.bin %> <%= command.id %> --auth dev"
3184
+ },
3185
+ {
3186
+ "description": "Check only version and stuck jobs",
3187
+ "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
3188
+ },
3189
+ {
3190
+ "description": "Health check with custom stuck job threshold",
3191
+ "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
3192
+ },
3193
+ {
3194
+ "description": "Health check as JSON",
3195
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
3196
+ }
3197
+ ],
3198
+ "flags": {
3199
+ "json": {
3200
+ "char": "j",
3201
+ "description": "Output results as JSON",
3202
+ "name": "json",
3203
+ "required": false,
3204
+ "allowNo": false,
3205
+ "type": "boolean"
3206
+ },
3207
+ "auth": {
3208
+ "char": "a",
3209
+ "description": "Auth alias to use.",
3210
+ "name": "auth",
3211
+ "required": false,
3212
+ "hasDynamicHelp": false,
3213
+ "multiple": false,
3214
+ "type": "option"
3215
+ },
3216
+ "cred-store": {
3217
+ "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.",
3218
+ "helpGroup": "GLOBAL",
3219
+ "name": "cred-store",
3220
+ "required": false,
3221
+ "allowNo": false,
3222
+ "type": "boolean"
3223
+ },
3224
+ "deny-execute": {
3225
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
3226
+ "helpGroup": "GLOBAL",
3227
+ "name": "deny-execute",
3228
+ "required": false,
3229
+ "allowNo": false,
3230
+ "type": "boolean"
3231
+ },
3232
+ "deny-write": {
3233
+ "description": "Refuse any change to instance data for this invocation.",
3234
+ "helpGroup": "GLOBAL",
3235
+ "name": "deny-write",
3236
+ "required": false,
3237
+ "allowNo": false,
3238
+ "type": "boolean"
3239
+ },
3240
+ "log-dir": {
3241
+ "description": "Directory to write log files to. Implies --log-file.",
3242
+ "helpGroup": "GLOBAL",
3243
+ "name": "log-dir",
3244
+ "required": false,
3245
+ "hasDynamicHelp": false,
3246
+ "multiple": false,
3247
+ "type": "option"
3248
+ },
3249
+ "log-file": {
3250
+ "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.",
3251
+ "helpGroup": "GLOBAL",
3252
+ "name": "log-file",
3253
+ "required": false,
3254
+ "allowNo": false,
3255
+ "type": "boolean"
3256
+ },
3257
+ "log-level": {
3258
+ "helpGroup": "GLOBAL",
3259
+ "name": "log-level",
3260
+ "summary": "Specify level for logging.",
3261
+ "default": "info",
3262
+ "hasDynamicHelp": false,
3263
+ "multiple": false,
3264
+ "options": [
3265
+ "debug",
3266
+ "warn",
3267
+ "error",
3268
+ "info",
3269
+ "trace"
3270
+ ],
3271
+ "type": "option"
3272
+ },
3273
+ "read-only": {
3274
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
3275
+ "helpGroup": "GLOBAL",
3276
+ "name": "read-only",
3277
+ "required": false,
3278
+ "allowNo": false,
3279
+ "type": "boolean"
3280
+ },
3281
+ "include-version": {
3282
+ "description": "Include instance version information",
3283
+ "name": "include-version",
3284
+ "required": false,
3285
+ "allowNo": true,
3286
+ "type": "boolean"
3287
+ },
3288
+ "include-cluster": {
3289
+ "description": "Include cluster node status",
3290
+ "name": "include-cluster",
3291
+ "required": false,
3292
+ "allowNo": true,
3293
+ "type": "boolean"
3294
+ },
3295
+ "include-stuck-jobs": {
3296
+ "description": "Include stuck job detection",
3297
+ "name": "include-stuck-jobs",
3298
+ "required": false,
3299
+ "allowNo": true,
3300
+ "type": "boolean"
3301
+ },
3302
+ "include-semaphores": {
3303
+ "description": "Include active semaphore count",
3304
+ "name": "include-semaphores",
3305
+ "required": false,
3306
+ "allowNo": true,
3307
+ "type": "boolean"
3308
+ },
3309
+ "include-operational-counts": {
3310
+ "description": "Include operational record counts (incidents, changes, problems)",
3311
+ "name": "include-operational-counts",
3312
+ "required": false,
3313
+ "allowNo": true,
2791
3314
  "type": "boolean"
2792
3315
  },
2793
- "params": {
2794
- "char": "p",
2795
- "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
2796
- "name": "params",
3316
+ "stuck-job-threshold": {
3317
+ "description": "Minutes threshold for a job to be considered stuck",
3318
+ "name": "stuck-job-threshold",
2797
3319
  "required": false,
3320
+ "default": 30,
2798
3321
  "hasDynamicHelp": false,
2799
3322
  "multiple": false,
2800
3323
  "type": "option"
@@ -2802,19 +3325,18 @@
2802
3325
  },
2803
3326
  "hasDynamicHelp": false,
2804
3327
  "hiddenAliases": [],
2805
- "id": "exec",
3328
+ "id": "health:check",
2806
3329
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2807
3330
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2808
3331
  "pluginType": "core",
2809
3332
  "strict": true,
2810
3333
  "enableJsonFlag": true,
2811
- "autocomplete": {},
2812
3334
  "isESM": true,
2813
3335
  "relativePath": [
2814
3336
  "dist",
2815
3337
  "commands",
2816
- "exec",
2817
- "index.js"
3338
+ "health",
3339
+ "check.js"
2818
3340
  ]
2819
3341
  },
2820
3342
  "flow:action": {
@@ -4722,159 +5244,45 @@
4722
5244
  "test.js"
4723
5245
  ]
4724
5246
  },
4725
- "health:check": {
5247
+ "policy:status": {
4726
5248
  "aliases": [],
4727
5249
  "args": {},
4728
- "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",
5250
+ "description": "Show what this invocation is permitted to change on the instance, and why.\n\nChanges are permitted by default. NEX_POLICY_DENY, set in the environment, outranks every command-line flag — that is the only layer an agent driving this CLI cannot reach.",
4729
5251
  "examples": [
4730
- {
4731
- "description": "Run full health check",
4732
- "command": "<%= config.bin %> <%= command.id %> --auth dev"
4733
- },
4734
- {
4735
- "description": "Check only version and stuck jobs",
4736
- "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
4737
- },
4738
- {
4739
- "description": "Health check with custom stuck job threshold",
4740
- "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
4741
- },
4742
- {
4743
- "description": "Health check as JSON",
4744
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
4745
- }
5252
+ "<%= config.bin %> <%= command.id %>",
5253
+ "<%= config.bin %> <%= command.id %> --read-only",
5254
+ "NEX_POLICY_DENY=all <%= config.bin %> <%= command.id %>"
4746
5255
  ],
4747
5256
  "flags": {
4748
5257
  "json": {
4749
- "char": "j",
4750
- "description": "Output results as JSON",
4751
- "name": "json",
4752
- "required": false,
4753
- "allowNo": false,
4754
- "type": "boolean"
4755
- },
4756
- "auth": {
4757
- "char": "a",
4758
- "description": "Auth alias to use.",
4759
- "name": "auth",
4760
- "required": false,
4761
- "hasDynamicHelp": false,
4762
- "multiple": false,
4763
- "type": "option"
4764
- },
4765
- "cred-store": {
4766
- "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.",
5258
+ "description": "Format output as json.",
4767
5259
  "helpGroup": "GLOBAL",
4768
- "name": "cred-store",
4769
- "required": false,
5260
+ "name": "json",
4770
5261
  "allowNo": false,
4771
5262
  "type": "boolean"
4772
5263
  },
4773
5264
  "deny-execute": {
4774
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
4775
- "helpGroup": "GLOBAL",
5265
+ "description": "Evaluate as if --deny-execute were passed.",
4776
5266
  "name": "deny-execute",
4777
- "required": false,
4778
5267
  "allowNo": false,
4779
5268
  "type": "boolean"
4780
5269
  },
4781
5270
  "deny-write": {
4782
- "description": "Refuse any change to instance data for this invocation.",
4783
- "helpGroup": "GLOBAL",
5271
+ "description": "Evaluate as if --deny-write were passed.",
4784
5272
  "name": "deny-write",
4785
- "required": false,
4786
- "allowNo": false,
4787
- "type": "boolean"
4788
- },
4789
- "log-dir": {
4790
- "description": "Directory to write log files to. Implies --log-file.",
4791
- "helpGroup": "GLOBAL",
4792
- "name": "log-dir",
4793
- "required": false,
4794
- "hasDynamicHelp": false,
4795
- "multiple": false,
4796
- "type": "option"
4797
- },
4798
- "log-file": {
4799
- "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.",
4800
- "helpGroup": "GLOBAL",
4801
- "name": "log-file",
4802
- "required": false,
4803
5273
  "allowNo": false,
4804
5274
  "type": "boolean"
4805
5275
  },
4806
- "log-level": {
4807
- "helpGroup": "GLOBAL",
4808
- "name": "log-level",
4809
- "summary": "Specify level for logging.",
4810
- "default": "info",
4811
- "hasDynamicHelp": false,
4812
- "multiple": false,
4813
- "options": [
4814
- "debug",
4815
- "warn",
4816
- "error",
4817
- "info",
4818
- "trace"
4819
- ],
4820
- "type": "option"
4821
- },
4822
5276
  "read-only": {
4823
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
4824
- "helpGroup": "GLOBAL",
5277
+ "description": "Evaluate as if --read-only were passed.",
4825
5278
  "name": "read-only",
4826
- "required": false,
4827
5279
  "allowNo": false,
4828
5280
  "type": "boolean"
4829
- },
4830
- "include-version": {
4831
- "description": "Include instance version information",
4832
- "name": "include-version",
4833
- "required": false,
4834
- "allowNo": true,
4835
- "type": "boolean"
4836
- },
4837
- "include-cluster": {
4838
- "description": "Include cluster node status",
4839
- "name": "include-cluster",
4840
- "required": false,
4841
- "allowNo": true,
4842
- "type": "boolean"
4843
- },
4844
- "include-stuck-jobs": {
4845
- "description": "Include stuck job detection",
4846
- "name": "include-stuck-jobs",
4847
- "required": false,
4848
- "allowNo": true,
4849
- "type": "boolean"
4850
- },
4851
- "include-semaphores": {
4852
- "description": "Include active semaphore count",
4853
- "name": "include-semaphores",
4854
- "required": false,
4855
- "allowNo": true,
4856
- "type": "boolean"
4857
- },
4858
- "include-operational-counts": {
4859
- "description": "Include operational record counts (incidents, changes, problems)",
4860
- "name": "include-operational-counts",
4861
- "required": false,
4862
- "allowNo": true,
4863
- "type": "boolean"
4864
- },
4865
- "stuck-job-threshold": {
4866
- "description": "Minutes threshold for a job to be considered stuck",
4867
- "name": "stuck-job-threshold",
4868
- "required": false,
4869
- "default": 30,
4870
- "hasDynamicHelp": false,
4871
- "multiple": false,
4872
- "type": "option"
4873
5281
  }
4874
5282
  },
4875
5283
  "hasDynamicHelp": false,
4876
5284
  "hiddenAliases": [],
4877
- "id": "health:check",
5285
+ "id": "policy:status",
4878
5286
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
4879
5287
  "pluginName": "@sonisoft/now-sdk-ext-cli",
4880
5288
  "pluginType": "core",
@@ -4884,8 +5292,8 @@
4884
5292
  "relativePath": [
4885
5293
  "dist",
4886
5294
  "commands",
4887
- "health",
4888
- "check.js"
5295
+ "policy",
5296
+ "status.js"
4889
5297
  ]
4890
5298
  },
4891
5299
  "log": {
@@ -5060,70 +5468,18 @@
5060
5468
  "index.js"
5061
5469
  ]
5062
5470
  },
5063
- "policy:status": {
5064
- "aliases": [],
5065
- "args": {},
5066
- "description": "Show what this invocation is permitted to change on the instance, and why.\n\nChanges are permitted by default. NEX_POLICY_DENY, set in the environment, outranks every command-line flag — that is the only layer an agent driving this CLI cannot reach.",
5067
- "examples": [
5068
- "<%= config.bin %> <%= command.id %>",
5069
- "<%= config.bin %> <%= command.id %> --read-only",
5070
- "NEX_POLICY_DENY=all <%= config.bin %> <%= command.id %>"
5071
- ],
5072
- "flags": {
5073
- "json": {
5074
- "description": "Format output as json.",
5075
- "helpGroup": "GLOBAL",
5076
- "name": "json",
5077
- "allowNo": false,
5078
- "type": "boolean"
5079
- },
5080
- "deny-execute": {
5081
- "description": "Evaluate as if --deny-execute were passed.",
5082
- "name": "deny-execute",
5083
- "allowNo": false,
5084
- "type": "boolean"
5085
- },
5086
- "deny-write": {
5087
- "description": "Evaluate as if --deny-write were passed.",
5088
- "name": "deny-write",
5089
- "allowNo": false,
5090
- "type": "boolean"
5091
- },
5092
- "read-only": {
5093
- "description": "Evaluate as if --read-only were passed.",
5094
- "name": "read-only",
5095
- "allowNo": false,
5096
- "type": "boolean"
5097
- }
5098
- },
5099
- "hasDynamicHelp": false,
5100
- "hiddenAliases": [],
5101
- "id": "policy:status",
5102
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5103
- "pluginName": "@sonisoft/now-sdk-ext-cli",
5104
- "pluginType": "core",
5105
- "strict": true,
5106
- "enableJsonFlag": true,
5107
- "isESM": true,
5108
- "relativePath": [
5109
- "dist",
5110
- "commands",
5111
- "policy",
5112
- "status.js"
5113
- ]
5114
- },
5115
- "query:app": {
5471
+ "schema:field": {
5116
5472
  "aliases": [],
5117
5473
  "args": {},
5118
- "description": "Search for applications by name across scoped apps and plugins.\n\nSearches the sys_scope table for applications matching the provided search term.\n\nFeatures:\n • Search by name (case-insensitive contains)\n • Filter active/inactive applications\n • Configurable result limit\n • JSON output for scripting",
5474
+ "description": "Get detailed information about a specific field on a ServiceNow table.\n\nThis command retrieves comprehensive details about a single field, including its type, constraints, choices, and other metadata. Useful for understanding field definitions during development.",
5119
5475
  "examples": [
5120
5476
  {
5121
- "description": "Search for ITSM applications",
5122
- "command": "<%= config.bin %> <%= command.id %> --search \"ITSM\" --auth dev"
5477
+ "description": "Explain the state field on incident table",
5478
+ "command": "<%= config.bin %> <%= command.id %> --table incident --field state --auth dev"
5123
5479
  },
5124
5480
  {
5125
- "description": "Search active apps only",
5126
- "command": "<%= config.bin %> <%= command.id %> --search \"HR\" --active --auth dev"
5481
+ "description": "Explain the priority field on incident table with JSON output",
5482
+ "command": "<%= config.bin %> <%= command.id %> --table incident --field priority --json --auth dev"
5127
5483
  }
5128
5484
  ],
5129
5485
  "flags": {
@@ -5209,29 +5565,20 @@
5209
5565
  "allowNo": false,
5210
5566
  "type": "boolean"
5211
5567
  },
5212
- "search": {
5213
- "char": "s",
5214
- "description": "Application name search term",
5215
- "name": "search",
5568
+ "table": {
5569
+ "char": "t",
5570
+ "description": "ServiceNow table name",
5571
+ "name": "table",
5216
5572
  "required": true,
5217
5573
  "hasDynamicHelp": false,
5218
5574
  "multiple": false,
5219
5575
  "type": "option"
5220
5576
  },
5221
- "active": {
5222
- "char": "a",
5223
- "description": "Only show active applications",
5224
- "name": "active",
5225
- "required": false,
5226
- "allowNo": false,
5227
- "type": "boolean"
5228
- },
5229
- "limit": {
5230
- "char": "l",
5231
- "description": "Maximum number of results to return",
5232
- "name": "limit",
5233
- "required": false,
5234
- "default": 20,
5577
+ "field": {
5578
+ "char": "f",
5579
+ "description": "Field name to explain",
5580
+ "name": "field",
5581
+ "required": true,
5235
5582
  "hasDynamicHelp": false,
5236
5583
  "multiple": false,
5237
5584
  "type": "option"
@@ -5239,7 +5586,7 @@
5239
5586
  },
5240
5587
  "hasDynamicHelp": false,
5241
5588
  "hiddenAliases": [],
5242
- "id": "query:app",
5589
+ "id": "schema:field",
5243
5590
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5244
5591
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5245
5592
  "pluginType": "core",
@@ -5249,26 +5596,22 @@
5249
5596
  "relativePath": [
5250
5597
  "dist",
5251
5598
  "commands",
5252
- "query",
5253
- "app.js"
5599
+ "schema",
5600
+ "field.js"
5254
5601
  ]
5255
5602
  },
5256
- "query:columns": {
5603
+ "schema": {
5257
5604
  "aliases": [],
5258
5605
  "args": {},
5259
- "description": "List and search columns (fields) on a ServiceNow table.\n\nRetrieves all field definitions for a table from the sys_dictionary, with optional name/label filtering.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Search/filter fields by name or label\n • JSON output for scripting",
5606
+ "description": "Discover and inspect a ServiceNow table schema including fields, types, and relationships.\n\nThis command retrieves the full schema definition for a ServiceNow table, including all fields, their types, constraints, and optionally choices, relationships, UI policies, and business rules.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Optionally include field choices\n • Optionally include table relationships\n • Optionally include UI policies\n • Optionally include business rules\n • JSON output for CI/CD integration",
5260
5607
  "examples": [
5261
5608
  {
5262
- "description": "List all columns on the incident table",
5609
+ "description": "Discover incident table schema",
5263
5610
  "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
5264
5611
  },
5265
5612
  {
5266
- "description": "Search for date-related columns",
5267
- "command": "<%= config.bin %> <%= command.id %> --table incident --search \"date\" --auth dev"
5268
- },
5269
- {
5270
- "description": "List columns as JSON",
5271
- "command": "<%= config.bin %> <%= command.id %> --table incident --json --auth dev"
5613
+ "description": "Include choices and relationships",
5614
+ "command": "<%= config.bin %> <%= command.id %> --table incident --include-choices --include-relationships --auth dev"
5272
5615
  }
5273
5616
  ],
5274
5617
  "flags": {
@@ -5356,26 +5699,45 @@
5356
5699
  },
5357
5700
  "table": {
5358
5701
  "char": "t",
5359
- "description": "ServiceNow table name to list columns for",
5702
+ "description": "ServiceNow table name to discover schema for",
5360
5703
  "name": "table",
5361
5704
  "required": true,
5362
5705
  "hasDynamicHelp": false,
5363
5706
  "multiple": false,
5364
5707
  "type": "option"
5365
5708
  },
5366
- "search": {
5367
- "char": "s",
5368
- "description": "Filter columns by name or label (case-insensitive)",
5369
- "name": "search",
5709
+ "include-choices": {
5710
+ "description": "Include field choices in the schema output",
5711
+ "name": "include-choices",
5370
5712
  "required": false,
5371
- "hasDynamicHelp": false,
5372
- "multiple": false,
5373
- "type": "option"
5713
+ "allowNo": false,
5714
+ "type": "boolean"
5715
+ },
5716
+ "include-relationships": {
5717
+ "description": "Include table relationships in the schema output",
5718
+ "name": "include-relationships",
5719
+ "required": false,
5720
+ "allowNo": false,
5721
+ "type": "boolean"
5722
+ },
5723
+ "include-ui-policies": {
5724
+ "description": "Include UI policies in the schema output",
5725
+ "name": "include-ui-policies",
5726
+ "required": false,
5727
+ "allowNo": false,
5728
+ "type": "boolean"
5729
+ },
5730
+ "include-business-rules": {
5731
+ "description": "Include business rules in the schema output",
5732
+ "name": "include-business-rules",
5733
+ "required": false,
5734
+ "allowNo": false,
5735
+ "type": "boolean"
5374
5736
  }
5375
5737
  },
5376
5738
  "hasDynamicHelp": false,
5377
5739
  "hiddenAliases": [],
5378
- "id": "query:columns",
5740
+ "id": "schema",
5379
5741
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5380
5742
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5381
5743
  "pluginType": "core",
@@ -5385,26 +5747,22 @@
5385
5747
  "relativePath": [
5386
5748
  "dist",
5387
5749
  "commands",
5388
- "query",
5389
- "columns.js"
5750
+ "schema",
5751
+ "index.js"
5390
5752
  ]
5391
5753
  },
5392
- "query": {
5754
+ "schema:validate-catalog": {
5393
5755
  "aliases": [],
5394
5756
  "args": {},
5395
- "description": "Query any ServiceNow table using the Table API.\n\nRetrieve records from any table with support for encoded queries, field selection, display values, and configurable limits.\n\nFeatures:\n • Query any table with encoded query strings\n • Select specific fields to return\n • Toggle display values vs. internal values\n • Configurable record limit\n • JSON output for scripting and CI/CD",
5757
+ "description": "Validate a ServiceNow catalog item configuration for common issues.\n\nThis command checks a catalog item configuration and reports any validation issues, warnings, or errors found. Useful for ensuring catalog items are properly configured before deployment.",
5396
5758
  "examples": [
5397
5759
  {
5398
- "description": "Query active incidents",
5399
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --limit 10 --auth dev"
5400
- },
5401
- {
5402
- "description": "Query with specific fields and display values",
5403
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"priority=1\" --fields \"number,short_description,state\" --display-value --auth dev"
5760
+ "description": "Validate a catalog item by sys_id",
5761
+ "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --auth dev"
5404
5762
  },
5405
5763
  {
5406
- "description": "Query as JSON output",
5407
- "command": "<%= config.bin %> <%= command.id %> --table sys_user --query \"active=true\" --limit 5 --json --auth dev"
5764
+ "description": "Validate a catalog item with JSON output",
5765
+ "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --json --auth dev"
5408
5766
  }
5409
5767
  ],
5410
5768
  "flags": {
@@ -5490,56 +5848,19 @@
5490
5848
  "allowNo": false,
5491
5849
  "type": "boolean"
5492
5850
  },
5493
- "table": {
5494
- "char": "t",
5495
- "description": "ServiceNow table name to query",
5496
- "name": "table",
5851
+ "sys-id": {
5852
+ "char": "s",
5853
+ "description": "Catalog item sys_id to validate",
5854
+ "name": "sys-id",
5497
5855
  "required": true,
5498
5856
  "hasDynamicHelp": false,
5499
5857
  "multiple": false,
5500
5858
  "type": "option"
5501
- },
5502
- "query": {
5503
- "char": "q",
5504
- "description": "ServiceNow encoded query string",
5505
- "name": "query",
5506
- "required": false,
5507
- "default": "",
5508
- "hasDynamicHelp": false,
5509
- "multiple": false,
5510
- "type": "option"
5511
- },
5512
- "fields": {
5513
- "char": "f",
5514
- "description": "Comma-separated list of fields to return",
5515
- "name": "fields",
5516
- "required": false,
5517
- "hasDynamicHelp": false,
5518
- "multiple": false,
5519
- "type": "option"
5520
- },
5521
- "display-value": {
5522
- "char": "d",
5523
- "description": "Return display values instead of internal values",
5524
- "name": "display-value",
5525
- "required": false,
5526
- "allowNo": false,
5527
- "type": "boolean"
5528
- },
5529
- "limit": {
5530
- "char": "l",
5531
- "description": "Maximum number of records to return",
5532
- "name": "limit",
5533
- "required": false,
5534
- "default": 20,
5535
- "hasDynamicHelp": false,
5536
- "multiple": false,
5537
- "type": "option"
5538
5859
  }
5539
5860
  },
5540
5861
  "hasDynamicHelp": false,
5541
5862
  "hiddenAliases": [],
5542
- "id": "query",
5863
+ "id": "schema:validate-catalog",
5543
5864
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5544
5865
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5545
5866
  "pluginType": "core",
@@ -5549,26 +5870,22 @@
5549
5870
  "relativePath": [
5550
5871
  "dist",
5551
5872
  "commands",
5552
- "query",
5553
- "index.js"
5873
+ "schema",
5874
+ "validate-catalog.js"
5554
5875
  ]
5555
5876
  },
5556
- "query:syslog": {
5877
+ "query:app": {
5557
5878
  "aliases": [],
5558
5879
  "args": {},
5559
- "description": "Query ServiceNow system logs (one-shot, non-tailing).\n\nRetrieves syslog records with optional encoded query filtering and configurable limits. For real-time log tailing, use the \"log tail\" command instead.\n\nFeatures:\n • Query syslog with encoded query strings\n • Configurable record limit\n • Formatted table output with timestamps, levels, and sources\n • JSON output for scripting",
5880
+ "description": "Search for applications by name across scoped apps and plugins.\n\nSearches the sys_scope table for applications matching the provided search term.\n\nFeatures:\n • Search by name (case-insensitive contains)\n • Filter active/inactive applications\n • Configurable result limit\n • JSON output for scripting",
5560
5881
  "examples": [
5561
5882
  {
5562
- "description": "Query recent error logs",
5563
- "command": "<%= config.bin %> <%= command.id %> --query \"level=2\" --limit 20 --auth dev"
5564
- },
5565
- {
5566
- "description": "Query all recent syslog entries",
5567
- "command": "<%= config.bin %> <%= command.id %> --limit 50 --auth dev"
5883
+ "description": "Search for ITSM applications",
5884
+ "command": "<%= config.bin %> <%= command.id %> --search \"ITSM\" --auth dev"
5568
5885
  },
5569
5886
  {
5570
- "description": "Query syslog as JSON",
5571
- "command": "<%= config.bin %> <%= command.id %> --query \"sourceLIKEincident\" --json --auth dev"
5887
+ "description": "Search active apps only",
5888
+ "command": "<%= config.bin %> <%= command.id %> --search \"HR\" --active --auth dev"
5572
5889
  }
5573
5890
  ],
5574
5891
  "flags": {
@@ -5654,21 +5971,29 @@
5654
5971
  "allowNo": false,
5655
5972
  "type": "boolean"
5656
5973
  },
5657
- "query": {
5658
- "char": "q",
5659
- "description": "ServiceNow encoded query string for filtering syslog records",
5660
- "name": "query",
5661
- "required": false,
5974
+ "search": {
5975
+ "char": "s",
5976
+ "description": "Application name search term",
5977
+ "name": "search",
5978
+ "required": true,
5662
5979
  "hasDynamicHelp": false,
5663
5980
  "multiple": false,
5664
5981
  "type": "option"
5665
5982
  },
5983
+ "active": {
5984
+ "char": "a",
5985
+ "description": "Only show active applications",
5986
+ "name": "active",
5987
+ "required": false,
5988
+ "allowNo": false,
5989
+ "type": "boolean"
5990
+ },
5666
5991
  "limit": {
5667
5992
  "char": "l",
5668
- "description": "Maximum number of syslog records to return",
5993
+ "description": "Maximum number of results to return",
5669
5994
  "name": "limit",
5670
5995
  "required": false,
5671
- "default": 100,
5996
+ "default": 20,
5672
5997
  "hasDynamicHelp": false,
5673
5998
  "multiple": false,
5674
5999
  "type": "option"
@@ -5676,7 +6001,7 @@
5676
6001
  },
5677
6002
  "hasDynamicHelp": false,
5678
6003
  "hiddenAliases": [],
5679
- "id": "query:syslog",
6004
+ "id": "query:app",
5680
6005
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5681
6006
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5682
6007
  "pluginType": "core",
@@ -5687,21 +6012,25 @@
5687
6012
  "dist",
5688
6013
  "commands",
5689
6014
  "query",
5690
- "syslog.js"
6015
+ "app.js"
5691
6016
  ]
5692
6017
  },
5693
- "schema:field": {
6018
+ "query:columns": {
5694
6019
  "aliases": [],
5695
6020
  "args": {},
5696
- "description": "Get detailed information about a specific field on a ServiceNow table.\n\nThis command retrieves comprehensive details about a single field, including its type, constraints, choices, and other metadata. Useful for understanding field definitions during development.",
6021
+ "description": "List and search columns (fields) on a ServiceNow table.\n\nRetrieves all field definitions for a table from the sys_dictionary, with optional name/label filtering.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Search/filter fields by name or label\n • JSON output for scripting",
5697
6022
  "examples": [
5698
6023
  {
5699
- "description": "Explain the state field on incident table",
5700
- "command": "<%= config.bin %> <%= command.id %> --table incident --field state --auth dev"
6024
+ "description": "List all columns on the incident table",
6025
+ "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
5701
6026
  },
5702
6027
  {
5703
- "description": "Explain the priority field on incident table with JSON output",
5704
- "command": "<%= config.bin %> <%= command.id %> --table incident --field priority --json --auth dev"
6028
+ "description": "Search for date-related columns",
6029
+ "command": "<%= config.bin %> <%= command.id %> --table incident --search \"date\" --auth dev"
6030
+ },
6031
+ {
6032
+ "description": "List columns as JSON",
6033
+ "command": "<%= config.bin %> <%= command.id %> --table incident --json --auth dev"
5705
6034
  }
5706
6035
  ],
5707
6036
  "flags": {
@@ -5789,18 +6118,18 @@
5789
6118
  },
5790
6119
  "table": {
5791
6120
  "char": "t",
5792
- "description": "ServiceNow table name",
6121
+ "description": "ServiceNow table name to list columns for",
5793
6122
  "name": "table",
5794
6123
  "required": true,
5795
6124
  "hasDynamicHelp": false,
5796
6125
  "multiple": false,
5797
6126
  "type": "option"
5798
6127
  },
5799
- "field": {
5800
- "char": "f",
5801
- "description": "Field name to explain",
5802
- "name": "field",
5803
- "required": true,
6128
+ "search": {
6129
+ "char": "s",
6130
+ "description": "Filter columns by name or label (case-insensitive)",
6131
+ "name": "search",
6132
+ "required": false,
5804
6133
  "hasDynamicHelp": false,
5805
6134
  "multiple": false,
5806
6135
  "type": "option"
@@ -5808,7 +6137,7 @@
5808
6137
  },
5809
6138
  "hasDynamicHelp": false,
5810
6139
  "hiddenAliases": [],
5811
- "id": "schema:field",
6140
+ "id": "query:columns",
5812
6141
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5813
6142
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5814
6143
  "pluginType": "core",
@@ -5818,22 +6147,26 @@
5818
6147
  "relativePath": [
5819
6148
  "dist",
5820
6149
  "commands",
5821
- "schema",
5822
- "field.js"
6150
+ "query",
6151
+ "columns.js"
5823
6152
  ]
5824
6153
  },
5825
- "schema": {
6154
+ "query": {
5826
6155
  "aliases": [],
5827
6156
  "args": {},
5828
- "description": "Discover and inspect a ServiceNow table schema including fields, types, and relationships.\n\nThis command retrieves the full schema definition for a ServiceNow table, including all fields, their types, constraints, and optionally choices, relationships, UI policies, and business rules.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Optionally include field choices\n • Optionally include table relationships\n • Optionally include UI policies\n • Optionally include business rules\n • JSON output for CI/CD integration",
6157
+ "description": "Query any ServiceNow table using the Table API.\n\nRetrieve records from any table with support for encoded queries, field selection, display values, and configurable limits.\n\nFeatures:\n • Query any table with encoded query strings\n • Select specific fields to return\n • Toggle display values vs. internal values\n • Configurable record limit\n • JSON output for scripting and CI/CD",
5829
6158
  "examples": [
5830
6159
  {
5831
- "description": "Discover incident table schema",
5832
- "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
6160
+ "description": "Query active incidents",
6161
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --limit 10 --auth dev"
5833
6162
  },
5834
6163
  {
5835
- "description": "Include choices and relationships",
5836
- "command": "<%= config.bin %> <%= command.id %> --table incident --include-choices --include-relationships --auth dev"
6164
+ "description": "Query with specific fields and display values",
6165
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"priority=1\" --fields \"number,short_description,state\" --display-value --auth dev"
6166
+ },
6167
+ {
6168
+ "description": "Query as JSON output",
6169
+ "command": "<%= config.bin %> <%= command.id %> --table sys_user --query \"active=true\" --limit 5 --json --auth dev"
5837
6170
  }
5838
6171
  ],
5839
6172
  "flags": {
@@ -5921,45 +6254,54 @@
5921
6254
  },
5922
6255
  "table": {
5923
6256
  "char": "t",
5924
- "description": "ServiceNow table name to discover schema for",
6257
+ "description": "ServiceNow table name to query",
5925
6258
  "name": "table",
5926
6259
  "required": true,
5927
6260
  "hasDynamicHelp": false,
5928
6261
  "multiple": false,
5929
6262
  "type": "option"
5930
6263
  },
5931
- "include-choices": {
5932
- "description": "Include field choices in the schema output",
5933
- "name": "include-choices",
6264
+ "query": {
6265
+ "char": "q",
6266
+ "description": "ServiceNow encoded query string",
6267
+ "name": "query",
5934
6268
  "required": false,
5935
- "allowNo": false,
5936
- "type": "boolean"
6269
+ "default": "",
6270
+ "hasDynamicHelp": false,
6271
+ "multiple": false,
6272
+ "type": "option"
5937
6273
  },
5938
- "include-relationships": {
5939
- "description": "Include table relationships in the schema output",
5940
- "name": "include-relationships",
6274
+ "fields": {
6275
+ "char": "f",
6276
+ "description": "Comma-separated list of fields to return",
6277
+ "name": "fields",
5941
6278
  "required": false,
5942
- "allowNo": false,
5943
- "type": "boolean"
6279
+ "hasDynamicHelp": false,
6280
+ "multiple": false,
6281
+ "type": "option"
5944
6282
  },
5945
- "include-ui-policies": {
5946
- "description": "Include UI policies in the schema output",
5947
- "name": "include-ui-policies",
6283
+ "display-value": {
6284
+ "char": "d",
6285
+ "description": "Return display values instead of internal values",
6286
+ "name": "display-value",
5948
6287
  "required": false,
5949
6288
  "allowNo": false,
5950
6289
  "type": "boolean"
5951
6290
  },
5952
- "include-business-rules": {
5953
- "description": "Include business rules in the schema output",
5954
- "name": "include-business-rules",
6291
+ "limit": {
6292
+ "char": "l",
6293
+ "description": "Maximum number of records to return",
6294
+ "name": "limit",
5955
6295
  "required": false,
5956
- "allowNo": false,
5957
- "type": "boolean"
6296
+ "default": 20,
6297
+ "hasDynamicHelp": false,
6298
+ "multiple": false,
6299
+ "type": "option"
5958
6300
  }
5959
6301
  },
5960
6302
  "hasDynamicHelp": false,
5961
6303
  "hiddenAliases": [],
5962
- "id": "schema",
6304
+ "id": "query",
5963
6305
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5964
6306
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5965
6307
  "pluginType": "core",
@@ -5969,22 +6311,26 @@
5969
6311
  "relativePath": [
5970
6312
  "dist",
5971
6313
  "commands",
5972
- "schema",
6314
+ "query",
5973
6315
  "index.js"
5974
6316
  ]
5975
6317
  },
5976
- "schema:validate-catalog": {
6318
+ "query:syslog": {
5977
6319
  "aliases": [],
5978
6320
  "args": {},
5979
- "description": "Validate a ServiceNow catalog item configuration for common issues.\n\nThis command checks a catalog item configuration and reports any validation issues, warnings, or errors found. Useful for ensuring catalog items are properly configured before deployment.",
6321
+ "description": "Query ServiceNow system logs (one-shot, non-tailing).\n\nRetrieves syslog records with optional encoded query filtering and configurable limits. For real-time log tailing, use the \"log tail\" command instead.\n\nFeatures:\n • Query syslog with encoded query strings\n • Configurable record limit\n • Formatted table output with timestamps, levels, and sources\n • JSON output for scripting",
5980
6322
  "examples": [
5981
6323
  {
5982
- "description": "Validate a catalog item by sys_id",
5983
- "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --auth dev"
6324
+ "description": "Query recent error logs",
6325
+ "command": "<%= config.bin %> <%= command.id %> --query \"level=2\" --limit 20 --auth dev"
5984
6326
  },
5985
6327
  {
5986
- "description": "Validate a catalog item with JSON output",
5987
- "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --json --auth dev"
6328
+ "description": "Query all recent syslog entries",
6329
+ "command": "<%= config.bin %> <%= command.id %> --limit 50 --auth dev"
6330
+ },
6331
+ {
6332
+ "description": "Query syslog as JSON",
6333
+ "command": "<%= config.bin %> <%= command.id %> --query \"sourceLIKEincident\" --json --auth dev"
5988
6334
  }
5989
6335
  ],
5990
6336
  "flags": {
@@ -6070,11 +6416,21 @@
6070
6416
  "allowNo": false,
6071
6417
  "type": "boolean"
6072
6418
  },
6073
- "sys-id": {
6074
- "char": "s",
6075
- "description": "Catalog item sys_id to validate",
6076
- "name": "sys-id",
6077
- "required": true,
6419
+ "query": {
6420
+ "char": "q",
6421
+ "description": "ServiceNow encoded query string for filtering syslog records",
6422
+ "name": "query",
6423
+ "required": false,
6424
+ "hasDynamicHelp": false,
6425
+ "multiple": false,
6426
+ "type": "option"
6427
+ },
6428
+ "limit": {
6429
+ "char": "l",
6430
+ "description": "Maximum number of syslog records to return",
6431
+ "name": "limit",
6432
+ "required": false,
6433
+ "default": 100,
6078
6434
  "hasDynamicHelp": false,
6079
6435
  "multiple": false,
6080
6436
  "type": "option"
@@ -6082,7 +6438,7 @@
6082
6438
  },
6083
6439
  "hasDynamicHelp": false,
6084
6440
  "hiddenAliases": [],
6085
- "id": "schema:validate-catalog",
6441
+ "id": "query:syslog",
6086
6442
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
6087
6443
  "pluginName": "@sonisoft/now-sdk-ext-cli",
6088
6444
  "pluginType": "core",
@@ -6092,8 +6448,8 @@
6092
6448
  "relativePath": [
6093
6449
  "dist",
6094
6450
  "commands",
6095
- "schema",
6096
- "validate-catalog.js"
6451
+ "query",
6452
+ "syslog.js"
6097
6453
  ]
6098
6454
  },
6099
6455
  "scope": {
@@ -7925,19 +8281,13 @@
7925
8281
  "validate.js"
7926
8282
  ]
7927
8283
  },
7928
- "task:approve": {
8284
+ "transaction:kill": {
7929
8285
  "aliases": [],
7930
8286
  "args": {},
7931
- "description": "Approve a ServiceNow change request.\n\nThis command approves a change request identified by its number. You can optionally provide approval comments.\n\nFeatures:\n - Approve change requests\n - Optionally add approval comments\n - Auto-resolves change request number to sys_id",
8287
+ "description": "Submit a request to terminate one active transaction. Platform acceptance does not mean immediate removal.\n\nOnly pass an identifier you deliberately selected from `nex transaction list`. Killing another user's transaction aborts their work.",
7932
8288
  "examples": [
7933
- {
7934
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --auth dev",
7935
- "description": "Approve a change request"
7936
- },
7937
- {
7938
- "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 -c \"Looks good, approved\" --auth dev",
7939
- "description": "Approve a change request with comments"
7940
- }
8289
+ "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --auth dev",
8290
+ "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --json --auth dev"
7941
8291
  ],
7942
8292
  "flags": {
7943
8293
  "json": {
@@ -8021,19 +8371,16 @@
8021
8371
  "allowNo": false,
8022
8372
  "type": "boolean"
8023
8373
  },
8024
- "comments": {
8025
- "char": "c",
8026
- "description": "Approval comments",
8027
- "name": "comments",
8028
- "required": false,
8029
- "hasDynamicHelp": false,
8030
- "multiple": false,
8031
- "type": "option"
8374
+ "confirm": {
8375
+ "description": "Confirm submission of the kill request.",
8376
+ "name": "confirm",
8377
+ "allowNo": false,
8378
+ "type": "boolean"
8032
8379
  },
8033
- "number": {
8034
- "char": "n",
8035
- "description": "Change request number (e.g., CHG0010001)",
8036
- "name": "number",
8380
+ "transaction-id": {
8381
+ "char": "t",
8382
+ "description": "Exact 32-character hexadecimal sys_id from `nex transaction list`.",
8383
+ "name": "transaction-id",
8037
8384
  "required": true,
8038
8385
  "hasDynamicHelp": false,
8039
8386
  "multiple": false,
@@ -8042,7 +8389,7 @@
8042
8389
  },
8043
8390
  "hasDynamicHelp": false,
8044
8391
  "hiddenAliases": [],
8045
- "id": "task:approve",
8392
+ "id": "transaction:kill",
8046
8393
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8047
8394
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8048
8395
  "pluginType": "core",
@@ -8052,27 +8399,19 @@
8052
8399
  "relativePath": [
8053
8400
  "dist",
8054
8401
  "commands",
8055
- "task",
8056
- "approve.js"
8402
+ "transaction",
8403
+ "kill.js"
8057
8404
  ]
8058
8405
  },
8059
- "task:assign": {
8406
+ "transaction:list": {
8060
8407
  "aliases": [],
8061
8408
  "args": {},
8062
- "description": "Assign a ServiceNow task to a user or group.\n\nThis command assigns a task record identified by its number to a specified user and/or group. You can assign to a user, a group, or both simultaneously.\n\nFeatures:\n - Assign tasks to individual users\n - Assign tasks to assignment groups\n - Assign to both user and group at once\n - Supports any task-based table\n - Auto-resolves task number to sys_id",
8409
+ "description": "List active transactions from all responding ServiceNow cluster nodes.",
8063
8410
  "examples": [
8064
- {
8065
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --user admin --auth dev",
8066
- "description": "Assign an incident to a user"
8067
- },
8068
- {
8069
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -u admin -g \"Service Desk\" --auth dev",
8070
- "description": "Assign an incident to a user and group"
8071
- },
8072
- {
8073
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --user admin --auth dev",
8074
- "description": "Assign a change request to a user"
8075
- }
8411
+ "<%= config.bin %> <%= command.id %> --auth dev",
8412
+ "<%= config.bin %> <%= command.id %> --json --auth dev",
8413
+ "<%= config.bin %> <%= command.id %> --query \"user=admin\" --limit 50 --auth dev",
8414
+ "<%= config.bin %> <%= command.id %> --timeout-ms 120000 --poll-interval-ms 2000 --auth dev"
8076
8415
  ],
8077
8416
  "flags": {
8078
8417
  "json": {
@@ -8156,38 +8495,32 @@
8156
8495
  "allowNo": false,
8157
8496
  "type": "boolean"
8158
8497
  },
8159
- "group": {
8160
- "char": "g",
8161
- "description": "Assignment group",
8162
- "name": "group",
8163
- "required": false,
8498
+ "limit": {
8499
+ "char": "l",
8500
+ "description": "Maximum transactions to return. Core default: 1000.",
8501
+ "name": "limit",
8164
8502
  "hasDynamicHelp": false,
8165
8503
  "multiple": false,
8166
8504
  "type": "option"
8167
8505
  },
8168
- "number": {
8169
- "char": "n",
8170
- "description": "Task number (e.g., INC0010001)",
8171
- "name": "number",
8172
- "required": true,
8506
+ "poll-interval-ms": {
8507
+ "description": "Interval between collection status polls. Core default: 1000.",
8508
+ "name": "poll-interval-ms",
8173
8509
  "hasDynamicHelp": false,
8174
8510
  "multiple": false,
8175
8511
  "type": "option"
8176
8512
  },
8177
- "table": {
8178
- "description": "ServiceNow table name",
8179
- "name": "table",
8180
- "required": false,
8181
- "default": "task",
8513
+ "query": {
8514
+ "char": "q",
8515
+ "description": "Encoded query used to filter transactions. Core default: none.",
8516
+ "name": "query",
8182
8517
  "hasDynamicHelp": false,
8183
8518
  "multiple": false,
8184
8519
  "type": "option"
8185
8520
  },
8186
- "user": {
8187
- "char": "u",
8188
- "description": "User to assign the task to",
8189
- "name": "user",
8190
- "required": true,
8521
+ "timeout-ms": {
8522
+ "description": "Collection timeout in milliseconds. Core default: 60000.",
8523
+ "name": "timeout-ms",
8191
8524
  "hasDynamicHelp": false,
8192
8525
  "multiple": false,
8193
8526
  "type": "option"
@@ -8195,7 +8528,7 @@
8195
8528
  },
8196
8529
  "hasDynamicHelp": false,
8197
8530
  "hiddenAliases": [],
8198
- "id": "task:assign",
8531
+ "id": "transaction:list",
8199
8532
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8200
8533
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8201
8534
  "pluginType": "core",
@@ -8205,22 +8538,22 @@
8205
8538
  "relativePath": [
8206
8539
  "dist",
8207
8540
  "commands",
8208
- "task",
8209
- "assign.js"
8541
+ "transaction",
8542
+ "list.js"
8210
8543
  ]
8211
8544
  },
8212
- "task:close": {
8545
+ "workflow:create": {
8213
8546
  "aliases": [],
8214
8547
  "args": {},
8215
- "description": "Close a ServiceNow incident.\n\nThis command closes an incident identified by its number, setting the close notes and optionally a close code. The incident must be in a state that allows closure.\n\nFeatures:\n - Close incidents with close notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
8548
+ "description": "Create a complete workflow from a JSON specification file.",
8216
8549
  "examples": [
8217
8550
  {
8218
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue confirmed resolved by user\" --auth dev",
8219
- "description": "Close an incident with close notes"
8551
+ "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
8552
+ "description": "Create a workflow from a JSON spec file"
8220
8553
  },
8221
8554
  {
8222
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Closed\" --close-code \"Solved (Permanently)\" --auth dev",
8223
- "description": "Close with a specific close code"
8555
+ "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
8556
+ "description": "Create a workflow and output result as JSON"
8224
8557
  }
8225
8558
  ],
8226
8559
  "flags": {
@@ -8305,26 +8638,10 @@
8305
8638
  "allowNo": false,
8306
8639
  "type": "boolean"
8307
8640
  },
8308
- "close-code": {
8309
- "description": "Close code for the closure",
8310
- "name": "close-code",
8311
- "required": false,
8312
- "hasDynamicHelp": false,
8313
- "multiple": false,
8314
- "type": "option"
8315
- },
8316
- "notes": {
8317
- "description": "Close notes",
8318
- "name": "notes",
8319
- "required": true,
8320
- "hasDynamicHelp": false,
8321
- "multiple": false,
8322
- "type": "option"
8323
- },
8324
- "number": {
8325
- "char": "n",
8326
- "description": "Incident number (e.g., INC0010001)",
8327
- "name": "number",
8641
+ "spec": {
8642
+ "char": "s",
8643
+ "description": "Path to workflow JSON specification file",
8644
+ "name": "spec",
8328
8645
  "required": true,
8329
8646
  "hasDynamicHelp": false,
8330
8647
  "multiple": false,
@@ -8333,7 +8650,7 @@
8333
8650
  },
8334
8651
  "hasDynamicHelp": false,
8335
8652
  "hiddenAliases": [],
8336
- "id": "task:close",
8653
+ "id": "workflow:create",
8337
8654
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8338
8655
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8339
8656
  "pluginType": "core",
@@ -8343,26 +8660,22 @@
8343
8660
  "relativePath": [
8344
8661
  "dist",
8345
8662
  "commands",
8346
- "task",
8347
- "close.js"
8663
+ "workflow",
8664
+ "create.js"
8348
8665
  ]
8349
8666
  },
8350
- "task:comment": {
8667
+ "workflow:publish": {
8351
8668
  "aliases": [],
8352
8669
  "args": {},
8353
- "description": "Add a comment or work note to a ServiceNow task.\n\nThis command adds a comment or work note to a task record identified by its number. By default, comments are added as customer-visible comments. Use the --work-note flag to add an internal work note instead.\n\nFeatures:\n - Add customer-visible comments to any task\n - Add internal work notes visible only to fulfiller teams\n - Supports any task-based table (incident, change_request, etc.)\n - Auto-resolves task number to sys_id",
8670
+ "description": "Publish a workflow version.",
8354
8671
  "examples": [
8355
8672
  {
8356
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --comment \"Investigating the issue\" --auth dev",
8357
- "description": "Add a comment to an incident"
8358
- },
8359
- {
8360
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -c \"Internal update\" --work-note --auth dev",
8361
- "description": "Add a work note to an incident"
8673
+ "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
8674
+ "description": "Publish a workflow version"
8362
8675
  },
8363
8676
  {
8364
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --comment \"Approved\" --auth dev",
8365
- "description": "Add a comment to a change request"
8677
+ "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
8678
+ "description": "Publish a workflow version and output as JSON"
8366
8679
  }
8367
8680
  ],
8368
8681
  "flags": {
@@ -8447,44 +8760,28 @@
8447
8760
  "allowNo": false,
8448
8761
  "type": "boolean"
8449
8762
  },
8450
- "comment": {
8451
- "char": "c",
8452
- "description": "Comment text to add",
8453
- "name": "comment",
8763
+ "start-activity": {
8764
+ "char": "s",
8765
+ "description": "Sys ID of the start activity",
8766
+ "name": "start-activity",
8454
8767
  "required": true,
8455
8768
  "hasDynamicHelp": false,
8456
8769
  "multiple": false,
8457
8770
  "type": "option"
8458
8771
  },
8459
- "number": {
8460
- "char": "n",
8461
- "description": "Task number (e.g., INC0010001)",
8462
- "name": "number",
8772
+ "version-id": {
8773
+ "char": "v",
8774
+ "description": "Sys ID of the workflow version to publish",
8775
+ "name": "version-id",
8463
8776
  "required": true,
8464
8777
  "hasDynamicHelp": false,
8465
8778
  "multiple": false,
8466
8779
  "type": "option"
8467
- },
8468
- "table": {
8469
- "description": "ServiceNow table name",
8470
- "name": "table",
8471
- "required": false,
8472
- "default": "task",
8473
- "hasDynamicHelp": false,
8474
- "multiple": false,
8475
- "type": "option"
8476
- },
8477
- "work-note": {
8478
- "description": "Add as work note instead of comment",
8479
- "name": "work-note",
8480
- "required": false,
8481
- "allowNo": false,
8482
- "type": "boolean"
8483
8780
  }
8484
8781
  },
8485
8782
  "hasDynamicHelp": false,
8486
8783
  "hiddenAliases": [],
8487
- "id": "task:comment",
8784
+ "id": "workflow:publish",
8488
8785
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8489
8786
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8490
8787
  "pluginType": "core",
@@ -8494,26 +8791,22 @@
8494
8791
  "relativePath": [
8495
8792
  "dist",
8496
8793
  "commands",
8497
- "task",
8498
- "comment.js"
8794
+ "workflow",
8795
+ "publish.js"
8499
8796
  ]
8500
8797
  },
8501
- "task:find": {
8798
+ "update-set:clone": {
8502
8799
  "aliases": [],
8503
8800
  "args": {},
8504
- "description": "Find a ServiceNow task by its number.\n\nThis command looks up a task record by its number in the specified table. Returns the full task details including sys_id, description, state, and assignment information.\n\nFeatures:\n - Look up any task by number\n - Supports any task-based table\n - JSON output for scripting and automation",
8505
- "examples": [
8506
- {
8507
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --auth dev",
8508
- "description": "Find an incident by number"
8509
- },
8801
+ "description": "Clone an update set and its records.",
8802
+ "examples": [
8510
8803
  {
8511
- "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 --table change_request --auth dev",
8512
- "description": "Find a change request by number"
8804
+ "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --auth dev-instance",
8805
+ "description": "Clone an update set"
8513
8806
  },
8514
8807
  {
8515
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --json --auth dev",
8516
- "description": "Find an incident and output as JSON"
8808
+ "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --json --auth dev-instance",
8809
+ "description": "Clone with JSON output"
8517
8810
  }
8518
8811
  ],
8519
8812
  "flags": {
@@ -8598,20 +8891,20 @@
8598
8891
  "allowNo": false,
8599
8892
  "type": "boolean"
8600
8893
  },
8601
- "number": {
8894
+ "name": {
8602
8895
  "char": "n",
8603
- "description": "Task number (e.g., INC0010001, CHG0010001)",
8604
- "name": "number",
8896
+ "description": "Name for the cloned update set",
8897
+ "name": "name",
8605
8898
  "required": true,
8606
8899
  "hasDynamicHelp": false,
8607
8900
  "multiple": false,
8608
8901
  "type": "option"
8609
8902
  },
8610
- "table": {
8611
- "description": "ServiceNow table name",
8612
- "name": "table",
8613
- "required": false,
8614
- "default": "task",
8903
+ "source": {
8904
+ "char": "s",
8905
+ "description": "Source update set sys_id",
8906
+ "name": "source",
8907
+ "required": true,
8615
8908
  "hasDynamicHelp": false,
8616
8909
  "multiple": false,
8617
8910
  "type": "option"
@@ -8619,7 +8912,7 @@
8619
8912
  },
8620
8913
  "hasDynamicHelp": false,
8621
8914
  "hiddenAliases": [],
8622
- "id": "task:find",
8915
+ "id": "update-set:clone",
8623
8916
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8624
8917
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8625
8918
  "pluginType": "core",
@@ -8629,22 +8922,26 @@
8629
8922
  "relativePath": [
8630
8923
  "dist",
8631
8924
  "commands",
8632
- "task",
8633
- "find.js"
8925
+ "update-set",
8926
+ "clone.js"
8634
8927
  ]
8635
8928
  },
8636
- "task:resolve": {
8929
+ "update-set:create": {
8637
8930
  "aliases": [],
8638
8931
  "args": {},
8639
- "description": "Resolve a ServiceNow incident with resolution notes.\n\nThis command resolves an incident identified by its number, setting the resolution notes and optionally a close code. The incident must be in a state that allows resolution.\n\nFeatures:\n - Resolve incidents with resolution notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
8932
+ "description": "Create a new update set.",
8640
8933
  "examples": [
8641
8934
  {
8642
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue resolved by restarting the service\" --auth dev",
8643
- "description": "Resolve an incident with resolution notes"
8935
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --auth dev-instance",
8936
+ "description": "Create a new update set with a name"
8644
8937
  },
8645
8938
  {
8646
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Fixed\" --close-code \"Solved (Permanently)\" --auth dev",
8647
- "description": "Resolve with a specific close code"
8939
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --description \"Update set for feature X\" --auth dev-instance",
8940
+ "description": "Create with name and description"
8941
+ },
8942
+ {
8943
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --application x_my_app --auth dev-instance",
8944
+ "description": "Create within a specific application scope"
8648
8945
  }
8649
8946
  ],
8650
8947
  "flags": {
@@ -8729,26 +9026,27 @@
8729
9026
  "allowNo": false,
8730
9027
  "type": "boolean"
8731
9028
  },
8732
- "close-code": {
8733
- "description": "Close code for the resolution",
8734
- "name": "close-code",
9029
+ "application": {
9030
+ "description": "Application scope for the new update set",
9031
+ "name": "application",
8735
9032
  "required": false,
8736
9033
  "hasDynamicHelp": false,
8737
9034
  "multiple": false,
8738
9035
  "type": "option"
8739
9036
  },
8740
- "notes": {
8741
- "description": "Resolution notes",
8742
- "name": "notes",
8743
- "required": true,
9037
+ "description": {
9038
+ "char": "d",
9039
+ "description": "Description for the new update set",
9040
+ "name": "description",
9041
+ "required": false,
8744
9042
  "hasDynamicHelp": false,
8745
9043
  "multiple": false,
8746
9044
  "type": "option"
8747
9045
  },
8748
- "number": {
9046
+ "name": {
8749
9047
  "char": "n",
8750
- "description": "Incident number (e.g., INC0010001)",
8751
- "name": "number",
9048
+ "description": "Name for the new update set",
9049
+ "name": "name",
8752
9050
  "required": true,
8753
9051
  "hasDynamicHelp": false,
8754
9052
  "multiple": false,
@@ -8757,7 +9055,7 @@
8757
9055
  },
8758
9056
  "hasDynamicHelp": false,
8759
9057
  "hiddenAliases": [],
8760
- "id": "task:resolve",
9058
+ "id": "update-set:create",
8761
9059
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8762
9060
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8763
9061
  "pluginType": "core",
@@ -8767,17 +9065,27 @@
8767
9065
  "relativePath": [
8768
9066
  "dist",
8769
9067
  "commands",
8770
- "task",
8771
- "resolve.js"
9068
+ "update-set",
9069
+ "create.js"
8772
9070
  ]
8773
9071
  },
8774
- "transaction:kill": {
9072
+ "update-set:current": {
8775
9073
  "aliases": [],
8776
9074
  "args": {},
8777
- "description": "Submit a request to terminate one active transaction. Platform acceptance does not mean immediate removal.\n\nOnly pass an identifier you deliberately selected from `nex transaction list`. Killing another user's transaction aborts their work.",
9075
+ "description": "Get or set the current update set.",
8778
9076
  "examples": [
8779
- "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --auth dev",
8780
- "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --json --auth dev"
9077
+ {
9078
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9079
+ "description": "Get the current update set"
9080
+ },
9081
+ {
9082
+ "command": "<%= config.bin %> <%= command.id %> --set us-001 --auth dev-instance",
9083
+ "description": "Set the current update set by sys_id"
9084
+ },
9085
+ {
9086
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9087
+ "description": "Get the current update set as JSON"
9088
+ }
8781
9089
  ],
8782
9090
  "flags": {
8783
9091
  "json": {
@@ -8861,17 +9169,11 @@
8861
9169
  "allowNo": false,
8862
9170
  "type": "boolean"
8863
9171
  },
8864
- "confirm": {
8865
- "description": "Confirm submission of the kill request.",
8866
- "name": "confirm",
8867
- "allowNo": false,
8868
- "type": "boolean"
8869
- },
8870
- "transaction-id": {
8871
- "char": "t",
8872
- "description": "Exact 32-character hexadecimal sys_id from `nex transaction list`.",
8873
- "name": "transaction-id",
8874
- "required": true,
9172
+ "set": {
9173
+ "char": "s",
9174
+ "description": "sys_id of update set to make current",
9175
+ "name": "set",
9176
+ "required": false,
8875
9177
  "hasDynamicHelp": false,
8876
9178
  "multiple": false,
8877
9179
  "type": "option"
@@ -8879,7 +9181,7 @@
8879
9181
  },
8880
9182
  "hasDynamicHelp": false,
8881
9183
  "hiddenAliases": [],
8882
- "id": "transaction:kill",
9184
+ "id": "update-set:current",
8883
9185
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8884
9186
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8885
9187
  "pluginType": "core",
@@ -8889,19 +9191,27 @@
8889
9191
  "relativePath": [
8890
9192
  "dist",
8891
9193
  "commands",
8892
- "transaction",
8893
- "kill.js"
9194
+ "update-set",
9195
+ "current.js"
8894
9196
  ]
8895
9197
  },
8896
- "transaction:list": {
9198
+ "update-set": {
8897
9199
  "aliases": [],
8898
9200
  "args": {},
8899
- "description": "List active transactions from all responding ServiceNow cluster nodes.",
9201
+ "description": "List update sets on a ServiceNow instance.",
8900
9202
  "examples": [
8901
- "<%= config.bin %> <%= command.id %> --auth dev",
8902
- "<%= config.bin %> <%= command.id %> --json --auth dev",
8903
- "<%= config.bin %> <%= command.id %> --query \"user=admin\" --limit 50 --auth dev",
8904
- "<%= config.bin %> <%= command.id %> --timeout-ms 120000 --poll-interval-ms 2000 --auth dev"
9203
+ {
9204
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9205
+ "description": "List update sets with default limit"
9206
+ },
9207
+ {
9208
+ "command": "<%= config.bin %> <%= command.id %> --query \"state=in progress\" --limit 50 --auth dev-instance",
9209
+ "description": "List update sets with a custom query filter"
9210
+ },
9211
+ {
9212
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9213
+ "description": "List update sets with JSON output"
9214
+ }
8905
9215
  ],
8906
9216
  "flags": {
8907
9217
  "json": {
@@ -8986,31 +9296,19 @@
8986
9296
  "type": "boolean"
8987
9297
  },
8988
9298
  "limit": {
8989
- "char": "l",
8990
- "description": "Maximum transactions to return. Core default: 1000.",
9299
+ "description": "Maximum number of update sets to return",
8991
9300
  "name": "limit",
8992
- "hasDynamicHelp": false,
8993
- "multiple": false,
8994
- "type": "option"
8995
- },
8996
- "poll-interval-ms": {
8997
- "description": "Interval between collection status polls. Core default: 1000.",
8998
- "name": "poll-interval-ms",
9301
+ "required": false,
9302
+ "default": 20,
8999
9303
  "hasDynamicHelp": false,
9000
9304
  "multiple": false,
9001
9305
  "type": "option"
9002
9306
  },
9003
9307
  "query": {
9004
9308
  "char": "q",
9005
- "description": "Encoded query used to filter transactions. Core default: none.",
9309
+ "description": "Encoded query filter",
9006
9310
  "name": "query",
9007
- "hasDynamicHelp": false,
9008
- "multiple": false,
9009
- "type": "option"
9010
- },
9011
- "timeout-ms": {
9012
- "description": "Collection timeout in milliseconds. Core default: 60000.",
9013
- "name": "timeout-ms",
9311
+ "required": false,
9014
9312
  "hasDynamicHelp": false,
9015
9313
  "multiple": false,
9016
9314
  "type": "option"
@@ -9018,7 +9316,7 @@
9018
9316
  },
9019
9317
  "hasDynamicHelp": false,
9020
9318
  "hiddenAliases": [],
9021
- "id": "transaction:list",
9319
+ "id": "update-set",
9022
9320
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9023
9321
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9024
9322
  "pluginType": "core",
@@ -9028,22 +9326,22 @@
9028
9326
  "relativePath": [
9029
9327
  "dist",
9030
9328
  "commands",
9031
- "transaction",
9032
- "list.js"
9329
+ "update-set",
9330
+ "index.js"
9033
9331
  ]
9034
9332
  },
9035
- "update-set:clone": {
9333
+ "update-set:inspect": {
9036
9334
  "aliases": [],
9037
9335
  "args": {},
9038
- "description": "Clone an update set and its records.",
9336
+ "description": "Inspect the components of an update set.",
9039
9337
  "examples": [
9040
9338
  {
9041
- "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --auth dev-instance",
9042
- "description": "Clone an update set"
9339
+ "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --auth dev-instance",
9340
+ "description": "Inspect an update set by sys_id"
9043
9341
  },
9044
9342
  {
9045
- "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --json --auth dev-instance",
9046
- "description": "Clone with JSON output"
9343
+ "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --json --auth dev-instance",
9344
+ "description": "Inspect with JSON output"
9047
9345
  }
9048
9346
  ],
9049
9347
  "flags": {
@@ -9128,19 +9426,10 @@
9128
9426
  "allowNo": false,
9129
9427
  "type": "boolean"
9130
9428
  },
9131
- "name": {
9132
- "char": "n",
9133
- "description": "Name for the cloned update set",
9134
- "name": "name",
9135
- "required": true,
9136
- "hasDynamicHelp": false,
9137
- "multiple": false,
9138
- "type": "option"
9139
- },
9140
- "source": {
9429
+ "sys-id": {
9141
9430
  "char": "s",
9142
- "description": "Source update set sys_id",
9143
- "name": "source",
9431
+ "description": "sys_id of the update set to inspect",
9432
+ "name": "sys-id",
9144
9433
  "required": true,
9145
9434
  "hasDynamicHelp": false,
9146
9435
  "multiple": false,
@@ -9149,7 +9438,7 @@
9149
9438
  },
9150
9439
  "hasDynamicHelp": false,
9151
9440
  "hiddenAliases": [],
9152
- "id": "update-set:clone",
9441
+ "id": "update-set:inspect",
9153
9442
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9154
9443
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9155
9444
  "pluginType": "core",
@@ -9160,25 +9449,25 @@
9160
9449
  "dist",
9161
9450
  "commands",
9162
9451
  "update-set",
9163
- "clone.js"
9452
+ "inspect.js"
9164
9453
  ]
9165
9454
  },
9166
- "update-set:create": {
9455
+ "update-set:move": {
9167
9456
  "aliases": [],
9168
9457
  "args": {},
9169
- "description": "Create a new update set.",
9458
+ "description": "Move records between update sets.",
9170
9459
  "examples": [
9171
9460
  {
9172
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --auth dev-instance",
9173
- "description": "Create a new update set with a name"
9461
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --auth dev-instance",
9462
+ "description": "Move all records from one update set to another"
9174
9463
  },
9175
9464
  {
9176
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --description \"Update set for feature X\" --auth dev-instance",
9177
- "description": "Create with name and description"
9465
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --records \"rec-001,rec-002,rec-003\" --auth dev-instance",
9466
+ "description": "Move specific records to a target update set"
9178
9467
  },
9179
9468
  {
9180
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --application x_my_app --auth dev-instance",
9181
- "description": "Create within a specific application scope"
9469
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --json --auth dev-instance",
9470
+ "description": "Move records with JSON output"
9182
9471
  }
9183
9472
  ],
9184
9473
  "flags": {
@@ -9263,27 +9552,25 @@
9263
9552
  "allowNo": false,
9264
9553
  "type": "boolean"
9265
9554
  },
9266
- "application": {
9267
- "description": "Application scope for the new update set",
9268
- "name": "application",
9555
+ "records": {
9556
+ "description": "Comma-separated sys_ids of records to move",
9557
+ "name": "records",
9269
9558
  "required": false,
9270
9559
  "hasDynamicHelp": false,
9271
9560
  "multiple": false,
9272
9561
  "type": "option"
9273
9562
  },
9274
- "description": {
9275
- "char": "d",
9276
- "description": "Description for the new update set",
9277
- "name": "description",
9563
+ "source": {
9564
+ "description": "Source update set sys_id",
9565
+ "name": "source",
9278
9566
  "required": false,
9279
9567
  "hasDynamicHelp": false,
9280
9568
  "multiple": false,
9281
9569
  "type": "option"
9282
9570
  },
9283
- "name": {
9284
- "char": "n",
9285
- "description": "Name for the new update set",
9286
- "name": "name",
9571
+ "target": {
9572
+ "description": "Target update set sys_id",
9573
+ "name": "target",
9287
9574
  "required": true,
9288
9575
  "hasDynamicHelp": false,
9289
9576
  "multiple": false,
@@ -9292,7 +9579,7 @@
9292
9579
  },
9293
9580
  "hasDynamicHelp": false,
9294
9581
  "hiddenAliases": [],
9295
- "id": "update-set:create",
9582
+ "id": "update-set:move",
9296
9583
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9297
9584
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9298
9585
  "pluginType": "core",
@@ -9303,25 +9590,21 @@
9303
9590
  "dist",
9304
9591
  "commands",
9305
9592
  "update-set",
9306
- "create.js"
9593
+ "move.js"
9307
9594
  ]
9308
9595
  },
9309
- "update-set:current": {
9596
+ "task:approve": {
9310
9597
  "aliases": [],
9311
9598
  "args": {},
9312
- "description": "Get or set the current update set.",
9599
+ "description": "Approve a ServiceNow change request.\n\nThis command approves a change request identified by its number. You can optionally provide approval comments.\n\nFeatures:\n - Approve change requests\n - Optionally add approval comments\n - Auto-resolves change request number to sys_id",
9313
9600
  "examples": [
9314
9601
  {
9315
- "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9316
- "description": "Get the current update set"
9317
- },
9318
- {
9319
- "command": "<%= config.bin %> <%= command.id %> --set us-001 --auth dev-instance",
9320
- "description": "Set the current update set by sys_id"
9602
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --auth dev",
9603
+ "description": "Approve a change request"
9321
9604
  },
9322
9605
  {
9323
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9324
- "description": "Get the current update set as JSON"
9606
+ "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 -c \"Looks good, approved\" --auth dev",
9607
+ "description": "Approve a change request with comments"
9325
9608
  }
9326
9609
  ],
9327
9610
  "flags": {
@@ -9403,14 +9686,23 @@
9403
9686
  "helpGroup": "GLOBAL",
9404
9687
  "name": "read-only",
9405
9688
  "required": false,
9406
- "allowNo": false,
9407
- "type": "boolean"
9689
+ "allowNo": false,
9690
+ "type": "boolean"
9691
+ },
9692
+ "comments": {
9693
+ "char": "c",
9694
+ "description": "Approval comments",
9695
+ "name": "comments",
9696
+ "required": false,
9697
+ "hasDynamicHelp": false,
9698
+ "multiple": false,
9699
+ "type": "option"
9408
9700
  },
9409
- "set": {
9410
- "char": "s",
9411
- "description": "sys_id of update set to make current",
9412
- "name": "set",
9413
- "required": false,
9701
+ "number": {
9702
+ "char": "n",
9703
+ "description": "Change request number (e.g., CHG0010001)",
9704
+ "name": "number",
9705
+ "required": true,
9414
9706
  "hasDynamicHelp": false,
9415
9707
  "multiple": false,
9416
9708
  "type": "option"
@@ -9418,7 +9710,7 @@
9418
9710
  },
9419
9711
  "hasDynamicHelp": false,
9420
9712
  "hiddenAliases": [],
9421
- "id": "update-set:current",
9713
+ "id": "task:approve",
9422
9714
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9423
9715
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9424
9716
  "pluginType": "core",
@@ -9428,26 +9720,26 @@
9428
9720
  "relativePath": [
9429
9721
  "dist",
9430
9722
  "commands",
9431
- "update-set",
9432
- "current.js"
9723
+ "task",
9724
+ "approve.js"
9433
9725
  ]
9434
9726
  },
9435
- "update-set": {
9727
+ "task:assign": {
9436
9728
  "aliases": [],
9437
9729
  "args": {},
9438
- "description": "List update sets on a ServiceNow instance.",
9730
+ "description": "Assign a ServiceNow task to a user or group.\n\nThis command assigns a task record identified by its number to a specified user and/or group. You can assign to a user, a group, or both simultaneously.\n\nFeatures:\n - Assign tasks to individual users\n - Assign tasks to assignment groups\n - Assign to both user and group at once\n - Supports any task-based table\n - Auto-resolves task number to sys_id",
9439
9731
  "examples": [
9440
9732
  {
9441
- "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9442
- "description": "List update sets with default limit"
9733
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --user admin --auth dev",
9734
+ "description": "Assign an incident to a user"
9443
9735
  },
9444
9736
  {
9445
- "command": "<%= config.bin %> <%= command.id %> --query \"state=in progress\" --limit 50 --auth dev-instance",
9446
- "description": "List update sets with a custom query filter"
9737
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -u admin -g \"Service Desk\" --auth dev",
9738
+ "description": "Assign an incident to a user and group"
9447
9739
  },
9448
9740
  {
9449
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9450
- "description": "List update sets with JSON output"
9741
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --user admin --auth dev",
9742
+ "description": "Assign a change request to a user"
9451
9743
  }
9452
9744
  ],
9453
9745
  "flags": {
@@ -9532,20 +9824,38 @@
9532
9824
  "allowNo": false,
9533
9825
  "type": "boolean"
9534
9826
  },
9535
- "limit": {
9536
- "description": "Maximum number of update sets to return",
9537
- "name": "limit",
9827
+ "group": {
9828
+ "char": "g",
9829
+ "description": "Assignment group",
9830
+ "name": "group",
9538
9831
  "required": false,
9539
- "default": 20,
9540
9832
  "hasDynamicHelp": false,
9541
9833
  "multiple": false,
9542
9834
  "type": "option"
9543
9835
  },
9544
- "query": {
9545
- "char": "q",
9546
- "description": "Encoded query filter",
9547
- "name": "query",
9836
+ "number": {
9837
+ "char": "n",
9838
+ "description": "Task number (e.g., INC0010001)",
9839
+ "name": "number",
9840
+ "required": true,
9841
+ "hasDynamicHelp": false,
9842
+ "multiple": false,
9843
+ "type": "option"
9844
+ },
9845
+ "table": {
9846
+ "description": "ServiceNow table name",
9847
+ "name": "table",
9548
9848
  "required": false,
9849
+ "default": "task",
9850
+ "hasDynamicHelp": false,
9851
+ "multiple": false,
9852
+ "type": "option"
9853
+ },
9854
+ "user": {
9855
+ "char": "u",
9856
+ "description": "User to assign the task to",
9857
+ "name": "user",
9858
+ "required": true,
9549
9859
  "hasDynamicHelp": false,
9550
9860
  "multiple": false,
9551
9861
  "type": "option"
@@ -9553,7 +9863,7 @@
9553
9863
  },
9554
9864
  "hasDynamicHelp": false,
9555
9865
  "hiddenAliases": [],
9556
- "id": "update-set",
9866
+ "id": "task:assign",
9557
9867
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9558
9868
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9559
9869
  "pluginType": "core",
@@ -9563,22 +9873,22 @@
9563
9873
  "relativePath": [
9564
9874
  "dist",
9565
9875
  "commands",
9566
- "update-set",
9567
- "index.js"
9876
+ "task",
9877
+ "assign.js"
9568
9878
  ]
9569
9879
  },
9570
- "update-set:inspect": {
9880
+ "task:close": {
9571
9881
  "aliases": [],
9572
9882
  "args": {},
9573
- "description": "Inspect the components of an update set.",
9883
+ "description": "Close a ServiceNow incident.\n\nThis command closes an incident identified by its number, setting the close notes and optionally a close code. The incident must be in a state that allows closure.\n\nFeatures:\n - Close incidents with close notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
9574
9884
  "examples": [
9575
9885
  {
9576
- "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --auth dev-instance",
9577
- "description": "Inspect an update set by sys_id"
9886
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue confirmed resolved by user\" --auth dev",
9887
+ "description": "Close an incident with close notes"
9578
9888
  },
9579
9889
  {
9580
- "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --json --auth dev-instance",
9581
- "description": "Inspect with JSON output"
9890
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Closed\" --close-code \"Solved (Permanently)\" --auth dev",
9891
+ "description": "Close with a specific close code"
9582
9892
  }
9583
9893
  ],
9584
9894
  "flags": {
@@ -9663,10 +9973,26 @@
9663
9973
  "allowNo": false,
9664
9974
  "type": "boolean"
9665
9975
  },
9666
- "sys-id": {
9667
- "char": "s",
9668
- "description": "sys_id of the update set to inspect",
9669
- "name": "sys-id",
9976
+ "close-code": {
9977
+ "description": "Close code for the closure",
9978
+ "name": "close-code",
9979
+ "required": false,
9980
+ "hasDynamicHelp": false,
9981
+ "multiple": false,
9982
+ "type": "option"
9983
+ },
9984
+ "notes": {
9985
+ "description": "Close notes",
9986
+ "name": "notes",
9987
+ "required": true,
9988
+ "hasDynamicHelp": false,
9989
+ "multiple": false,
9990
+ "type": "option"
9991
+ },
9992
+ "number": {
9993
+ "char": "n",
9994
+ "description": "Incident number (e.g., INC0010001)",
9995
+ "name": "number",
9670
9996
  "required": true,
9671
9997
  "hasDynamicHelp": false,
9672
9998
  "multiple": false,
@@ -9675,7 +10001,7 @@
9675
10001
  },
9676
10002
  "hasDynamicHelp": false,
9677
10003
  "hiddenAliases": [],
9678
- "id": "update-set:inspect",
10004
+ "id": "task:close",
9679
10005
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9680
10006
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9681
10007
  "pluginType": "core",
@@ -9685,26 +10011,26 @@
9685
10011
  "relativePath": [
9686
10012
  "dist",
9687
10013
  "commands",
9688
- "update-set",
9689
- "inspect.js"
10014
+ "task",
10015
+ "close.js"
9690
10016
  ]
9691
10017
  },
9692
- "update-set:move": {
10018
+ "task:comment": {
9693
10019
  "aliases": [],
9694
10020
  "args": {},
9695
- "description": "Move records between update sets.",
10021
+ "description": "Add a comment or work note to a ServiceNow task.\n\nThis command adds a comment or work note to a task record identified by its number. By default, comments are added as customer-visible comments. Use the --work-note flag to add an internal work note instead.\n\nFeatures:\n - Add customer-visible comments to any task\n - Add internal work notes visible only to fulfiller teams\n - Supports any task-based table (incident, change_request, etc.)\n - Auto-resolves task number to sys_id",
9696
10022
  "examples": [
9697
10023
  {
9698
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --auth dev-instance",
9699
- "description": "Move all records from one update set to another"
10024
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --comment \"Investigating the issue\" --auth dev",
10025
+ "description": "Add a comment to an incident"
9700
10026
  },
9701
10027
  {
9702
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --records \"rec-001,rec-002,rec-003\" --auth dev-instance",
9703
- "description": "Move specific records to a target update set"
10028
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -c \"Internal update\" --work-note --auth dev",
10029
+ "description": "Add a work note to an incident"
9704
10030
  },
9705
10031
  {
9706
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --json --auth dev-instance",
9707
- "description": "Move records with JSON output"
10032
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --comment \"Approved\" --auth dev",
10033
+ "description": "Add a comment to a change request"
9708
10034
  }
9709
10035
  ],
9710
10036
  "flags": {
@@ -9789,34 +10115,44 @@
9789
10115
  "allowNo": false,
9790
10116
  "type": "boolean"
9791
10117
  },
9792
- "records": {
9793
- "description": "Comma-separated sys_ids of records to move",
9794
- "name": "records",
9795
- "required": false,
10118
+ "comment": {
10119
+ "char": "c",
10120
+ "description": "Comment text to add",
10121
+ "name": "comment",
10122
+ "required": true,
9796
10123
  "hasDynamicHelp": false,
9797
10124
  "multiple": false,
9798
10125
  "type": "option"
9799
10126
  },
9800
- "source": {
9801
- "description": "Source update set sys_id",
9802
- "name": "source",
9803
- "required": false,
10127
+ "number": {
10128
+ "char": "n",
10129
+ "description": "Task number (e.g., INC0010001)",
10130
+ "name": "number",
10131
+ "required": true,
9804
10132
  "hasDynamicHelp": false,
9805
10133
  "multiple": false,
9806
10134
  "type": "option"
9807
10135
  },
9808
- "target": {
9809
- "description": "Target update set sys_id",
9810
- "name": "target",
9811
- "required": true,
10136
+ "table": {
10137
+ "description": "ServiceNow table name",
10138
+ "name": "table",
10139
+ "required": false,
10140
+ "default": "task",
9812
10141
  "hasDynamicHelp": false,
9813
10142
  "multiple": false,
9814
10143
  "type": "option"
10144
+ },
10145
+ "work-note": {
10146
+ "description": "Add as work note instead of comment",
10147
+ "name": "work-note",
10148
+ "required": false,
10149
+ "allowNo": false,
10150
+ "type": "boolean"
9815
10151
  }
9816
10152
  },
9817
10153
  "hasDynamicHelp": false,
9818
10154
  "hiddenAliases": [],
9819
- "id": "update-set:move",
10155
+ "id": "task:comment",
9820
10156
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9821
10157
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9822
10158
  "pluginType": "core",
@@ -9826,22 +10162,26 @@
9826
10162
  "relativePath": [
9827
10163
  "dist",
9828
10164
  "commands",
9829
- "update-set",
9830
- "move.js"
10165
+ "task",
10166
+ "comment.js"
9831
10167
  ]
9832
10168
  },
9833
- "workflow:create": {
10169
+ "task:find": {
9834
10170
  "aliases": [],
9835
10171
  "args": {},
9836
- "description": "Create a complete workflow from a JSON specification file.",
10172
+ "description": "Find a ServiceNow task by its number.\n\nThis command looks up a task record by its number in the specified table. Returns the full task details including sys_id, description, state, and assignment information.\n\nFeatures:\n - Look up any task by number\n - Supports any task-based table\n - JSON output for scripting and automation",
9837
10173
  "examples": [
9838
10174
  {
9839
- "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
9840
- "description": "Create a workflow from a JSON spec file"
10175
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --auth dev",
10176
+ "description": "Find an incident by number"
9841
10177
  },
9842
10178
  {
9843
- "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
9844
- "description": "Create a workflow and output result as JSON"
10179
+ "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 --table change_request --auth dev",
10180
+ "description": "Find a change request by number"
10181
+ },
10182
+ {
10183
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --json --auth dev",
10184
+ "description": "Find an incident and output as JSON"
9845
10185
  }
9846
10186
  ],
9847
10187
  "flags": {
@@ -9926,19 +10266,28 @@
9926
10266
  "allowNo": false,
9927
10267
  "type": "boolean"
9928
10268
  },
9929
- "spec": {
9930
- "char": "s",
9931
- "description": "Path to workflow JSON specification file",
9932
- "name": "spec",
10269
+ "number": {
10270
+ "char": "n",
10271
+ "description": "Task number (e.g., INC0010001, CHG0010001)",
10272
+ "name": "number",
9933
10273
  "required": true,
9934
10274
  "hasDynamicHelp": false,
9935
10275
  "multiple": false,
9936
10276
  "type": "option"
10277
+ },
10278
+ "table": {
10279
+ "description": "ServiceNow table name",
10280
+ "name": "table",
10281
+ "required": false,
10282
+ "default": "task",
10283
+ "hasDynamicHelp": false,
10284
+ "multiple": false,
10285
+ "type": "option"
9937
10286
  }
9938
10287
  },
9939
10288
  "hasDynamicHelp": false,
9940
10289
  "hiddenAliases": [],
9941
- "id": "workflow:create",
10290
+ "id": "task:find",
9942
10291
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9943
10292
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9944
10293
  "pluginType": "core",
@@ -9948,22 +10297,22 @@
9948
10297
  "relativePath": [
9949
10298
  "dist",
9950
10299
  "commands",
9951
- "workflow",
9952
- "create.js"
10300
+ "task",
10301
+ "find.js"
9953
10302
  ]
9954
10303
  },
9955
- "workflow:publish": {
10304
+ "task:resolve": {
9956
10305
  "aliases": [],
9957
10306
  "args": {},
9958
- "description": "Publish a workflow version.",
10307
+ "description": "Resolve a ServiceNow incident with resolution notes.\n\nThis command resolves an incident identified by its number, setting the resolution notes and optionally a close code. The incident must be in a state that allows resolution.\n\nFeatures:\n - Resolve incidents with resolution notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
9959
10308
  "examples": [
9960
10309
  {
9961
- "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
9962
- "description": "Publish a workflow version"
10310
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue resolved by restarting the service\" --auth dev",
10311
+ "description": "Resolve an incident with resolution notes"
9963
10312
  },
9964
10313
  {
9965
- "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
9966
- "description": "Publish a workflow version and output as JSON"
10314
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Fixed\" --close-code \"Solved (Permanently)\" --auth dev",
10315
+ "description": "Resolve with a specific close code"
9967
10316
  }
9968
10317
  ],
9969
10318
  "flags": {
@@ -10048,19 +10397,26 @@
10048
10397
  "allowNo": false,
10049
10398
  "type": "boolean"
10050
10399
  },
10051
- "start-activity": {
10052
- "char": "s",
10053
- "description": "Sys ID of the start activity",
10054
- "name": "start-activity",
10400
+ "close-code": {
10401
+ "description": "Close code for the resolution",
10402
+ "name": "close-code",
10403
+ "required": false,
10404
+ "hasDynamicHelp": false,
10405
+ "multiple": false,
10406
+ "type": "option"
10407
+ },
10408
+ "notes": {
10409
+ "description": "Resolution notes",
10410
+ "name": "notes",
10055
10411
  "required": true,
10056
10412
  "hasDynamicHelp": false,
10057
10413
  "multiple": false,
10058
10414
  "type": "option"
10059
10415
  },
10060
- "version-id": {
10061
- "char": "v",
10062
- "description": "Sys ID of the workflow version to publish",
10063
- "name": "version-id",
10416
+ "number": {
10417
+ "char": "n",
10418
+ "description": "Incident number (e.g., INC0010001)",
10419
+ "name": "number",
10064
10420
  "required": true,
10065
10421
  "hasDynamicHelp": false,
10066
10422
  "multiple": false,
@@ -10069,7 +10425,7 @@
10069
10425
  },
10070
10426
  "hasDynamicHelp": false,
10071
10427
  "hiddenAliases": [],
10072
- "id": "workflow:publish",
10428
+ "id": "task:resolve",
10073
10429
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10074
10430
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10075
10431
  "pluginType": "core",
@@ -10079,8 +10435,8 @@
10079
10435
  "relativePath": [
10080
10436
  "dist",
10081
10437
  "commands",
10082
- "workflow",
10083
- "publish.js"
10438
+ "task",
10439
+ "resolve.js"
10084
10440
  ]
10085
10441
  },
10086
10442
  "xml:export": {
@@ -10361,5 +10717,5 @@
10361
10717
  ]
10362
10718
  }
10363
10719
  },
10364
- "version": "5.4.0"
10720
+ "version": "5.5.0"
10365
10721
  }