@sonisoft/now-sdk-ext-cli 1.1.0-alpha.2 → 2.0.0-alpha.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.
Files changed (45) hide show
  1. package/README.md +1825 -34
  2. package/dist/commands/app/index.d.ts +4 -1
  3. package/dist/commands/app/index.d.ts.map +1 -1
  4. package/dist/commands/app/index.js +31 -6
  5. package/dist/commands/app/index.js.map +1 -1
  6. package/dist/commands/app/install.d.ts +4 -1
  7. package/dist/commands/app/install.d.ts.map +1 -1
  8. package/dist/commands/app/install.js +40 -6
  9. package/dist/commands/app/install.js.map +1 -1
  10. package/dist/commands/app/repo-install.d.ts +19 -0
  11. package/dist/commands/app/repo-install.d.ts.map +1 -0
  12. package/dist/commands/app/repo-install.js +173 -0
  13. package/dist/commands/app/repo-install.js.map +1 -0
  14. package/dist/commands/app/repo-list.d.ts +17 -0
  15. package/dist/commands/app/repo-list.d.ts.map +1 -0
  16. package/dist/commands/app/repo-list.js +152 -0
  17. package/dist/commands/app/repo-list.js.map +1 -0
  18. package/dist/commands/app/uninstall.d.ts +16 -0
  19. package/dist/commands/app/uninstall.d.ts.map +1 -0
  20. package/dist/commands/app/uninstall.js +70 -0
  21. package/dist/commands/app/uninstall.js.map +1 -0
  22. package/dist/commands/atf/index.d.ts +71 -0
  23. package/dist/commands/atf/index.d.ts.map +1 -0
  24. package/dist/commands/atf/index.js +256 -0
  25. package/dist/commands/atf/index.js.map +1 -0
  26. package/dist/commands/exec/index.d.ts +17 -3
  27. package/dist/commands/exec/index.d.ts.map +1 -1
  28. package/dist/commands/exec/index.js +286 -26
  29. package/dist/commands/exec/index.js.map +1 -1
  30. package/dist/commands/log/index.d.ts +46 -0
  31. package/dist/commands/log/index.d.ts.map +1 -0
  32. package/dist/commands/log/index.js +418 -0
  33. package/dist/commands/log/index.js.map +1 -0
  34. package/dist/common/authenticated-command.js +2 -2
  35. package/dist/common/authenticated-command.js.map +1 -1
  36. package/dist/common/scope-autocomplete.d.ts +20 -0
  37. package/dist/common/scope-autocomplete.d.ts.map +1 -0
  38. package/dist/common/scope-autocomplete.js +94 -0
  39. package/dist/common/scope-autocomplete.js.map +1 -0
  40. package/dist/common/utils.d.ts +2 -0
  41. package/dist/common/utils.d.ts.map +1 -0
  42. package/dist/common/utils.js +4 -0
  43. package/dist/common/utils.js.map +1 -0
  44. package/oclif.manifest.json +691 -12
  45. package/package.json +32 -12
@@ -3,9 +3,20 @@
3
3
  "app": {
4
4
  "aliases": [],
5
5
  "args": {},
6
- "description": "",
6
+ "description": "Manage ServiceNow applications: uninstall applications from your instance.\n\nThis command provides programmatic control over ServiceNow applications, allowing you to uninstall applications remotely. This is useful for automated environment cleanup, testing workflows, and application lifecycle management.\n\nFeatures:\n • Uninstall applications by sys_id and scope\n • Automated application removal in CI/CD pipelines\n • Proper cleanup and rollback handling\n • Detailed logging and error reporting\n\nRequirements:\n • User must have admin role\n • Application must be in a removable state\n • Both application sys_id and scope are required",
7
7
  "examples": [
8
- "<%= config.bin %> <%= command.id %> exec global test.js --auth sn_alias\ntest\n"
8
+ {
9
+ "description": "Uninstall an application by sys_id and scope",
10
+ "command": "<%= config.bin %> <%= command.id %> --uninstall --applicationId a1b2c3d4e5f6 --scope x_my_custom_app --auth dev-instance"
11
+ },
12
+ {
13
+ "description": "Uninstall with enhanced debug logging",
14
+ "command": "<%= config.bin %> <%= command.id %> -u -i a1b2c3d4e5f6 -s x_my_custom_app --auth dev-instance --log-level debug"
15
+ },
16
+ {
17
+ "description": "Uninstall using short flags",
18
+ "command": "<%= config.bin %> <%= command.id %> -u -i a1b2c3d4e5f6 -s x_my_custom_app -a dev-instance"
19
+ }
9
20
  ],
10
21
  "flags": {
11
22
  "json": {
@@ -86,9 +97,20 @@
86
97
  "app:install": {
87
98
  "aliases": [],
88
99
  "args": {},
89
- "description": "Install or Upgrade application(s) from batch definition file",
100
+ "description": "Install or upgrade multiple ServiceNow applications from a batch definition file.\n\nThis command enables automated installation and upgrade of multiple applications using a JSON definition file. Perfect for setting up new environments, deploying application bundles, or managing application dependencies. The batch file can specify multiple applications with their versions, scopes, and installation options.\n\nFeatures:\n • Install multiple applications in a single operation\n • Upgrade existing applications to new versions\n • Control demo data loading per application\n • Detailed installation progress and results\n • Automatic dependency resolution\n • Rollback support on failures\n\nBatch Definition Format:\n The JSON file should contain an \"applications\" array with objects defining:\n • name: Application name\n • scope: Application scope (e.g., x_my_app)\n • version: Target version number\n • load_demo_data: Whether to load demo data (optional)\n • notes: Installation notes (optional)",
90
101
  "examples": [
91
- "<%= config.bin %> <%= command.id %> exec global test.js --auth sn_alias\ntest\n"
102
+ {
103
+ "command": "<%= config.bin %> <%= command.id %> --batch --definitionPath ./apps-to-install.json --auth dev-instance",
104
+ "description": "Install applications from a batch definition file"
105
+ },
106
+ {
107
+ "command": "<%= config.bin %> <%= command.id %> -b -d ./batch-apps.json -a dev-instance",
108
+ "description": "Install with short flags"
109
+ },
110
+ {
111
+ "command": "<%= config.bin %> <%= command.id %> -b -d ./apps.json -a dev-instance --log-level debug",
112
+ "description": "Install with debug logging to troubleshoot issues"
113
+ }
92
114
  ],
93
115
  "flags": {
94
116
  "json": {
@@ -125,7 +147,7 @@
125
147
  },
126
148
  "batch": {
127
149
  "char": "b",
128
- "description": "Install from batch definition file",
150
+ "description": "Enable batch installation mode from definition file",
129
151
  "name": "batch",
130
152
  "required": false,
131
153
  "allowNo": false,
@@ -133,7 +155,7 @@
133
155
  },
134
156
  "definitionPath": {
135
157
  "char": "d",
136
- "description": "Batch definition file",
158
+ "description": "Path to JSON batch definition file containing applications to install",
137
159
  "name": "definitionPath",
138
160
  "required": false,
139
161
  "hasDynamicHelp": false,
@@ -157,23 +179,547 @@
157
179
  "install.js"
158
180
  ]
159
181
  },
182
+ "app:repo-install": {
183
+ "aliases": [],
184
+ "args": {},
185
+ "description": "Install an application from your ServiceNow company repository.\n\nThis command installs an application from your company's internal application repository. You can specify the application by its scope name, and optionally specify a particular version. The command will automatically look up the application details and initiate the installation.\n\nFeatures:\n • Install applications by scope name\n • Automatic lookup of application sys_id\n • Optional version specification (defaults to latest)\n • Wait for installation completion with progress monitoring\n • No-wait mode for background installations\n • Configurable polling intervals and timeouts\n • Detailed installation status and error reporting\n\nInstallation Process:\n 1. Looks up the application in the company repository by scope\n 2. Verifies the application is available and installable\n 3. Initiates the installation via CI/CD API\n 4. Monitors progress until completion (unless --no-wait specified)\n 5. Reports final status and any errors\n\nRequirements:\n • User must have sn_cicd.sys_ci_automation role\n • Application must exist in company repository\n • Application must not be already installed (or use upgrade)",
186
+ "examples": [
187
+ {
188
+ "command": "<%= config.bin %> <%= command.id %> --scope x_my_custom_app --auth dev-instance",
189
+ "description": "Install application by scope (latest version)"
190
+ },
191
+ {
192
+ "command": "<%= config.bin %> <%= command.id %> --scope x_my_app --version 2.1.0 --auth dev-instance",
193
+ "description": "Install specific version of an application"
194
+ },
195
+ {
196
+ "command": "<%= config.bin %> <%= command.id %> --scope x_my_app --no-wait --auth dev-instance",
197
+ "description": "Install without waiting for completion"
198
+ },
199
+ {
200
+ "command": "<%= config.bin %> <%= command.id %> -s x_my_app -a dev-instance --timeout 3600000",
201
+ "description": "Install with custom timeout (1 hour)"
202
+ },
203
+ {
204
+ "command": "<%= config.bin %> <%= command.id %> -s x_my_app -a dev-instance --log-level debug",
205
+ "description": "Install with debug logging"
206
+ }
207
+ ],
208
+ "flags": {
209
+ "json": {
210
+ "description": "Format output as json.",
211
+ "helpGroup": "GLOBAL",
212
+ "name": "json",
213
+ "allowNo": false,
214
+ "type": "boolean"
215
+ },
216
+ "auth": {
217
+ "char": "a",
218
+ "description": "Auth alias to use.",
219
+ "name": "auth",
220
+ "required": false,
221
+ "hasDynamicHelp": false,
222
+ "multiple": false,
223
+ "type": "option"
224
+ },
225
+ "log-level": {
226
+ "helpGroup": "GLOBAL",
227
+ "name": "log-level",
228
+ "summary": "Specify level for logging.",
229
+ "default": "info",
230
+ "hasDynamicHelp": false,
231
+ "multiple": false,
232
+ "options": [
233
+ "debug",
234
+ "warn",
235
+ "error",
236
+ "info",
237
+ "trace"
238
+ ],
239
+ "type": "option"
240
+ },
241
+ "no-wait": {
242
+ "char": "w",
243
+ "description": "Do not wait for installation to complete",
244
+ "name": "no-wait",
245
+ "required": false,
246
+ "allowNo": false,
247
+ "type": "boolean"
248
+ },
249
+ "poll-interval": {
250
+ "description": "Polling interval in milliseconds (default: 5000)",
251
+ "name": "poll-interval",
252
+ "required": false,
253
+ "default": 5000,
254
+ "hasDynamicHelp": false,
255
+ "multiple": false,
256
+ "type": "option"
257
+ },
258
+ "scope": {
259
+ "char": "s",
260
+ "description": "Application scope (e.g., x_my_custom_app)",
261
+ "name": "scope",
262
+ "required": true,
263
+ "hasDynamicHelp": false,
264
+ "multiple": false,
265
+ "type": "option"
266
+ },
267
+ "timeout": {
268
+ "char": "t",
269
+ "description": "Installation timeout in milliseconds (default: 1800000 = 30 min)",
270
+ "name": "timeout",
271
+ "required": false,
272
+ "default": 1800000,
273
+ "hasDynamicHelp": false,
274
+ "multiple": false,
275
+ "type": "option"
276
+ },
277
+ "version": {
278
+ "char": "v",
279
+ "description": "Specific version to install (defaults to latest)",
280
+ "name": "version",
281
+ "required": false,
282
+ "hasDynamicHelp": false,
283
+ "multiple": false,
284
+ "type": "option"
285
+ }
286
+ },
287
+ "hasDynamicHelp": false,
288
+ "hiddenAliases": [],
289
+ "id": "app:repo-install",
290
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
291
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
292
+ "pluginType": "core",
293
+ "strict": true,
294
+ "enableJsonFlag": true,
295
+ "isESM": true,
296
+ "relativePath": [
297
+ "dist",
298
+ "commands",
299
+ "app",
300
+ "repo-install.js"
301
+ ]
302
+ },
303
+ "app:repo-list": {
304
+ "aliases": [],
305
+ "args": {},
306
+ "description": "List applications available in your ServiceNow company repository.\n\nThis command retrieves and displays all applications that are available in your company's internal application repository. These are applications that have been published internally and are available for installation across your ServiceNow instances.\n\nFeatures:\n • List all available company repository applications\n • Filter to show only installed applications\n • Filter to show only installable (not yet installed) applications\n • View application details including versions and dependencies\n • JSON output support for automation and scripting\n • Vendor-based filtering\n\nUse Cases:\n • Discover available applications for installation\n • Audit installed company applications\n • Find applications that can be upgraded\n • Integration with CI/CD pipelines\n • Automated environment setup and configuration",
307
+ "examples": [
308
+ {
309
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
310
+ "description": "List all company repository applications"
311
+ },
312
+ {
313
+ "command": "<%= config.bin %> <%= command.id %> --installed --auth dev-instance",
314
+ "description": "List only installed applications"
315
+ },
316
+ {
317
+ "command": "<%= config.bin %> <%= command.id %> --installable --auth dev-instance",
318
+ "description": "List only installable (not installed) applications"
319
+ },
320
+ {
321
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
322
+ "description": "Get JSON output for scripting"
323
+ },
324
+ {
325
+ "command": "<%= config.bin %> <%= command.id %> -a dev-instance",
326
+ "description": "List with short flags"
327
+ }
328
+ ],
329
+ "flags": {
330
+ "json": {
331
+ "char": "j",
332
+ "description": "Output results as JSON",
333
+ "name": "json",
334
+ "required": false,
335
+ "allowNo": false,
336
+ "type": "boolean"
337
+ },
338
+ "auth": {
339
+ "char": "a",
340
+ "description": "Auth alias to use.",
341
+ "name": "auth",
342
+ "required": false,
343
+ "hasDynamicHelp": false,
344
+ "multiple": false,
345
+ "type": "option"
346
+ },
347
+ "log-level": {
348
+ "helpGroup": "GLOBAL",
349
+ "name": "log-level",
350
+ "summary": "Specify level for logging.",
351
+ "default": "info",
352
+ "hasDynamicHelp": false,
353
+ "multiple": false,
354
+ "options": [
355
+ "debug",
356
+ "warn",
357
+ "error",
358
+ "info",
359
+ "trace"
360
+ ],
361
+ "type": "option"
362
+ },
363
+ "installable": {
364
+ "char": "n",
365
+ "description": "Show only applications that can be installed (not yet installed)",
366
+ "name": "installable",
367
+ "required": false,
368
+ "allowNo": false,
369
+ "type": "boolean"
370
+ },
371
+ "installed": {
372
+ "char": "i",
373
+ "description": "Show only installed applications",
374
+ "name": "installed",
375
+ "required": false,
376
+ "allowNo": false,
377
+ "type": "boolean"
378
+ }
379
+ },
380
+ "hasDynamicHelp": false,
381
+ "hiddenAliases": [],
382
+ "id": "app:repo-list",
383
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
384
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
385
+ "pluginType": "core",
386
+ "strict": true,
387
+ "enableJsonFlag": true,
388
+ "isESM": true,
389
+ "relativePath": [
390
+ "dist",
391
+ "commands",
392
+ "app",
393
+ "repo-list.js"
394
+ ]
395
+ },
396
+ "app:uninstall": {
397
+ "aliases": [],
398
+ "args": {},
399
+ "description": "Uninstall a ServiceNow application from your instance.\n\nThis command provides programmatic control over ServiceNow application removal, allowing you to uninstall applications remotely. This is useful for automated environment cleanup, testing workflows, and application lifecycle management.\n\nFeatures:\n • Uninstall applications by sys_id and scope\n • Automated application removal in CI/CD pipelines\n • Proper cleanup and rollback handling\n • Detailed logging and error reporting\n\nRequirements:\n • User must have admin role\n • Application must be in a removable state\n • Both application sys_id and scope are required",
400
+ "examples": [
401
+ {
402
+ "command": "<%= config.bin %> <%= command.id %> --applicationId a1b2c3d4e5f6 --scope x_my_custom_app --auth dev-instance",
403
+ "description": "Uninstall an application by sys_id and scope"
404
+ },
405
+ {
406
+ "command": "<%= config.bin %> <%= command.id %> -i a1b2c3d4e5f6 -s x_my_custom_app --auth dev-instance --log-level debug",
407
+ "description": "Uninstall with enhanced debug logging"
408
+ },
409
+ {
410
+ "command": "<%= config.bin %> <%= command.id %> -i a1b2c3d4e5f6 -s x_my_custom_app -a dev-instance",
411
+ "description": "Uninstall using short flags"
412
+ }
413
+ ],
414
+ "flags": {
415
+ "json": {
416
+ "description": "Format output as json.",
417
+ "helpGroup": "GLOBAL",
418
+ "name": "json",
419
+ "allowNo": false,
420
+ "type": "boolean"
421
+ },
422
+ "auth": {
423
+ "char": "a",
424
+ "description": "Auth alias to use.",
425
+ "name": "auth",
426
+ "required": false,
427
+ "hasDynamicHelp": false,
428
+ "multiple": false,
429
+ "type": "option"
430
+ },
431
+ "log-level": {
432
+ "helpGroup": "GLOBAL",
433
+ "name": "log-level",
434
+ "summary": "Specify level for logging.",
435
+ "default": "info",
436
+ "hasDynamicHelp": false,
437
+ "multiple": false,
438
+ "options": [
439
+ "debug",
440
+ "warn",
441
+ "error",
442
+ "info",
443
+ "trace"
444
+ ],
445
+ "type": "option"
446
+ },
447
+ "applicationId": {
448
+ "char": "i",
449
+ "description": "Application sys_id",
450
+ "name": "applicationId",
451
+ "required": true,
452
+ "hasDynamicHelp": false,
453
+ "multiple": false,
454
+ "type": "option"
455
+ },
456
+ "scope": {
457
+ "char": "s",
458
+ "description": "Scope of application",
459
+ "name": "scope",
460
+ "required": true,
461
+ "hasDynamicHelp": false,
462
+ "multiple": false,
463
+ "type": "option"
464
+ }
465
+ },
466
+ "hasDynamicHelp": false,
467
+ "hiddenAliases": [],
468
+ "id": "app:uninstall",
469
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
470
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
471
+ "pluginType": "core",
472
+ "strict": true,
473
+ "enableJsonFlag": true,
474
+ "isESM": true,
475
+ "relativePath": [
476
+ "dist",
477
+ "commands",
478
+ "app",
479
+ "uninstall.js"
480
+ ]
481
+ },
482
+ "atf": {
483
+ "aliases": [],
484
+ "args": {},
485
+ "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",
486
+ "examples": [
487
+ {
488
+ "description": "Execute a single ATF test by sys_id",
489
+ "command": "<%= config.bin %> <%= command.id %> --test-id f717a8c783103210621e78c6feaad396 --auth dev-instance"
490
+ },
491
+ {
492
+ "description": "Execute a test suite by sys_id and wait for completion",
493
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --auth dev-instance --wait"
494
+ },
495
+ {
496
+ "description": "Execute a test suite by name",
497
+ "command": "<%= config.bin %> <%= command.id %> --suite-name \"Smoke Tests\" --auth dev-instance"
498
+ },
499
+ {
500
+ "description": "Execute with specific browser configuration",
501
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --browser chrome --auth dev-instance"
502
+ },
503
+ {
504
+ "description": "Execute as performance test with JSON output for CI/CD",
505
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --performance --json --auth dev-instance"
506
+ },
507
+ {
508
+ "description": "Execute with custom poll interval (10 seconds)",
509
+ "command": "<%= config.bin %> <%= command.id %> --suite-id e077e00b83103210621e78c6feaad383 --poll-interval 10000 --auth dev-instance"
510
+ }
511
+ ],
512
+ "flags": {
513
+ "json": {
514
+ "char": "j",
515
+ "description": "Output results as JSON",
516
+ "name": "json",
517
+ "required": false,
518
+ "allowNo": false,
519
+ "type": "boolean"
520
+ },
521
+ "auth": {
522
+ "char": "a",
523
+ "description": "Auth alias to use.",
524
+ "name": "auth",
525
+ "required": false,
526
+ "hasDynamicHelp": false,
527
+ "multiple": false,
528
+ "type": "option"
529
+ },
530
+ "log-level": {
531
+ "helpGroup": "GLOBAL",
532
+ "name": "log-level",
533
+ "summary": "Specify level for logging.",
534
+ "default": "info",
535
+ "hasDynamicHelp": false,
536
+ "multiple": false,
537
+ "options": [
538
+ "debug",
539
+ "warn",
540
+ "error",
541
+ "info",
542
+ "trace"
543
+ ],
544
+ "type": "option"
545
+ },
546
+ "test-id": {
547
+ "char": "t",
548
+ "description": "Test sys_id to execute",
549
+ "exclusive": [
550
+ "suite-id",
551
+ "suite-name"
552
+ ],
553
+ "name": "test-id",
554
+ "required": false,
555
+ "hasDynamicHelp": false,
556
+ "multiple": false,
557
+ "type": "option"
558
+ },
559
+ "suite-id": {
560
+ "char": "s",
561
+ "description": "Test Suite sys_id to execute",
562
+ "exclusive": [
563
+ "test-id",
564
+ "suite-name"
565
+ ],
566
+ "name": "suite-id",
567
+ "required": false,
568
+ "hasDynamicHelp": false,
569
+ "multiple": false,
570
+ "type": "option"
571
+ },
572
+ "suite-name": {
573
+ "char": "n",
574
+ "description": "Test Suite name to execute",
575
+ "exclusive": [
576
+ "test-id",
577
+ "suite-id"
578
+ ],
579
+ "name": "suite-name",
580
+ "required": false,
581
+ "hasDynamicHelp": false,
582
+ "multiple": false,
583
+ "type": "option"
584
+ },
585
+ "wait": {
586
+ "char": "w",
587
+ "description": "Wait for test suite execution to complete and return results",
588
+ "name": "wait",
589
+ "required": false,
590
+ "allowNo": false,
591
+ "type": "boolean"
592
+ },
593
+ "poll-interval": {
594
+ "char": "p",
595
+ "description": "Polling interval in milliseconds when waiting for completion",
596
+ "name": "poll-interval",
597
+ "required": false,
598
+ "default": 5000,
599
+ "hasDynamicHelp": false,
600
+ "multiple": false,
601
+ "type": "option"
602
+ },
603
+ "browser": {
604
+ "char": "b",
605
+ "description": "Browser name for test execution (e.g., chrome, firefox)",
606
+ "name": "browser",
607
+ "required": false,
608
+ "hasDynamicHelp": false,
609
+ "multiple": false,
610
+ "type": "option"
611
+ },
612
+ "browser-version": {
613
+ "description": "Browser version for test execution",
614
+ "name": "browser-version",
615
+ "required": false,
616
+ "hasDynamicHelp": false,
617
+ "multiple": false,
618
+ "type": "option"
619
+ },
620
+ "os-name": {
621
+ "description": "Operating system name for test execution",
622
+ "name": "os-name",
623
+ "required": false,
624
+ "hasDynamicHelp": false,
625
+ "multiple": false,
626
+ "type": "option"
627
+ },
628
+ "os-version": {
629
+ "description": "Operating system version for test execution",
630
+ "name": "os-version",
631
+ "required": false,
632
+ "hasDynamicHelp": false,
633
+ "multiple": false,
634
+ "type": "option"
635
+ },
636
+ "performance": {
637
+ "description": "Run as performance test",
638
+ "name": "performance",
639
+ "required": false,
640
+ "allowNo": false,
641
+ "type": "boolean"
642
+ },
643
+ "cloud": {
644
+ "description": "Run in cloud",
645
+ "name": "cloud",
646
+ "required": false,
647
+ "allowNo": false,
648
+ "type": "boolean"
649
+ }
650
+ },
651
+ "hasDynamicHelp": false,
652
+ "hiddenAliases": [],
653
+ "id": "atf",
654
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
655
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
656
+ "pluginType": "core",
657
+ "strict": true,
658
+ "enableJsonFlag": true,
659
+ "isESM": true,
660
+ "relativePath": [
661
+ "dist",
662
+ "commands",
663
+ "atf",
664
+ "index.js"
665
+ ]
666
+ },
160
667
  "exec": {
161
668
  "aliases": [],
162
669
  "args": {
163
670
  "scope": {
164
- "description": "Scope to execute file in.",
671
+ "description": "Scope to execute script in. Use \"global\" for global scope.",
165
672
  "name": "scope",
166
673
  "required": true
167
674
  },
168
675
  "file": {
169
- "description": "File to execute in scripts background.",
676
+ "description": "File to execute in scripts background. If omitted, starts REPL mode.",
170
677
  "name": "file",
171
- "required": true
678
+ "required": false
172
679
  }
173
680
  },
174
- "description": "Execute a local javascript file on a ServiceNow instance using Scripts - Background remotely. Returns the output/raw console output that Scripts - Background outputs to the browser in order to support the execution and result being piped to another command.",
681
+ "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",
175
682
  "examples": [
176
- "<%= config.bin %> <%= command.id %> exec global test.js --auth sn_alias\ntest\n"
683
+ {
684
+ "description": "Start REPL in global scope",
685
+ "command": "<%= config.bin %> <%= command.id %> global --auth dev-instance"
686
+ },
687
+ {
688
+ "description": "Start REPL in custom application scope",
689
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app --auth dev-instance"
690
+ },
691
+ {
692
+ "description": "Execute a script file in global scope",
693
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/cleanup.js --auth dev-instance"
694
+ },
695
+ {
696
+ "description": "Execute a script file in a custom application scope",
697
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app ./scripts/app-config.js --auth dev-instance"
698
+ },
699
+ {
700
+ "description": "Execute a parameterized script with single parameter",
701
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/query-user.js --auth dev-instance --params '{\"username\":\"admin\"}'"
702
+ },
703
+ {
704
+ "description": "Execute a parameterized script with multiple parameters",
705
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/update-record.js --auth dev-instance --params '{\"table\":\"incident\",\"field\":\"priority\",\"value\":\"1\"}'"
706
+ },
707
+ {
708
+ "description": "Execute and save output to a file",
709
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
710
+ },
711
+ {
712
+ "description": "Execute and pipe output to grep for filtering",
713
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
714
+ },
715
+ {
716
+ "description": "Execute with debug logging to troubleshoot issues",
717
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
718
+ },
719
+ {
720
+ "description": "Execute with parameters for template replacement",
721
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
722
+ }
177
723
  ],
178
724
  "flags": {
179
725
  "json": {
@@ -207,6 +753,15 @@
207
753
  "trace"
208
754
  ],
209
755
  "type": "option"
756
+ },
757
+ "params": {
758
+ "char": "p",
759
+ "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
760
+ "name": "params",
761
+ "required": false,
762
+ "hasDynamicHelp": false,
763
+ "multiple": false,
764
+ "type": "option"
210
765
  }
211
766
  },
212
767
  "hasDynamicHelp": false,
@@ -217,6 +772,7 @@
217
772
  "pluginType": "core",
218
773
  "strict": true,
219
774
  "enableJsonFlag": true,
775
+ "autocomplete": {},
220
776
  "isESM": true,
221
777
  "relativePath": [
222
778
  "dist",
@@ -224,7 +780,130 @@
224
780
  "exec",
225
781
  "index.js"
226
782
  ]
783
+ },
784
+ "log": {
785
+ "aliases": [],
786
+ "args": {},
787
+ "description": "Tail and monitor ServiceNow system logs in real-time with beautiful formatting.\n\nThis command provides real-time log monitoring with enhanced visual formatting using color-coded output that makes logs easy to scan and understand at a glance. Automatically highlights errors, warnings, success messages, and important keywords.\n\nKey Features:\n • Real-time log tailing (like Unix tail -f)\n • Powerful filtering with multiple operators (CONTAINS, REGEX, EQUALS, etc.)\n • Smart keyword highlighting (errors in red, warnings in yellow, etc.)\n • Beautiful color-coded console output with chalk\n • Export logs to file with automatic appending\n • Fast 1-second default polling interval\n • Timestamps and sequence numbers for each log\n • Graceful shutdown with Ctrl+C\n • Clean output without colors (--no-color flag)\n\nSmart Highlighting:\n • Error terms (error, exception, failed) - highlighted in RED\n • Warning terms (warn, warning, deprecated) - highlighted in YELLOW\n • Success terms (success, completed, done) - highlighted in GREEN\n • System terms (system, user, transaction) - highlighted in BLUE\n\nFiltering:\n • Apply filters using --filter flag with syntax: \"field OPERATOR value\"\n • Supports case-sensitive and case-insensitive operations\n • Multiple filters are combined with AND logic\n • Operators: CONTAINS, CONTAINS_CI, EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI,\n ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_CONTAINS_CI, NOT_EQUALS, NOT_EQUALS_CI\n\nUse Cases:\n • Monitor logs during application development\n • Debug issues in real-time\n • Track system events during deployments\n • Filter logs for specific application or component\n • Quickly spot errors and warnings\n • Collect logs for analysis or audit trails\n\n⚠️ IMPORTANT NOTES:\n • Press Ctrl+C to stop tailing and exit gracefully\n • Log files are created/appended automatically\n • Uses ChannelAjax when available for better performance\n • Default poll interval is 1 second for real-time monitoring",
788
+ "examples": [
789
+ {
790
+ "description": "Tail all logs in real-time",
791
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance"
792
+ },
793
+ {
794
+ "description": "Tail logs and save to a file",
795
+ "command": "<%= config.bin %> <%= command.id %> --output ./logs/instance-logs.txt --auth dev-instance"
796
+ },
797
+ {
798
+ "description": "Tail logs with custom polling interval (500ms for faster updates)",
799
+ "command": "<%= config.bin %> <%= command.id %> --interval 500 --auth dev-instance"
800
+ },
801
+ {
802
+ "description": "Filter logs containing specific text (case-insensitive)",
803
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS_CI error\" --auth dev-instance"
804
+ },
805
+ {
806
+ "description": "Filter logs with multiple conditions (AND logic)",
807
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message CONTAINS x_taniu_tan_core\" --filter \"message CONTAINS error\" --auth dev-instance"
808
+ },
809
+ {
810
+ "description": "Filter logs using regex pattern",
811
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message REGEX .*exception.*\" --auth dev-instance"
812
+ },
813
+ {
814
+ "description": "Filter logs by message starting with a pattern",
815
+ "command": "<%= config.bin %> <%= command.id %> --filter \"message STARTS_WITH [ERROR]\" --auth dev-instance"
816
+ },
817
+ {
818
+ "description": "Tail logs without colored output",
819
+ "command": "<%= config.bin %> <%= command.id %> --no-color --auth dev-instance"
820
+ }
821
+ ],
822
+ "flags": {
823
+ "json": {
824
+ "description": "Format output as json.",
825
+ "helpGroup": "GLOBAL",
826
+ "name": "json",
827
+ "allowNo": false,
828
+ "type": "boolean"
829
+ },
830
+ "auth": {
831
+ "char": "a",
832
+ "description": "Auth alias to use.",
833
+ "name": "auth",
834
+ "required": false,
835
+ "hasDynamicHelp": false,
836
+ "multiple": false,
837
+ "type": "option"
838
+ },
839
+ "log-level": {
840
+ "helpGroup": "GLOBAL",
841
+ "name": "log-level",
842
+ "summary": "Specify level for logging.",
843
+ "default": "info",
844
+ "hasDynamicHelp": false,
845
+ "multiple": false,
846
+ "options": [
847
+ "debug",
848
+ "warn",
849
+ "error",
850
+ "info",
851
+ "trace"
852
+ ],
853
+ "type": "option"
854
+ },
855
+ "output": {
856
+ "char": "o",
857
+ "description": "Output file path to save logs. Creates parent directories if needed.",
858
+ "name": "output",
859
+ "required": false,
860
+ "hasDynamicHelp": false,
861
+ "multiple": false,
862
+ "type": "option"
863
+ },
864
+ "interval": {
865
+ "char": "i",
866
+ "description": "Polling interval in milliseconds",
867
+ "name": "interval",
868
+ "required": false,
869
+ "default": 1000,
870
+ "hasDynamicHelp": false,
871
+ "multiple": false,
872
+ "type": "option"
873
+ },
874
+ "no-color": {
875
+ "description": "Disable colored output",
876
+ "name": "no-color",
877
+ "required": false,
878
+ "allowNo": false,
879
+ "type": "boolean"
880
+ },
881
+ "filter": {
882
+ "char": "f",
883
+ "description": "Filter logs by field and value. Syntax: field OPERATOR value. Operators: CONTAINS, CONTAINS_CI (case-insensitive), EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI, ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_EQUALS. Field defaults to \"message\" if omitted. Multiple filters are combined with AND logic.",
884
+ "name": "filter",
885
+ "required": false,
886
+ "hasDynamicHelp": false,
887
+ "multiple": true,
888
+ "type": "option"
889
+ }
890
+ },
891
+ "hasDynamicHelp": false,
892
+ "hiddenAliases": [],
893
+ "id": "log",
894
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
895
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
896
+ "pluginType": "core",
897
+ "strict": true,
898
+ "enableJsonFlag": true,
899
+ "isESM": true,
900
+ "relativePath": [
901
+ "dist",
902
+ "commands",
903
+ "log",
904
+ "index.js"
905
+ ]
227
906
  }
228
907
  },
229
- "version": "1.1.0-alpha.2"
908
+ "version": "2.0.0-alpha.0"
230
909
  }