@sonisoft/now-sdk-ext-cli 2.0.0-alpha.0 → 2.1.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.
- package/README.md +2971 -313
- package/dist/commands/aggregate/count.d.ts +16 -0
- package/dist/commands/aggregate/count.d.ts.map +1 -0
- package/dist/commands/aggregate/count.js +67 -0
- package/dist/commands/aggregate/count.js.map +1 -0
- package/dist/commands/aggregate/group.d.ts +24 -0
- package/dist/commands/aggregate/group.d.ts.map +1 -0
- package/dist/commands/aggregate/group.js +120 -0
- package/dist/commands/aggregate/group.js.map +1 -0
- package/dist/commands/aggregate/query.d.ts +21 -0
- package/dist/commands/aggregate/query.d.ts.map +1 -0
- package/dist/commands/aggregate/query.js +100 -0
- package/dist/commands/aggregate/query.js.map +1 -0
- package/dist/commands/app/index.d.ts +0 -1
- package/dist/commands/app/index.d.ts.map +1 -1
- package/dist/commands/app/index.js +2 -2
- package/dist/commands/app/index.js.map +1 -1
- package/dist/commands/app/install.d.ts +0 -1
- package/dist/commands/app/install.d.ts.map +1 -1
- package/dist/commands/app/install.js +1 -2
- package/dist/commands/app/install.js.map +1 -1
- package/dist/commands/app/repo-install.d.ts +0 -1
- package/dist/commands/app/repo-install.d.ts.map +1 -1
- package/dist/commands/app/repo-install.js +1 -3
- package/dist/commands/app/repo-install.js.map +1 -1
- package/dist/commands/app/repo-list.d.ts +0 -1
- package/dist/commands/app/repo-list.d.ts.map +1 -1
- package/dist/commands/app/repo-list.js +1 -3
- package/dist/commands/app/repo-list.js.map +1 -1
- package/dist/commands/app/uninstall.d.ts +0 -1
- package/dist/commands/app/uninstall.d.ts.map +1 -1
- package/dist/commands/app/uninstall.js +1 -2
- package/dist/commands/app/uninstall.js.map +1 -1
- package/dist/commands/atf/index.d.ts +0 -46
- package/dist/commands/atf/index.d.ts.map +1 -1
- package/dist/commands/atf/index.js +48 -121
- package/dist/commands/atf/index.js.map +1 -1
- package/dist/commands/attachment/get.d.ts +14 -0
- package/dist/commands/attachment/get.d.ts.map +1 -0
- package/dist/commands/attachment/get.js +44 -0
- package/dist/commands/attachment/get.js.map +1 -0
- package/dist/commands/attachment/list.d.ts +16 -0
- package/dist/commands/attachment/list.d.ts.map +1 -0
- package/dist/commands/attachment/list.js +60 -0
- package/dist/commands/attachment/list.js.map +1 -0
- package/dist/commands/attachment/upload.d.ts +17 -0
- package/dist/commands/attachment/upload.d.ts.map +1 -0
- package/dist/commands/attachment/upload.js +71 -0
- package/dist/commands/attachment/upload.js.map +1 -0
- package/dist/commands/batch/create.d.ts +15 -0
- package/dist/commands/batch/create.d.ts.map +1 -0
- package/dist/commands/batch/create.js +56 -0
- package/dist/commands/batch/create.js.map +1 -0
- package/dist/commands/batch/update.d.ts +15 -0
- package/dist/commands/batch/update.d.ts.map +1 -0
- package/dist/commands/batch/update.js +56 -0
- package/dist/commands/batch/update.js.map +1 -0
- package/dist/commands/bulk/delete.d.ts +18 -0
- package/dist/commands/bulk/delete.d.ts.map +1 -0
- package/dist/commands/bulk/delete.js +95 -0
- package/dist/commands/bulk/delete.js.map +1 -0
- package/dist/commands/bulk/update.d.ts +19 -0
- package/dist/commands/bulk/update.d.ts.map +1 -0
- package/dist/commands/bulk/update.js +110 -0
- package/dist/commands/bulk/update.js.map +1 -0
- package/dist/commands/exec/index.d.ts +0 -1
- package/dist/commands/exec/index.d.ts.map +1 -1
- package/dist/commands/exec/index.js +12 -22
- package/dist/commands/exec/index.js.map +1 -1
- package/dist/commands/flow/action.d.ts +19 -0
- package/dist/commands/flow/action.d.ts.map +1 -0
- package/dist/commands/flow/action.js +88 -0
- package/dist/commands/flow/action.js.map +1 -0
- package/dist/commands/flow/cancel.d.ts +17 -0
- package/dist/commands/flow/cancel.d.ts.map +1 -0
- package/dist/commands/flow/cancel.js +60 -0
- package/dist/commands/flow/cancel.js.map +1 -0
- package/dist/commands/flow/error.d.ts +16 -0
- package/dist/commands/flow/error.d.ts.map +1 -0
- package/dist/commands/flow/error.js +51 -0
- package/dist/commands/flow/error.js.map +1 -0
- package/dist/commands/flow/message.d.ts +18 -0
- package/dist/commands/flow/message.d.ts.map +1 -0
- package/dist/commands/flow/message.js +66 -0
- package/dist/commands/flow/message.js.map +1 -0
- package/dist/commands/flow/outputs.d.ts +16 -0
- package/dist/commands/flow/outputs.d.ts.map +1 -0
- package/dist/commands/flow/outputs.js +55 -0
- package/dist/commands/flow/outputs.js.map +1 -0
- package/dist/commands/flow/run.d.ts +19 -0
- package/dist/commands/flow/run.d.ts.map +1 -0
- package/dist/commands/flow/run.js +100 -0
- package/dist/commands/flow/run.js.map +1 -0
- package/dist/commands/flow/status.d.ts +16 -0
- package/dist/commands/flow/status.d.ts.map +1 -0
- package/dist/commands/flow/status.js +52 -0
- package/dist/commands/flow/status.js.map +1 -0
- package/dist/commands/flow/subflow.d.ts +19 -0
- package/dist/commands/flow/subflow.d.ts.map +1 -0
- package/dist/commands/flow/subflow.js +94 -0
- package/dist/commands/flow/subflow.js.map +1 -0
- package/dist/commands/flow/test.d.ts +18 -0
- package/dist/commands/flow/test.d.ts.map +1 -0
- package/dist/commands/flow/test.js +91 -0
- package/dist/commands/flow/test.js.map +1 -0
- package/dist/commands/health/check.d.ts +20 -0
- package/dist/commands/health/check.d.ts.map +1 -0
- package/dist/commands/health/check.js +105 -0
- package/dist/commands/health/check.js.map +1 -0
- package/dist/commands/log/index.d.ts +2 -26
- package/dist/commands/log/index.d.ts.map +1 -1
- package/dist/commands/log/index.js +23 -251
- package/dist/commands/log/index.js.map +1 -1
- package/dist/commands/query/app.d.ts +17 -0
- package/dist/commands/query/app.d.ts.map +1 -0
- package/dist/commands/query/app.js +81 -0
- package/dist/commands/query/app.js.map +1 -0
- package/dist/commands/query/columns.d.ts +16 -0
- package/dist/commands/query/columns.d.ts.map +1 -0
- package/dist/commands/query/columns.js +76 -0
- package/dist/commands/query/columns.js.map +1 -0
- package/dist/commands/query/index.d.ts +19 -0
- package/dist/commands/query/index.d.ts.map +1 -0
- package/dist/commands/query/index.js +94 -0
- package/dist/commands/query/index.js.map +1 -0
- package/dist/commands/query/syslog.d.ts +16 -0
- package/dist/commands/query/syslog.d.ts.map +1 -0
- package/dist/commands/query/syslog.js +67 -0
- package/dist/commands/query/syslog.js.map +1 -0
- package/dist/commands/schema/field.d.ts +16 -0
- package/dist/commands/schema/field.d.ts.map +1 -0
- package/dist/commands/schema/field.js +62 -0
- package/dist/commands/schema/field.js.map +1 -0
- package/dist/commands/schema/index.d.ts +19 -0
- package/dist/commands/schema/index.d.ts.map +1 -0
- package/dist/commands/schema/index.js +90 -0
- package/dist/commands/schema/index.js.map +1 -0
- package/dist/commands/schema/validate-catalog.d.ts +15 -0
- package/dist/commands/schema/validate-catalog.d.ts.map +1 -0
- package/dist/commands/schema/validate-catalog.js +58 -0
- package/dist/commands/schema/validate-catalog.js.map +1 -0
- package/dist/commands/scope/index.d.ts +14 -0
- package/dist/commands/scope/index.d.ts.map +1 -0
- package/dist/commands/scope/index.js +58 -0
- package/dist/commands/scope/index.js.map +1 -0
- package/dist/commands/scope/set.d.ts +14 -0
- package/dist/commands/scope/set.d.ts.map +1 -0
- package/dist/commands/scope/set.js +44 -0
- package/dist/commands/scope/set.js.map +1 -0
- package/dist/commands/script-sync/pull.d.ts +16 -0
- package/dist/commands/script-sync/pull.d.ts.map +1 -0
- package/dist/commands/script-sync/pull.js +74 -0
- package/dist/commands/script-sync/pull.js.map +1 -0
- package/dist/commands/script-sync/push.d.ts +16 -0
- package/dist/commands/script-sync/push.d.ts.map +1 -0
- package/dist/commands/script-sync/push.js +73 -0
- package/dist/commands/script-sync/push.js.map +1 -0
- package/dist/commands/script-sync/sync.d.ts +15 -0
- package/dist/commands/script-sync/sync.d.ts.map +1 -0
- package/dist/commands/script-sync/sync.js +71 -0
- package/dist/commands/script-sync/sync.js.map +1 -0
- package/dist/commands/search/add-table.d.ts +16 -0
- package/dist/commands/search/add-table.d.ts.map +1 -0
- package/dist/commands/search/add-table.js +68 -0
- package/dist/commands/search/add-table.js.map +1 -0
- package/dist/commands/search/groups.d.ts +12 -0
- package/dist/commands/search/groups.d.ts.map +1 -0
- package/dist/commands/search/groups.js +42 -0
- package/dist/commands/search/groups.js.map +1 -0
- package/dist/commands/search/index.d.ts +18 -0
- package/dist/commands/search/index.d.ts.map +1 -0
- package/dist/commands/search/index.js +103 -0
- package/dist/commands/search/index.js.map +1 -0
- package/dist/commands/search/tables.d.ts +14 -0
- package/dist/commands/search/tables.d.ts.map +1 -0
- package/dist/commands/search/tables.js +50 -0
- package/dist/commands/search/tables.js.map +1 -0
- package/dist/commands/store/install.d.ts +19 -0
- package/dist/commands/store/install.d.ts.map +1 -0
- package/dist/commands/store/install.js +90 -0
- package/dist/commands/store/install.js.map +1 -0
- package/dist/commands/store/search.d.ts +16 -0
- package/dist/commands/store/search.d.ts.map +1 -0
- package/dist/commands/store/search.js +67 -0
- package/dist/commands/store/search.js.map +1 -0
- package/dist/commands/store/update.d.ts +18 -0
- package/dist/commands/store/update.d.ts.map +1 -0
- package/dist/commands/store/update.js +83 -0
- package/dist/commands/store/update.js.map +1 -0
- package/dist/commands/store/validate.d.ts +14 -0
- package/dist/commands/store/validate.d.ts.map +1 -0
- package/dist/commands/store/validate.js +43 -0
- package/dist/commands/store/validate.js.map +1 -0
- package/dist/commands/task/approve.d.ts +15 -0
- package/dist/commands/task/approve.d.ts.map +1 -0
- package/dist/commands/task/approve.js +66 -0
- package/dist/commands/task/approve.js.map +1 -0
- package/dist/commands/task/assign.d.ts +17 -0
- package/dist/commands/task/assign.d.ts.map +1 -0
- package/dist/commands/task/assign.js +86 -0
- package/dist/commands/task/assign.js.map +1 -0
- package/dist/commands/task/close.d.ts +16 -0
- package/dist/commands/task/close.d.ts.map +1 -0
- package/dist/commands/task/close.js +71 -0
- package/dist/commands/task/close.js.map +1 -0
- package/dist/commands/task/comment.d.ts +17 -0
- package/dist/commands/task/comment.d.ts.map +1 -0
- package/dist/commands/task/comment.js +86 -0
- package/dist/commands/task/comment.js.map +1 -0
- package/dist/commands/task/find.d.ts +15 -0
- package/dist/commands/task/find.d.ts.map +1 -0
- package/dist/commands/task/find.js +65 -0
- package/dist/commands/task/find.js.map +1 -0
- package/dist/commands/task/resolve.d.ts +16 -0
- package/dist/commands/task/resolve.d.ts.map +1 -0
- package/dist/commands/task/resolve.js +71 -0
- package/dist/commands/task/resolve.js.map +1 -0
- package/dist/commands/update-set/clone.d.ts +15 -0
- package/dist/commands/update-set/clone.d.ts.map +1 -0
- package/dist/commands/update-set/clone.js +50 -0
- package/dist/commands/update-set/clone.js.map +1 -0
- package/dist/commands/update-set/create.d.ts +16 -0
- package/dist/commands/update-set/create.d.ts.map +1 -0
- package/dist/commands/update-set/create.js +60 -0
- package/dist/commands/update-set/create.js.map +1 -0
- package/dist/commands/update-set/current.d.ts +14 -0
- package/dist/commands/update-set/current.d.ts.map +1 -0
- package/dist/commands/update-set/current.js +55 -0
- package/dist/commands/update-set/current.js.map +1 -0
- package/dist/commands/update-set/index.d.ts +15 -0
- package/dist/commands/update-set/index.d.ts.map +1 -0
- package/dist/commands/update-set/index.js +56 -0
- package/dist/commands/update-set/index.js.map +1 -0
- package/dist/commands/update-set/inspect.d.ts +14 -0
- package/dist/commands/update-set/inspect.d.ts.map +1 -0
- package/dist/commands/update-set/inspect.js +43 -0
- package/dist/commands/update-set/inspect.js.map +1 -0
- package/dist/commands/update-set/move.d.ts +16 -0
- package/dist/commands/update-set/move.d.ts.map +1 -0
- package/dist/commands/update-set/move.js +57 -0
- package/dist/commands/update-set/move.js.map +1 -0
- package/dist/commands/workflow/create.d.ts +14 -0
- package/dist/commands/workflow/create.d.ts.map +1 -0
- package/dist/commands/workflow/create.js +50 -0
- package/dist/commands/workflow/create.js.map +1 -0
- package/dist/commands/workflow/publish.d.ts +15 -0
- package/dist/commands/workflow/publish.d.ts.map +1 -0
- package/dist/commands/workflow/publish.js +53 -0
- package/dist/commands/workflow/publish.js.map +1 -0
- package/dist/commands/xml/export.d.ts +17 -0
- package/dist/commands/xml/export.d.ts.map +1 -0
- package/dist/commands/xml/export.js +87 -0
- package/dist/commands/xml/export.js.map +1 -0
- package/dist/commands/xml/import.d.ts +16 -0
- package/dist/commands/xml/import.d.ts.map +1 -0
- package/dist/commands/xml/import.js +69 -0
- package/dist/commands/xml/import.js.map +1 -0
- package/dist/common/authenticated-command.d.ts +5 -2
- package/dist/common/authenticated-command.d.ts.map +1 -1
- package/dist/common/authenticated-command.js +12 -3
- package/dist/common/authenticated-command.js.map +1 -1
- package/dist/common/base-command.d.ts +2 -2
- package/dist/common/base-command.d.ts.map +1 -1
- package/dist/common/base-command.js +0 -1
- package/dist/common/base-command.js.map +1 -1
- package/dist/common/scope-autocomplete.js +0 -1
- package/dist/common/scope-autocomplete.js.map +1 -1
- package/dist/services/aggregate-display.service.d.ts +18 -0
- package/dist/services/aggregate-display.service.d.ts.map +1 -0
- package/dist/services/aggregate-display.service.js +83 -0
- package/dist/services/aggregate-display.service.js.map +1 -0
- package/dist/services/app-display.service.d.ts +36 -0
- package/dist/services/app-display.service.d.ts.map +1 -0
- package/dist/services/app-display.service.js +101 -0
- package/dist/services/app-display.service.js.map +1 -0
- package/dist/services/atf-result-formatter.service.d.ts +64 -0
- package/dist/services/atf-result-formatter.service.d.ts.map +1 -0
- package/dist/services/atf-result-formatter.service.js +83 -0
- package/dist/services/atf-result-formatter.service.js.map +1 -0
- package/dist/services/attachment-display.service.d.ts +18 -0
- package/dist/services/attachment-display.service.d.ts.map +1 -0
- package/dist/services/attachment-display.service.js +93 -0
- package/dist/services/attachment-display.service.js.map +1 -0
- package/dist/services/batch-display.service.d.ts +11 -0
- package/dist/services/batch-display.service.d.ts.map +1 -0
- package/dist/services/batch-display.service.js +75 -0
- package/dist/services/batch-display.service.js.map +1 -0
- package/dist/services/bulk-display.service.d.ts +11 -0
- package/dist/services/bulk-display.service.d.ts.map +1 -0
- package/dist/services/bulk-display.service.js +85 -0
- package/dist/services/bulk-display.service.js.map +1 -0
- package/dist/services/code-search-display.service.d.ts +23 -0
- package/dist/services/code-search-display.service.d.ts.map +1 -0
- package/dist/services/code-search-display.service.js +130 -0
- package/dist/services/code-search-display.service.js.map +1 -0
- package/dist/services/flow-display.service.d.ts +19 -0
- package/dist/services/flow-display.service.d.ts.map +1 -0
- package/dist/services/flow-display.service.js +194 -0
- package/dist/services/flow-display.service.js.map +1 -0
- package/dist/services/health-display.service.d.ts +8 -0
- package/dist/services/health-display.service.d.ts.map +1 -0
- package/dist/services/health-display.service.js +91 -0
- package/dist/services/health-display.service.js.map +1 -0
- package/dist/services/log-filter.service.d.ts +31 -0
- package/dist/services/log-filter.service.d.ts.map +1 -0
- package/dist/services/log-filter.service.js +117 -0
- package/dist/services/log-filter.service.js.map +1 -0
- package/dist/services/log-formatter.service.d.ts +30 -0
- package/dist/services/log-formatter.service.d.ts.map +1 -0
- package/dist/services/log-formatter.service.js +122 -0
- package/dist/services/log-formatter.service.js.map +1 -0
- package/dist/services/query-display.service.d.ts +23 -0
- package/dist/services/query-display.service.d.ts.map +1 -0
- package/dist/services/query-display.service.js +152 -0
- package/dist/services/query-display.service.js.map +1 -0
- package/dist/services/schema-display.service.d.ts +18 -0
- package/dist/services/schema-display.service.d.ts.map +1 -0
- package/dist/services/schema-display.service.js +106 -0
- package/dist/services/schema-display.service.js.map +1 -0
- package/dist/services/scope-display.service.d.ts +18 -0
- package/dist/services/scope-display.service.d.ts.map +1 -0
- package/dist/services/scope-display.service.js +83 -0
- package/dist/services/scope-display.service.js.map +1 -0
- package/dist/services/script-parameter.service.d.ts +16 -0
- package/dist/services/script-parameter.service.d.ts.map +1 -0
- package/dist/services/script-parameter.service.js +34 -0
- package/dist/services/script-parameter.service.js.map +1 -0
- package/dist/services/script-sync-display.service.d.ts +13 -0
- package/dist/services/script-sync-display.service.d.ts.map +1 -0
- package/dist/services/script-sync-display.service.js +71 -0
- package/dist/services/script-sync-display.service.js.map +1 -0
- package/dist/services/store-app-display.service.d.ts +16 -0
- package/dist/services/store-app-display.service.d.ts.map +1 -0
- package/dist/services/store-app-display.service.js +114 -0
- package/dist/services/store-app-display.service.js.map +1 -0
- package/dist/services/task-display.service.d.ts +14 -0
- package/dist/services/task-display.service.d.ts.map +1 -0
- package/dist/services/task-display.service.js +86 -0
- package/dist/services/task-display.service.js.map +1 -0
- package/dist/services/update-set-display.service.d.ts +28 -0
- package/dist/services/update-set-display.service.d.ts.map +1 -0
- package/dist/services/update-set-display.service.js +150 -0
- package/dist/services/update-set-display.service.js.map +1 -0
- package/dist/services/workflow-display.service.d.ts +13 -0
- package/dist/services/workflow-display.service.d.ts.map +1 -0
- package/dist/services/workflow-display.service.js +53 -0
- package/dist/services/workflow-display.service.js.map +1 -0
- package/dist/services/xml-display.service.d.ts +11 -0
- package/dist/services/xml-display.service.d.ts.map +1 -0
- package/dist/services/xml-display.service.js +55 -0
- package/dist/services/xml-display.service.js.map +1 -0
- package/dist/util/log-factory.d.ts +5 -0
- package/dist/util/log-factory.d.ts.map +1 -0
- package/dist/util/log-factory.js +8 -0
- package/dist/util/log-factory.js.map +1 -0
- package/oclif.manifest.json +5608 -387
- package/package.json +83 -23
package/README.md
CHANGED
|
@@ -34,10 +34,46 @@ Execute individual ATF tests or entire test suites with detailed results, perfec
|
|
|
34
34
|
- **Parameterization**: Template scripts with `{placeholder}` replacement
|
|
35
35
|
- **Scope-Aware**: Execute in global or custom application scopes
|
|
36
36
|
|
|
37
|
+
#### 🔍 Query & Search
|
|
38
|
+
- **Table Queries**: Query any ServiceNow table with encoded queries, field selection, and display values
|
|
39
|
+
- **Application Search**: Find applications by name across your instance
|
|
40
|
+
- **Column Discovery**: List and search table columns/fields
|
|
41
|
+
- **Syslog Reader**: Query system logs with filtering
|
|
42
|
+
- **Code Search**: Search scripts across the platform
|
|
43
|
+
|
|
44
|
+
#### 📊 Aggregate & Analytics
|
|
45
|
+
- **Record Counts**: Count records with optional filters
|
|
46
|
+
- **Aggregate Statistics**: Run AVG, MIN, MAX, SUM across table fields
|
|
47
|
+
- **Grouped Aggregation**: Group-by queries with multiple fields and HAVING clauses
|
|
48
|
+
|
|
49
|
+
#### 🏥 Instance Health & Diagnostics
|
|
50
|
+
- **Health Check**: Consolidated instance diagnostics — version info, cluster status, stuck jobs, semaphore counts, operational record counts
|
|
51
|
+
- **Color-coded** status indicators for quick visual assessment
|
|
52
|
+
- **JSON output** for CI/CD monitoring and alerting
|
|
53
|
+
|
|
54
|
+
#### 🔀 Flow Designer Operations
|
|
55
|
+
- **Execute Flows**: Run flows, subflows, and actions in foreground or background mode
|
|
56
|
+
- **Monitor Status**: Check flow context status, retrieve outputs, and inspect errors
|
|
57
|
+
- **Flow Control**: Cancel running flows and send messages to waiting flows
|
|
58
|
+
- **JSON inputs/outputs**: Pass structured inputs and capture flow outputs programmatically
|
|
59
|
+
|
|
60
|
+
#### 🗑️ Bulk Record Operations
|
|
61
|
+
- **Bulk Update**: Update all records matching an encoded query with dry-run safety
|
|
62
|
+
- **Bulk Delete**: Delete records matching a query with confirmation and limits
|
|
63
|
+
- **Dry-run by default**: Preview affected records before committing changes
|
|
64
|
+
- **Progress callbacks**: Real-time progress updates during bulk operations
|
|
65
|
+
|
|
37
66
|
#### 🎨 Advanced Features
|
|
38
67
|
- **Dynamic Autocomplete**: Tab completion that queries your ServiceNow instance for scopes
|
|
39
|
-
- **Batch Operations**: Install multiple applications from JSON definitions
|
|
68
|
+
- **Batch Operations**: Install multiple applications from JSON definitions or batch create/update records
|
|
40
69
|
- **Progress Monitoring**: Real-time progress for long-running operations
|
|
70
|
+
- **Schema Discovery**: Inspect table schemas and field definitions
|
|
71
|
+
- **Script Sync**: Pull and push scripts between local files and ServiceNow
|
|
72
|
+
- **Task Management**: Comment, assign, resolve, and close incidents and changes
|
|
73
|
+
- **Update Sets**: Create, inspect, clone, and manage update sets
|
|
74
|
+
- **Workflow Creation**: Create workflows with activities, transitions, and conditions
|
|
75
|
+
- **Scope Management**: Switch application scopes programmatically
|
|
76
|
+
- **Store Integration**: Search, install, and update apps from the ServiceNow Store
|
|
41
77
|
- **JSON Output**: Perfect for parsing and automation
|
|
42
78
|
|
|
43
79
|
#### 🔄 CI/CD Integration
|
|
@@ -56,6 +92,11 @@ Execute individual ATF tests or entire test suites with detailed results, perfec
|
|
|
56
92
|
- [Application Management](#application-management)
|
|
57
93
|
- [Script Execution with REPL](#script-execution-with-repl)
|
|
58
94
|
- [Company Repository](#company-repository-integration)
|
|
95
|
+
- [Query & Search](#query--search)
|
|
96
|
+
- [Aggregate & Analytics](#aggregate--analytics)
|
|
97
|
+
- [Instance Health Check](#instance-health-check)
|
|
98
|
+
- [Flow Designer](#flow-designer-operations)
|
|
99
|
+
- [Bulk Operations](#bulk-record-operations)
|
|
59
100
|
- [All Commands](#-commands)
|
|
60
101
|
- [Authentication](#-authentication)
|
|
61
102
|
- [Advanced Features](#-advanced-features)
|
|
@@ -68,6 +109,32 @@ Execute individual ATF tests or entire test suites with detailed results, perfec
|
|
|
68
109
|
- [Documentation](#-documentation)
|
|
69
110
|
- [Support & Contributing](#-support--contributing)
|
|
70
111
|
|
|
112
|
+
## ⚠️ Breaking Change — v2.0.0 (ServiceNow SDK 4.3.0)
|
|
113
|
+
|
|
114
|
+
> **If you are upgrading from v1.x, read this first.**
|
|
115
|
+
>
|
|
116
|
+
> This version upgrades the underlying ServiceNow SDK dependencies from **4.2.x to 4.3.0** and the core library to **@sonisoft/now-sdk-ext-core 3.4.0**. ServiceNow 4.3.0 **changed how credential aliases are stored**, replacing the previous `keytar`-based credential store with a new implementation.
|
|
117
|
+
>
|
|
118
|
+
> **What this means for you:**
|
|
119
|
+
> - Credential aliases created with ServiceNow SDK 4.2.x **cannot be read** by SDK 4.3.x
|
|
120
|
+
> - You **must re-create all instance aliases** after upgrading
|
|
121
|
+
>
|
|
122
|
+
> **Migration steps:**
|
|
123
|
+
> ```bash
|
|
124
|
+
> # 1. Update the global CLI
|
|
125
|
+
> npm install -g @servicenow/sdk@4.3.0
|
|
126
|
+
>
|
|
127
|
+
> # 2. Re-add each instance alias
|
|
128
|
+
> snc configure profile set
|
|
129
|
+
> # — or —
|
|
130
|
+
> npx @servicenow/sdk auth --add <your-alias>
|
|
131
|
+
>
|
|
132
|
+
> # 3. Verify your aliases work
|
|
133
|
+
> npx @servicenow/sdk auth --list
|
|
134
|
+
> ```
|
|
135
|
+
>
|
|
136
|
+
> All CLI commands and API surfaces remain unchanged — only the underlying authentication storage has changed.
|
|
137
|
+
|
|
71
138
|
## 💾 Installation
|
|
72
139
|
|
|
73
140
|
### Global Installation (Recommended)
|
|
@@ -114,7 +181,7 @@ now-sdk --version
|
|
|
114
181
|
### Node.js
|
|
115
182
|
|
|
116
183
|
- **Minimum Version**: Node.js 18.0.0 or higher
|
|
117
|
-
- **Recommended**: Node.js
|
|
184
|
+
- **Recommended**: Node.js 22.x (LTS) or later
|
|
118
185
|
|
|
119
186
|
### ServiceNow Instance
|
|
120
187
|
|
|
@@ -294,6 +361,138 @@ nex app:repo-install --scope x_custom_app --no-wait --auth prod
|
|
|
294
361
|
- Wait for completion or run async
|
|
295
362
|
- Post-installation verification
|
|
296
363
|
|
|
364
|
+
### Query & Search
|
|
365
|
+
|
|
366
|
+
Query ServiceNow tables, applications, columns, and system logs directly from the CLI.
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# Query any table with encoded queries
|
|
370
|
+
nex query --table incident --query "active=true^priority=1" --fields number,short_description --limit 10 --auth dev
|
|
371
|
+
|
|
372
|
+
# Search applications by name
|
|
373
|
+
nex query app --name "ITSM" --auth dev
|
|
374
|
+
|
|
375
|
+
# List columns for a table
|
|
376
|
+
nex query columns --table incident --search "description" --auth dev
|
|
377
|
+
|
|
378
|
+
# Query system logs
|
|
379
|
+
nex query syslog --query "level=error" --limit 50 --auth dev
|
|
380
|
+
|
|
381
|
+
# Search platform code
|
|
382
|
+
nex search code --term "GlideRecord" --auth dev
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Aggregate & Analytics
|
|
386
|
+
|
|
387
|
+
Run aggregate statistics on ServiceNow tables without downloading individual records.
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
# Count records
|
|
391
|
+
nex aggregate count --table incident --query "active=true" --auth dev
|
|
392
|
+
|
|
393
|
+
# Run aggregate statistics (AVG, MIN, MAX, SUM)
|
|
394
|
+
nex aggregate query --table incident --avg reassignment_count --min reassignment_count --max reassignment_count --auth dev
|
|
395
|
+
|
|
396
|
+
# Grouped aggregation with display values
|
|
397
|
+
nex aggregate group --table incident --group-by priority --count --auth dev --display-value all
|
|
398
|
+
|
|
399
|
+
# Multiple group-by fields with HAVING clause
|
|
400
|
+
nex aggregate group --table incident --group-by priority --group-by state --count --having "COUNT>5" --auth dev
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Instance Health Check
|
|
404
|
+
|
|
405
|
+
Run consolidated health diagnostics on your ServiceNow instance.
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Full health check
|
|
409
|
+
nex health check --auth dev
|
|
410
|
+
|
|
411
|
+
# Check only version and stuck jobs
|
|
412
|
+
nex health check --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev
|
|
413
|
+
|
|
414
|
+
# Health check with custom stuck job threshold (60 minutes)
|
|
415
|
+
nex health check --stuck-job-threshold 60 --auth dev
|
|
416
|
+
|
|
417
|
+
# JSON output for monitoring/alerting
|
|
418
|
+
nex health check --json --auth dev
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**Includes:**
|
|
422
|
+
- Instance version and build information
|
|
423
|
+
- Cluster node status (online/offline)
|
|
424
|
+
- Stuck job detection with configurable threshold
|
|
425
|
+
- Active semaphore count
|
|
426
|
+
- Operational counts (open incidents, changes, problems)
|
|
427
|
+
- Color-coded status indicators
|
|
428
|
+
|
|
429
|
+
### Flow Designer Operations
|
|
430
|
+
|
|
431
|
+
Execute and manage Flow Designer flows, subflows, and actions from the CLI.
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# Execute a flow in foreground (waits for completion)
|
|
435
|
+
nex flow run --name global.my_flow --auth dev
|
|
436
|
+
|
|
437
|
+
# Execute with inputs
|
|
438
|
+
nex flow run --name global.my_flow --inputs '{"priority":"1","category":"network"}' --auth dev
|
|
439
|
+
|
|
440
|
+
# Execute a subflow
|
|
441
|
+
nex flow subflow --name global.my_subflow --inputs '{"record_id":"abc123"}' --auth dev
|
|
442
|
+
|
|
443
|
+
# Execute an action
|
|
444
|
+
nex flow action --name global.my_action --inputs '{"table":"incident"}' --auth dev
|
|
445
|
+
|
|
446
|
+
# Check flow status
|
|
447
|
+
nex flow status --context-id ctx-abc123 --auth dev
|
|
448
|
+
|
|
449
|
+
# Retrieve flow outputs
|
|
450
|
+
nex flow outputs --context-id ctx-abc123 --json --auth dev
|
|
451
|
+
|
|
452
|
+
# Check for errors
|
|
453
|
+
nex flow error --context-id ctx-abc123 --auth dev
|
|
454
|
+
|
|
455
|
+
# Cancel a running flow
|
|
456
|
+
nex flow cancel --context-id ctx-abc123 --reason "No longer needed" --auth dev
|
|
457
|
+
|
|
458
|
+
# Send a message to a waiting flow (e.g., approval)
|
|
459
|
+
nex flow message --context-id ctx-abc123 --message approved --payload '{"approver":"admin"}' --auth dev
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**Features:**
|
|
463
|
+
- Execute flows, subflows, and actions with structured inputs
|
|
464
|
+
- Foreground (wait) or background execution modes
|
|
465
|
+
- Query flow context status, outputs, and errors
|
|
466
|
+
- Cancel running flows and send messages to paused flows
|
|
467
|
+
- JSON output for automation and CI/CD
|
|
468
|
+
|
|
469
|
+
### Bulk Record Operations
|
|
470
|
+
|
|
471
|
+
Perform bulk updates and deletes on ServiceNow records matching a query.
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Dry-run: preview which records would be updated (safe default)
|
|
475
|
+
nex bulk update --table incident --query "active=true^priority=4" --data '{"priority":"3"}' --auth dev
|
|
476
|
+
|
|
477
|
+
# Confirm bulk update (actually modifies records)
|
|
478
|
+
nex bulk update --table incident --query "active=true^priority=4" --data '{"priority":"3"}' --confirm --auth dev
|
|
479
|
+
|
|
480
|
+
# Dry-run: preview which records would be deleted
|
|
481
|
+
nex bulk delete --table u_temp_records --query "sys_created_on<2024-01-01" --auth dev
|
|
482
|
+
|
|
483
|
+
# Confirm bulk delete with limit
|
|
484
|
+
nex bulk delete --table u_temp_records --query "sys_created_on<2024-01-01" --confirm --limit 500 --auth dev
|
|
485
|
+
|
|
486
|
+
# JSON output for scripting
|
|
487
|
+
nex bulk update --table incident --query "state=7" --data '{"active":"false"}' --confirm --json --auth dev
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
**Safety Features:**
|
|
491
|
+
- **Dry-run by default**: Always previews affected records before modifying
|
|
492
|
+
- **Explicit confirmation**: Must pass `--confirm` to execute changes
|
|
493
|
+
- **Record limits**: Cap the number of affected records with `--limit`
|
|
494
|
+
- **Progress updates**: Real-time feedback during bulk operations
|
|
495
|
+
|
|
297
496
|
## 📖 Commands
|
|
298
497
|
|
|
299
498
|
<!-- toc -->
|
|
@@ -320,6 +519,33 @@ nex app:repo-install --scope x_custom_app --no-wait --auth prod
|
|
|
320
519
|
* [Install by scope (automatic lookup)](#install-by-scope-automatic-lookup)
|
|
321
520
|
* [Install specific version](#install-specific-version)
|
|
322
521
|
* [Background installation](#background-installation)
|
|
522
|
+
* [Query any table with encoded queries](#query-any-table-with-encoded-queries)
|
|
523
|
+
* [Search applications by name](#search-applications-by-name)
|
|
524
|
+
* [List columns for a table](#list-columns-for-a-table)
|
|
525
|
+
* [Query system logs](#query-system-logs)
|
|
526
|
+
* [Search platform code](#search-platform-code)
|
|
527
|
+
* [Count records](#count-records)
|
|
528
|
+
* [Run aggregate statistics (AVG, MIN, MAX, SUM)](#run-aggregate-statistics-avg-min-max-sum)
|
|
529
|
+
* [Grouped aggregation with display values](#grouped-aggregation-with-display-values)
|
|
530
|
+
* [Multiple group-by fields with HAVING clause](#multiple-group-by-fields-with-having-clause)
|
|
531
|
+
* [Full health check](#full-health-check)
|
|
532
|
+
* [Check only version and stuck jobs](#check-only-version-and-stuck-jobs)
|
|
533
|
+
* [Health check with custom stuck job threshold (60 minutes)](#health-check-with-custom-stuck-job-threshold-60-minutes)
|
|
534
|
+
* [JSON output for monitoring/alerting](#json-output-for-monitoringalerting)
|
|
535
|
+
* [Execute a flow in foreground (waits for completion)](#execute-a-flow-in-foreground-waits-for-completion)
|
|
536
|
+
* [Execute with inputs](#execute-with-inputs)
|
|
537
|
+
* [Execute a subflow](#execute-a-subflow)
|
|
538
|
+
* [Execute an action](#execute-an-action)
|
|
539
|
+
* [Check flow status](#check-flow-status)
|
|
540
|
+
* [Retrieve flow outputs](#retrieve-flow-outputs)
|
|
541
|
+
* [Check for errors](#check-for-errors)
|
|
542
|
+
* [Cancel a running flow](#cancel-a-running-flow)
|
|
543
|
+
* [Send a message to a waiting flow (e.g., approval)](#send-a-message-to-a-waiting-flow-eg-approval)
|
|
544
|
+
* [Dry-run: preview which records would be updated (safe default)](#dry-run-preview-which-records-would-be-updated-safe-default)
|
|
545
|
+
* [Confirm bulk update (actually modifies records)](#confirm-bulk-update-actually-modifies-records)
|
|
546
|
+
* [Dry-run: preview which records would be deleted](#dry-run-preview-which-records-would-be-deleted)
|
|
547
|
+
* [Confirm bulk delete with limit](#confirm-bulk-delete-with-limit)
|
|
548
|
+
* [JSON output for scripting](#json-output-for-scripting)
|
|
323
549
|
* [Usage](#usage)
|
|
324
550
|
* [Commands](#commands)
|
|
325
551
|
* [Global scope](#global-scope)
|
|
@@ -398,7 +624,7 @@ nex app:repo-install --scope x_custom_app --no-wait --auth prod
|
|
|
398
624
|
* [Clone the repository](#clone-the-repository)
|
|
399
625
|
* [Install dependencies](#install-dependencies)
|
|
400
626
|
* [Build](#build)
|
|
401
|
-
* [Run tests (
|
|
627
|
+
* [Run tests (960+ tests)](#run-tests-960-tests)
|
|
402
628
|
* [Run linter](#run-linter)
|
|
403
629
|
* [Test locally](#test-locally)
|
|
404
630
|
* [All tests](#all-tests)
|
|
@@ -413,7 +639,7 @@ $ npm install -g @sonisoft/now-sdk-ext-cli
|
|
|
413
639
|
$ nex COMMAND
|
|
414
640
|
running command...
|
|
415
641
|
$ nex (--version)
|
|
416
|
-
@sonisoft/now-sdk-ext-cli/2.
|
|
642
|
+
@sonisoft/now-sdk-ext-cli/2.1.0 linux-x64 node-v22.22.0
|
|
417
643
|
$ nex --help [COMMAND]
|
|
418
644
|
USAGE
|
|
419
645
|
$ nex COMMAND
|
|
@@ -423,14 +649,34 @@ USAGE
|
|
|
423
649
|
|
|
424
650
|
# Commands
|
|
425
651
|
<!-- commands -->
|
|
652
|
+
* [`nex aggregate count`](#nex-aggregate-count)
|
|
653
|
+
* [`nex aggregate group`](#nex-aggregate-group)
|
|
654
|
+
* [`nex aggregate query`](#nex-aggregate-query)
|
|
426
655
|
* [`nex app`](#nex-app)
|
|
427
656
|
* [`nex app install`](#nex-app-install)
|
|
428
657
|
* [`nex app repo-install`](#nex-app-repo-install)
|
|
429
658
|
* [`nex app repo-list`](#nex-app-repo-list)
|
|
430
659
|
* [`nex app uninstall`](#nex-app-uninstall)
|
|
431
660
|
* [`nex atf`](#nex-atf)
|
|
661
|
+
* [`nex attachment get`](#nex-attachment-get)
|
|
662
|
+
* [`nex attachment list`](#nex-attachment-list)
|
|
663
|
+
* [`nex attachment upload`](#nex-attachment-upload)
|
|
432
664
|
* [`nex autocomplete [SHELL]`](#nex-autocomplete-shell)
|
|
665
|
+
* [`nex batch create`](#nex-batch-create)
|
|
666
|
+
* [`nex batch update`](#nex-batch-update)
|
|
667
|
+
* [`nex bulk delete`](#nex-bulk-delete)
|
|
668
|
+
* [`nex bulk update`](#nex-bulk-update)
|
|
433
669
|
* [`nex exec SCOPE [FILE]`](#nex-exec-scope-file)
|
|
670
|
+
* [`nex flow action`](#nex-flow-action)
|
|
671
|
+
* [`nex flow cancel`](#nex-flow-cancel)
|
|
672
|
+
* [`nex flow error`](#nex-flow-error)
|
|
673
|
+
* [`nex flow message`](#nex-flow-message)
|
|
674
|
+
* [`nex flow outputs`](#nex-flow-outputs)
|
|
675
|
+
* [`nex flow run`](#nex-flow-run)
|
|
676
|
+
* [`nex flow status`](#nex-flow-status)
|
|
677
|
+
* [`nex flow subflow`](#nex-flow-subflow)
|
|
678
|
+
* [`nex flow test`](#nex-flow-test)
|
|
679
|
+
* [`nex health check`](#nex-health-check)
|
|
434
680
|
* [`nex help [COMMAND]`](#nex-help-command)
|
|
435
681
|
* [`nex log`](#nex-log)
|
|
436
682
|
* [`nex plugins`](#nex-plugins)
|
|
@@ -443,6 +689,195 @@ USAGE
|
|
|
443
689
|
* [`nex plugins uninstall [PLUGIN]`](#nex-plugins-uninstall-plugin)
|
|
444
690
|
* [`nex plugins unlink [PLUGIN]`](#nex-plugins-unlink-plugin)
|
|
445
691
|
* [`nex plugins update`](#nex-plugins-update)
|
|
692
|
+
* [`nex query`](#nex-query)
|
|
693
|
+
* [`nex query app`](#nex-query-app)
|
|
694
|
+
* [`nex query columns`](#nex-query-columns)
|
|
695
|
+
* [`nex query syslog`](#nex-query-syslog)
|
|
696
|
+
* [`nex schema`](#nex-schema)
|
|
697
|
+
* [`nex schema field`](#nex-schema-field)
|
|
698
|
+
* [`nex schema validate-catalog`](#nex-schema-validate-catalog)
|
|
699
|
+
* [`nex scope`](#nex-scope)
|
|
700
|
+
* [`nex scope set`](#nex-scope-set)
|
|
701
|
+
* [`nex script-sync pull`](#nex-script-sync-pull)
|
|
702
|
+
* [`nex script-sync push`](#nex-script-sync-push)
|
|
703
|
+
* [`nex script-sync sync`](#nex-script-sync-sync)
|
|
704
|
+
* [`nex search`](#nex-search)
|
|
705
|
+
* [`nex search add-table`](#nex-search-add-table)
|
|
706
|
+
* [`nex search groups`](#nex-search-groups)
|
|
707
|
+
* [`nex search tables`](#nex-search-tables)
|
|
708
|
+
* [`nex store install`](#nex-store-install)
|
|
709
|
+
* [`nex store search`](#nex-store-search)
|
|
710
|
+
* [`nex store update`](#nex-store-update)
|
|
711
|
+
* [`nex store validate`](#nex-store-validate)
|
|
712
|
+
* [`nex task approve`](#nex-task-approve)
|
|
713
|
+
* [`nex task assign`](#nex-task-assign)
|
|
714
|
+
* [`nex task close`](#nex-task-close)
|
|
715
|
+
* [`nex task comment`](#nex-task-comment)
|
|
716
|
+
* [`nex task find`](#nex-task-find)
|
|
717
|
+
* [`nex task resolve`](#nex-task-resolve)
|
|
718
|
+
* [`nex update-set`](#nex-update-set)
|
|
719
|
+
* [`nex update-set clone`](#nex-update-set-clone)
|
|
720
|
+
* [`nex update-set create`](#nex-update-set-create)
|
|
721
|
+
* [`nex update-set current`](#nex-update-set-current)
|
|
722
|
+
* [`nex update-set inspect`](#nex-update-set-inspect)
|
|
723
|
+
* [`nex update-set move`](#nex-update-set-move)
|
|
724
|
+
* [`nex workflow create`](#nex-workflow-create)
|
|
725
|
+
* [`nex workflow publish`](#nex-workflow-publish)
|
|
726
|
+
* [`nex xml export`](#nex-xml-export)
|
|
727
|
+
* [`nex xml import`](#nex-xml-import)
|
|
728
|
+
|
|
729
|
+
## `nex aggregate count`
|
|
730
|
+
|
|
731
|
+
Count records in a ServiceNow table.
|
|
732
|
+
|
|
733
|
+
```
|
|
734
|
+
USAGE
|
|
735
|
+
$ nex aggregate count -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-q <value>]
|
|
736
|
+
|
|
737
|
+
FLAGS
|
|
738
|
+
-a, --auth=<value> Auth alias to use.
|
|
739
|
+
-j, --json Output results as JSON
|
|
740
|
+
-q, --query=<value> ServiceNow encoded query string to filter records
|
|
741
|
+
-t, --table=<value> (required) ServiceNow table name to count records in
|
|
742
|
+
|
|
743
|
+
GLOBAL FLAGS
|
|
744
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
745
|
+
<options: debug|warn|error|info|trace>
|
|
746
|
+
|
|
747
|
+
DESCRIPTION
|
|
748
|
+
Count records in a ServiceNow table.
|
|
749
|
+
|
|
750
|
+
Uses the Stats API to efficiently count records with optional encoded query filtering.
|
|
751
|
+
|
|
752
|
+
Features:
|
|
753
|
+
• Fast record counting via Stats API
|
|
754
|
+
• Optional encoded query filtering
|
|
755
|
+
• JSON output for scripting
|
|
756
|
+
|
|
757
|
+
EXAMPLES
|
|
758
|
+
Count all incidents
|
|
759
|
+
|
|
760
|
+
$ nex aggregate count --table incident --auth dev
|
|
761
|
+
|
|
762
|
+
Count active critical incidents
|
|
763
|
+
|
|
764
|
+
$ nex aggregate count --table incident --query "active=true^priority=1" --auth dev
|
|
765
|
+
|
|
766
|
+
Count as JSON
|
|
767
|
+
|
|
768
|
+
$ nex aggregate count --table incident --query "active=true" --json --auth dev
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
_See code: [src/commands/aggregate/count.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/aggregate/count.ts)_
|
|
772
|
+
|
|
773
|
+
## `nex aggregate group`
|
|
774
|
+
|
|
775
|
+
Run a grouped aggregate query on a ServiceNow table.
|
|
776
|
+
|
|
777
|
+
```
|
|
778
|
+
USAGE
|
|
779
|
+
$ nex aggregate group -t <value> -g <value>... [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-q
|
|
780
|
+
<value>] [-c] [--avg <value>...] [--min <value>...] [--max <value>...] [--sum <value>...] [--having <value>] [-d]
|
|
781
|
+
|
|
782
|
+
FLAGS
|
|
783
|
+
-a, --auth=<value> Auth alias to use.
|
|
784
|
+
-c, --count Include record count per group
|
|
785
|
+
-d, --display-value Return display values for group-by fields
|
|
786
|
+
-g, --group-by=<value>... (required) Field name(s) to group by
|
|
787
|
+
-j, --json Output results as JSON
|
|
788
|
+
-q, --query=<value> ServiceNow encoded query string to filter records before grouping
|
|
789
|
+
-t, --table=<value> (required) ServiceNow table name to aggregate
|
|
790
|
+
--avg=<value>... Comma-separated field names to compute AVG on per group
|
|
791
|
+
--having=<value> HAVING clause to filter groups (e.g. "count>10")
|
|
792
|
+
--max=<value>... Comma-separated field names to compute MAX on per group
|
|
793
|
+
--min=<value>... Comma-separated field names to compute MIN on per group
|
|
794
|
+
--sum=<value>... Comma-separated field names to compute SUM on per group
|
|
795
|
+
|
|
796
|
+
GLOBAL FLAGS
|
|
797
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
798
|
+
<options: debug|warn|error|info|trace>
|
|
799
|
+
|
|
800
|
+
DESCRIPTION
|
|
801
|
+
Run a grouped aggregate query on a ServiceNow table.
|
|
802
|
+
|
|
803
|
+
Compute aggregate statistics (COUNT, AVG, MIN, MAX, SUM) grouped by one or more fields using the Stats API. Supports
|
|
804
|
+
HAVING clauses for filtering groups.
|
|
805
|
+
|
|
806
|
+
Features:
|
|
807
|
+
• GROUP BY one or more fields
|
|
808
|
+
• Compute AVG, MIN, MAX, SUM per group
|
|
809
|
+
• HAVING clause for group filtering
|
|
810
|
+
• Display values for reference fields
|
|
811
|
+
• JSON output for scripting
|
|
812
|
+
|
|
813
|
+
EXAMPLES
|
|
814
|
+
Count incidents grouped by priority
|
|
815
|
+
|
|
816
|
+
$ nex aggregate group --table incident --group-by priority --count --auth dev
|
|
817
|
+
|
|
818
|
+
Average reassignment count grouped by priority and assignment group
|
|
819
|
+
|
|
820
|
+
$ nex aggregate group --table incident --group-by priority --group-by assignment_group --avg reassignment_count \
|
|
821
|
+
--count --display-value --auth dev
|
|
822
|
+
|
|
823
|
+
Groups with HAVING clause
|
|
824
|
+
|
|
825
|
+
$ nex aggregate group --table incident --group-by priority --count --having "count>10" --auth dev
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
_See code: [src/commands/aggregate/group.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/aggregate/group.ts)_
|
|
829
|
+
|
|
830
|
+
## `nex aggregate query`
|
|
831
|
+
|
|
832
|
+
Run aggregate statistics on a ServiceNow table.
|
|
833
|
+
|
|
834
|
+
```
|
|
835
|
+
USAGE
|
|
836
|
+
$ nex aggregate query -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-q <value>] [-c]
|
|
837
|
+
[--avg <value>...] [--min <value>...] [--max <value>...] [--sum <value>...]
|
|
838
|
+
|
|
839
|
+
FLAGS
|
|
840
|
+
-a, --auth=<value> Auth alias to use.
|
|
841
|
+
-c, --count Include record count in the result
|
|
842
|
+
-j, --json Output results as JSON
|
|
843
|
+
-q, --query=<value> ServiceNow encoded query string to filter records
|
|
844
|
+
-t, --table=<value> (required) ServiceNow table name to aggregate
|
|
845
|
+
--avg=<value>... Comma-separated field names to compute AVG on
|
|
846
|
+
--max=<value>... Comma-separated field names to compute MAX on
|
|
847
|
+
--min=<value>... Comma-separated field names to compute MIN on
|
|
848
|
+
--sum=<value>... Comma-separated field names to compute SUM on
|
|
849
|
+
|
|
850
|
+
GLOBAL FLAGS
|
|
851
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
852
|
+
<options: debug|warn|error|info|trace>
|
|
853
|
+
|
|
854
|
+
DESCRIPTION
|
|
855
|
+
Run aggregate statistics on a ServiceNow table.
|
|
856
|
+
|
|
857
|
+
Compute AVG, MIN, MAX, and SUM on specified fields using the Stats API. Optionally include a record count.
|
|
858
|
+
|
|
859
|
+
Features:
|
|
860
|
+
• Compute AVG, MIN, MAX, SUM on any numeric field
|
|
861
|
+
• Optional record count
|
|
862
|
+
• Filter with encoded queries
|
|
863
|
+
• JSON output for scripting
|
|
864
|
+
|
|
865
|
+
EXAMPLES
|
|
866
|
+
Get average reassignment count for incidents
|
|
867
|
+
|
|
868
|
+
$ nex aggregate query --table incident --avg reassignment_count --auth dev
|
|
869
|
+
|
|
870
|
+
Get min, max, and average for active incidents
|
|
871
|
+
|
|
872
|
+
$ nex aggregate query --table incident --query "active=true" --avg reassignment_count --min reassignment_count \
|
|
873
|
+
--max reassignment_count --count --auth dev
|
|
874
|
+
|
|
875
|
+
Get sum as JSON
|
|
876
|
+
|
|
877
|
+
$ nex aggregate query --table incident --sum reassignment_count --json --auth dev
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
_See code: [src/commands/aggregate/query.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/aggregate/query.ts)_
|
|
446
881
|
|
|
447
882
|
## `nex app`
|
|
448
883
|
|
|
@@ -494,6 +929,8 @@ EXAMPLES
|
|
|
494
929
|
$ nex app -u -i a1b2c3d4e5f6 -s x_my_custom_app -a dev-instance
|
|
495
930
|
```
|
|
496
931
|
|
|
932
|
+
_See code: [src/commands/app/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/app/index.ts)_
|
|
933
|
+
|
|
497
934
|
## `nex app install`
|
|
498
935
|
|
|
499
936
|
Install or upgrade multiple ServiceNow applications from a batch definition file.
|
|
@@ -549,6 +986,8 @@ EXAMPLES
|
|
|
549
986
|
$ nex app install -b -d ./apps.json -a dev-instance --log-level debug
|
|
550
987
|
```
|
|
551
988
|
|
|
989
|
+
_See code: [src/commands/app/install.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/app/install.ts)_
|
|
990
|
+
|
|
552
991
|
## `nex app repo-install`
|
|
553
992
|
|
|
554
993
|
Install an application from your ServiceNow company repository.
|
|
@@ -621,6 +1060,8 @@ EXAMPLES
|
|
|
621
1060
|
$ nex app repo-install -s x_my_app -a dev-instance --log-level debug
|
|
622
1061
|
```
|
|
623
1062
|
|
|
1063
|
+
_See code: [src/commands/app/repo-install.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/app/repo-install.ts)_
|
|
1064
|
+
|
|
624
1065
|
## `nex app repo-list`
|
|
625
1066
|
|
|
626
1067
|
List applications available in your ServiceNow company repository.
|
|
@@ -683,6 +1124,8 @@ EXAMPLES
|
|
|
683
1124
|
$ nex app repo-list -a dev-instance
|
|
684
1125
|
```
|
|
685
1126
|
|
|
1127
|
+
_See code: [src/commands/app/repo-list.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/app/repo-list.ts)_
|
|
1128
|
+
|
|
686
1129
|
## `nex app uninstall`
|
|
687
1130
|
|
|
688
1131
|
Uninstall a ServiceNow application from your instance.
|
|
@@ -732,6 +1175,8 @@ EXAMPLES
|
|
|
732
1175
|
$ nex app uninstall -i a1b2c3d4e5f6 -s x_my_custom_app -a dev-instance
|
|
733
1176
|
```
|
|
734
1177
|
|
|
1178
|
+
_See code: [src/commands/app/uninstall.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/app/uninstall.ts)_
|
|
1179
|
+
|
|
735
1180
|
## `nex atf`
|
|
736
1181
|
|
|
737
1182
|
Execute ATF (Automated Test Framework) tests or test suites on a ServiceNow instance.
|
|
@@ -802,52 +1247,54 @@ EXAMPLES
|
|
|
802
1247
|
$ nex atf --suite-id e077e00b83103210621e78c6feaad383 --poll-interval 10000 --auth dev-instance
|
|
803
1248
|
```
|
|
804
1249
|
|
|
805
|
-
|
|
1250
|
+
_See code: [src/commands/atf/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/atf/index.ts)_
|
|
806
1251
|
|
|
807
|
-
|
|
1252
|
+
## `nex attachment get`
|
|
1253
|
+
|
|
1254
|
+
Get metadata for a specific attachment.
|
|
808
1255
|
|
|
809
1256
|
```
|
|
810
1257
|
USAGE
|
|
811
|
-
$ nex
|
|
812
|
-
|
|
813
|
-
ARGUMENTS
|
|
814
|
-
SHELL (zsh|bash|powershell) Shell type
|
|
1258
|
+
$ nex attachment get -s <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
815
1259
|
|
|
816
1260
|
FLAGS
|
|
817
|
-
-
|
|
1261
|
+
-a, --auth=<value> Auth alias to use.
|
|
1262
|
+
-s, --sys-id=<value> (required) Sys ID of the attachment
|
|
1263
|
+
|
|
1264
|
+
GLOBAL FLAGS
|
|
1265
|
+
--json Format output as json.
|
|
1266
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1267
|
+
<options: debug|warn|error|info|trace>
|
|
818
1268
|
|
|
819
1269
|
DESCRIPTION
|
|
820
|
-
|
|
1270
|
+
Get metadata for a specific attachment.
|
|
821
1271
|
|
|
822
1272
|
EXAMPLES
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
$ nex autocomplete bash
|
|
1273
|
+
Get attachment metadata by sys_id
|
|
826
1274
|
|
|
827
|
-
|
|
1275
|
+
$ nex attachment get --sys-id att123 --auth dev
|
|
828
1276
|
|
|
829
|
-
|
|
1277
|
+
Get attachment metadata as JSON
|
|
830
1278
|
|
|
831
|
-
|
|
1279
|
+
$ nex attachment get -s att123 --json --auth dev
|
|
832
1280
|
```
|
|
833
1281
|
|
|
834
|
-
_See code: [
|
|
1282
|
+
_See code: [src/commands/attachment/get.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/attachment/get.ts)_
|
|
835
1283
|
|
|
836
|
-
## `nex
|
|
1284
|
+
## `nex attachment list`
|
|
837
1285
|
|
|
838
|
-
|
|
1286
|
+
List attachments on a ServiceNow record.
|
|
839
1287
|
|
|
840
1288
|
```
|
|
841
1289
|
USAGE
|
|
842
|
-
$ nex
|
|
843
|
-
|
|
844
|
-
ARGUMENTS
|
|
845
|
-
SCOPE Scope to execute script in. Use "global" for global scope.
|
|
846
|
-
FILE File to execute in scripts background. If omitted, starts REPL mode.
|
|
1290
|
+
$ nex attachment list -r <value> -t <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1291
|
+
[--limit <value>]
|
|
847
1292
|
|
|
848
1293
|
FLAGS
|
|
849
|
-
-a, --auth=<value>
|
|
850
|
-
-
|
|
1294
|
+
-a, --auth=<value> Auth alias to use.
|
|
1295
|
+
-r, --record-id=<value> (required) Sys ID of the record
|
|
1296
|
+
-t, --table=<value> (required) Table name
|
|
1297
|
+
--limit=<value> [default: 20] Maximum number of attachments to return
|
|
851
1298
|
|
|
852
1299
|
GLOBAL FLAGS
|
|
853
1300
|
--json Format output as json.
|
|
@@ -855,139 +1302,1952 @@ GLOBAL FLAGS
|
|
|
855
1302
|
<options: debug|warn|error|info|trace>
|
|
856
1303
|
|
|
857
1304
|
DESCRIPTION
|
|
858
|
-
|
|
1305
|
+
List attachments on a ServiceNow record.
|
|
859
1306
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.
|
|
1307
|
+
EXAMPLES
|
|
1308
|
+
List attachments on an incident
|
|
863
1309
|
|
|
864
|
-
|
|
865
|
-
• File Mode: Provide a file path to execute scripts from a file
|
|
866
|
-
• REPL Mode: Omit the file path to start an interactive session
|
|
1310
|
+
$ nex attachment list --table incident --record-id abc123 --auth dev
|
|
867
1311
|
|
|
868
|
-
|
|
869
|
-
• Execute local JavaScript files remotely
|
|
870
|
-
• Interactive REPL for ad-hoc script execution
|
|
871
|
-
• Script parameterization with {placeholder} replacement
|
|
872
|
-
• Multi-line script support in REPL
|
|
873
|
-
• Scope-aware execution (global or custom scope)
|
|
874
|
-
• Real-time console output capture
|
|
875
|
-
• Pipe-able output for command chaining
|
|
876
|
-
• Debug logging support
|
|
877
|
-
• Useful for data migration, testing, and administrative tasks
|
|
1312
|
+
List up to 50 attachments as JSON
|
|
878
1313
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
• Supports any JSON-serializable values (strings, numbers, booleans)
|
|
882
|
-
• Multiple parameters supported
|
|
883
|
-
• All occurrences of each placeholder are replaced
|
|
884
|
-
• Example: {token}, {username}, {environment}
|
|
1314
|
+
$ nex attachment list -t incident -r abc123 --limit 50 --json --auth dev
|
|
1315
|
+
```
|
|
885
1316
|
|
|
886
|
-
|
|
887
|
-
• Press Enter to add a new line
|
|
888
|
-
• Type .exec or press Ctrl+D to execute the script
|
|
889
|
-
• Type .clear to clear the current input
|
|
890
|
-
• Type .exit or press Ctrl+C twice to exit REPL
|
|
1317
|
+
_See code: [src/commands/attachment/list.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/attachment/list.ts)_
|
|
891
1318
|
|
|
892
|
-
|
|
893
|
-
This command executes scripts with the same permissions and risks as using Scripts - Background directly
|
|
894
|
-
in ServiceNow. Always:
|
|
895
|
-
• Review scripts before execution
|
|
896
|
-
• Test in non-production environments first
|
|
897
|
-
• Use appropriate scoping to limit access
|
|
898
|
-
• Be aware of data modification risks
|
|
899
|
-
• Follow your organization's security policies
|
|
900
|
-
• Never execute untrusted scripts
|
|
1319
|
+
## `nex attachment upload`
|
|
901
1320
|
|
|
902
|
-
|
|
903
|
-
Scripts run with full GlideSystem API access and can:
|
|
904
|
-
• Query and modify database records
|
|
905
|
-
• Create, update, and delete data
|
|
906
|
-
• Execute business rules and workflows
|
|
907
|
-
• Access all APIs available in Scripts - Background
|
|
908
|
-
• Use gs, GlideRecord, GlideAggregate, and other server-side APIs
|
|
1321
|
+
Upload a file as an attachment to a ServiceNow record.
|
|
909
1322
|
|
|
910
|
-
|
|
911
|
-
|
|
1323
|
+
```
|
|
1324
|
+
USAGE
|
|
1325
|
+
$ nex attachment upload -f <value> -r <value> -t <value> [--json] [-a <value>] [--log-level
|
|
1326
|
+
debug|warn|error|info|trace] [--content-type <value>]
|
|
912
1327
|
|
|
913
|
-
|
|
1328
|
+
FLAGS
|
|
1329
|
+
-a, --auth=<value> Auth alias to use.
|
|
1330
|
+
-f, --file=<value> (required) Path to the file to upload
|
|
1331
|
+
-r, --record-id=<value> (required) Sys ID of the target record
|
|
1332
|
+
-t, --table=<value> (required) Target table name
|
|
1333
|
+
--content-type=<value> MIME content type of the file
|
|
914
1334
|
|
|
915
|
-
|
|
1335
|
+
GLOBAL FLAGS
|
|
1336
|
+
--json Format output as json.
|
|
1337
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1338
|
+
<options: debug|warn|error|info|trace>
|
|
916
1339
|
|
|
917
|
-
|
|
1340
|
+
DESCRIPTION
|
|
1341
|
+
Upload a file as an attachment to a ServiceNow record.
|
|
918
1342
|
|
|
919
|
-
|
|
1343
|
+
EXAMPLES
|
|
1344
|
+
Upload a PDF to an incident record
|
|
920
1345
|
|
|
921
|
-
$ nex
|
|
1346
|
+
$ nex attachment upload --table incident --record-id abc123 --file ./report.pdf --auth dev
|
|
922
1347
|
|
|
923
|
-
|
|
1348
|
+
Upload a CSV with explicit content type
|
|
924
1349
|
|
|
925
|
-
$ nex
|
|
1350
|
+
$ nex attachment upload -t incident -r abc123 -f ./data.csv --content-type text/csv --auth dev
|
|
1351
|
+
```
|
|
926
1352
|
|
|
927
|
-
|
|
1353
|
+
_See code: [src/commands/attachment/upload.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/attachment/upload.ts)_
|
|
928
1354
|
|
|
929
|
-
|
|
1355
|
+
## `nex autocomplete [SHELL]`
|
|
930
1356
|
|
|
931
|
-
|
|
1357
|
+
Display autocomplete installation instructions.
|
|
932
1358
|
|
|
933
|
-
|
|
934
|
-
|
|
1359
|
+
```
|
|
1360
|
+
USAGE
|
|
1361
|
+
$ nex autocomplete [SHELL] [-r]
|
|
935
1362
|
|
|
936
|
-
|
|
1363
|
+
ARGUMENTS
|
|
1364
|
+
[SHELL] (zsh|bash|powershell) Shell type
|
|
937
1365
|
|
|
938
|
-
|
|
1366
|
+
FLAGS
|
|
1367
|
+
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
939
1368
|
|
|
940
|
-
|
|
1369
|
+
DESCRIPTION
|
|
1370
|
+
Display autocomplete installation instructions.
|
|
941
1371
|
|
|
942
|
-
|
|
1372
|
+
EXAMPLES
|
|
1373
|
+
$ nex autocomplete
|
|
943
1374
|
|
|
944
|
-
|
|
1375
|
+
$ nex autocomplete bash
|
|
945
1376
|
|
|
946
|
-
|
|
1377
|
+
$ nex autocomplete zsh
|
|
947
1378
|
|
|
948
|
-
|
|
1379
|
+
$ nex autocomplete powershell
|
|
949
1380
|
|
|
950
|
-
|
|
1381
|
+
$ nex autocomplete --refresh-cache
|
|
951
1382
|
```
|
|
952
1383
|
|
|
953
|
-
|
|
1384
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.40/src/commands/autocomplete/index.ts)_
|
|
954
1385
|
|
|
955
|
-
|
|
1386
|
+
## `nex batch create`
|
|
1387
|
+
|
|
1388
|
+
Batch create records on a ServiceNow instance from a JSON file.
|
|
1389
|
+
|
|
1390
|
+
```
|
|
1391
|
+
USAGE
|
|
1392
|
+
$ nex batch create -f <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--transaction]
|
|
1393
|
+
|
|
1394
|
+
FLAGS
|
|
1395
|
+
-a, --auth=<value> Auth alias to use.
|
|
1396
|
+
-f, --file=<value> (required) Path to JSON file with create operations
|
|
1397
|
+
--transaction Stop on first error (transactional)
|
|
1398
|
+
|
|
1399
|
+
GLOBAL FLAGS
|
|
1400
|
+
--json Format output as json.
|
|
1401
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1402
|
+
<options: debug|warn|error|info|trace>
|
|
1403
|
+
|
|
1404
|
+
DESCRIPTION
|
|
1405
|
+
Batch create records on a ServiceNow instance from a JSON file.
|
|
1406
|
+
|
|
1407
|
+
EXAMPLES
|
|
1408
|
+
Create records from a JSON file
|
|
1409
|
+
|
|
1410
|
+
$ nex batch create --file ./records.json --auth dev
|
|
1411
|
+
|
|
1412
|
+
Create records without transactional mode
|
|
1413
|
+
|
|
1414
|
+
$ nex batch create --file ./records.json --no-transaction --auth dev
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
_See code: [src/commands/batch/create.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/batch/create.ts)_
|
|
1418
|
+
|
|
1419
|
+
## `nex batch update`
|
|
1420
|
+
|
|
1421
|
+
Batch update records on a ServiceNow instance from a JSON file.
|
|
1422
|
+
|
|
1423
|
+
```
|
|
1424
|
+
USAGE
|
|
1425
|
+
$ nex batch update -f <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--stop-on-error]
|
|
1426
|
+
|
|
1427
|
+
FLAGS
|
|
1428
|
+
-a, --auth=<value> Auth alias to use.
|
|
1429
|
+
-f, --file=<value> (required) Path to JSON file with update operations
|
|
1430
|
+
--stop-on-error Stop processing on first error
|
|
1431
|
+
|
|
1432
|
+
GLOBAL FLAGS
|
|
1433
|
+
--json Format output as json.
|
|
1434
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1435
|
+
<options: debug|warn|error|info|trace>
|
|
1436
|
+
|
|
1437
|
+
DESCRIPTION
|
|
1438
|
+
Batch update records on a ServiceNow instance from a JSON file.
|
|
1439
|
+
|
|
1440
|
+
EXAMPLES
|
|
1441
|
+
Update records from a JSON file
|
|
1442
|
+
|
|
1443
|
+
$ nex batch update --file ./updates.json --auth dev
|
|
1444
|
+
|
|
1445
|
+
Update records and stop on first error
|
|
1446
|
+
|
|
1447
|
+
$ nex batch update --file ./updates.json --stop-on-error --auth dev
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
_See code: [src/commands/batch/update.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/batch/update.ts)_
|
|
1451
|
+
|
|
1452
|
+
## `nex bulk delete`
|
|
1453
|
+
|
|
1454
|
+
Bulk delete records matching an encoded query.
|
|
1455
|
+
|
|
1456
|
+
```
|
|
1457
|
+
USAGE
|
|
1458
|
+
$ nex bulk delete -t <value> -q <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--confirm]
|
|
1459
|
+
[-l <value>]
|
|
1460
|
+
|
|
1461
|
+
FLAGS
|
|
1462
|
+
-a, --auth=<value> Auth alias to use.
|
|
1463
|
+
-j, --json Output results as JSON
|
|
1464
|
+
-l, --limit=<value> [default: 200] Maximum number of records to delete (default 200, max 10000)
|
|
1465
|
+
-q, --query=<value> (required) Encoded query to match records for deletion
|
|
1466
|
+
-t, --table=<value> (required) Table name to delete records from
|
|
1467
|
+
--confirm Execute the delete (without this flag, performs a dry run)
|
|
1468
|
+
|
|
1469
|
+
GLOBAL FLAGS
|
|
1470
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1471
|
+
<options: debug|warn|error|info|trace>
|
|
1472
|
+
|
|
1473
|
+
DESCRIPTION
|
|
1474
|
+
Bulk delete records matching an encoded query.
|
|
1475
|
+
|
|
1476
|
+
Finds all records in a table matching the given query, then deletes each one. Defaults to dry-run mode — use --confirm
|
|
1477
|
+
to execute.
|
|
1478
|
+
|
|
1479
|
+
Features:
|
|
1480
|
+
• Safe dry-run by default (shows match count without deleting)
|
|
1481
|
+
• Encoded query filtering
|
|
1482
|
+
• Configurable record limit (default 200, max 10000)
|
|
1483
|
+
• Progress reporting for large operations
|
|
1484
|
+
• Error collection — operation continues even if individual records fail
|
|
1485
|
+
|
|
1486
|
+
EXAMPLES
|
|
1487
|
+
Dry run — see how many records would be deleted
|
|
1488
|
+
|
|
1489
|
+
$ nex bulk delete --table u_temp_import --query "sys_created_on<2024-01-01" --auth dev
|
|
1490
|
+
|
|
1491
|
+
Execute the delete (requires --confirm)
|
|
1492
|
+
|
|
1493
|
+
$ nex bulk delete --table u_temp_import --query "sys_created_on<2024-01-01" --confirm --auth dev
|
|
1494
|
+
|
|
1495
|
+
Delete with custom limit
|
|
1496
|
+
|
|
1497
|
+
$ nex bulk delete --table incident --query "active=false^closed_at<2023-01-01" --limit 1000 --confirm --auth dev
|
|
1498
|
+
|
|
1499
|
+
Delete as JSON output
|
|
1500
|
+
|
|
1501
|
+
$ nex bulk delete --table u_staging --query "processed=true" --confirm --json --auth dev
|
|
1502
|
+
```
|
|
1503
|
+
|
|
1504
|
+
_See code: [src/commands/bulk/delete.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/bulk/delete.ts)_
|
|
1505
|
+
|
|
1506
|
+
## `nex bulk update`
|
|
1507
|
+
|
|
1508
|
+
Bulk update records matching an encoded query.
|
|
1509
|
+
|
|
1510
|
+
```
|
|
1511
|
+
USAGE
|
|
1512
|
+
$ nex bulk update -t <value> -q <value> -d <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1513
|
+
[--confirm] [-l <value>]
|
|
1514
|
+
|
|
1515
|
+
FLAGS
|
|
1516
|
+
-a, --auth=<value> Auth alias to use.
|
|
1517
|
+
-d, --data=<value> (required) JSON object of field=value pairs to apply (e.g. '{"priority":"4","state":"2"}')
|
|
1518
|
+
-j, --json Output results as JSON
|
|
1519
|
+
-l, --limit=<value> [default: 200] Maximum number of records to update (default 200, max 10000)
|
|
1520
|
+
-q, --query=<value> (required) Encoded query to match records
|
|
1521
|
+
-t, --table=<value> (required) Table name to update records in
|
|
1522
|
+
--confirm Execute the update (without this flag, performs a dry run)
|
|
1523
|
+
|
|
1524
|
+
GLOBAL FLAGS
|
|
1525
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1526
|
+
<options: debug|warn|error|info|trace>
|
|
1527
|
+
|
|
1528
|
+
DESCRIPTION
|
|
1529
|
+
Bulk update records matching an encoded query.
|
|
1530
|
+
|
|
1531
|
+
Finds all records in a table matching the given query, then applies field updates to each one. Defaults to dry-run
|
|
1532
|
+
mode — use --confirm to execute.
|
|
1533
|
+
|
|
1534
|
+
Features:
|
|
1535
|
+
• Safe dry-run by default (shows match count without modifying data)
|
|
1536
|
+
• Encoded query filtering
|
|
1537
|
+
• JSON field=value pairs for update data
|
|
1538
|
+
• Configurable record limit (default 200, max 10000)
|
|
1539
|
+
• Progress reporting for large operations
|
|
1540
|
+
• Error collection — operation continues even if individual records fail
|
|
1541
|
+
|
|
1542
|
+
EXAMPLES
|
|
1543
|
+
Dry run — see how many records would be updated
|
|
1544
|
+
|
|
1545
|
+
$ nex bulk update --table incident --query "active=true^priority=5" --data '{"priority":"4"}' --auth dev
|
|
1546
|
+
|
|
1547
|
+
Execute the update (requires --confirm)
|
|
1548
|
+
|
|
1549
|
+
$ nex bulk update --table incident --query "active=true^priority=5" --data '{"priority":"4"}' --confirm --auth \
|
|
1550
|
+
dev
|
|
1551
|
+
|
|
1552
|
+
Update with custom limit
|
|
1553
|
+
|
|
1554
|
+
$ nex bulk update --table incident --query "state=1" --data '{"assignment_group":"group-sys-id"}' --limit 500 \
|
|
1555
|
+
--confirm --auth dev
|
|
1556
|
+
|
|
1557
|
+
Update as JSON output
|
|
1558
|
+
|
|
1559
|
+
$ nex bulk update --table incident --query "active=true" --data '{"state":"6"}' --confirm --json --auth dev
|
|
1560
|
+
```
|
|
1561
|
+
|
|
1562
|
+
_See code: [src/commands/bulk/update.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/bulk/update.ts)_
|
|
1563
|
+
|
|
1564
|
+
## `nex exec SCOPE [FILE]`
|
|
1565
|
+
|
|
1566
|
+
Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.
|
|
1567
|
+
|
|
1568
|
+
```
|
|
1569
|
+
USAGE
|
|
1570
|
+
$ nex exec SCOPE [FILE] [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-p <value>]
|
|
1571
|
+
|
|
1572
|
+
ARGUMENTS
|
|
1573
|
+
SCOPE Scope to execute script in. Use "global" for global scope.
|
|
1574
|
+
[FILE] File to execute in scripts background. If omitted, starts REPL mode.
|
|
1575
|
+
|
|
1576
|
+
FLAGS
|
|
1577
|
+
-a, --auth=<value> Auth alias to use.
|
|
1578
|
+
-p, --params=<value> JSON object of parameters to replace in script file. Use {paramName} syntax in your script.
|
|
1579
|
+
|
|
1580
|
+
GLOBAL FLAGS
|
|
1581
|
+
--json Format output as json.
|
|
1582
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1583
|
+
<options: debug|warn|error|info|trace>
|
|
1584
|
+
|
|
1585
|
+
DESCRIPTION
|
|
1586
|
+
Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.
|
|
1587
|
+
|
|
1588
|
+
This command allows you to run JavaScript either from files or interactively via REPL mode. It mimics the
|
|
1589
|
+
functionality of the Scripts - Background interface in ServiceNow, providing a way to execute scripts programmatically
|
|
1590
|
+
without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.
|
|
1591
|
+
|
|
1592
|
+
Modes:
|
|
1593
|
+
• File Mode: Provide a file path to execute scripts from a file
|
|
1594
|
+
• REPL Mode: Omit the file path to start an interactive session
|
|
1595
|
+
|
|
1596
|
+
Features:
|
|
1597
|
+
• Execute local JavaScript files remotely
|
|
1598
|
+
• Interactive REPL for ad-hoc script execution
|
|
1599
|
+
• Script parameterization with {placeholder} replacement
|
|
1600
|
+
• Multi-line script support in REPL
|
|
1601
|
+
• Scope-aware execution (global or custom scope)
|
|
1602
|
+
• Real-time console output capture
|
|
1603
|
+
• Pipe-able output for command chaining
|
|
1604
|
+
• Debug logging support
|
|
1605
|
+
• Useful for data migration, testing, and administrative tasks
|
|
1606
|
+
|
|
1607
|
+
Script Parameterization:
|
|
1608
|
+
Use {paramName} placeholders in your script files, then provide values via --params:
|
|
1609
|
+
• Supports any JSON-serializable values (strings, numbers, booleans)
|
|
1610
|
+
• Multiple parameters supported
|
|
1611
|
+
• All occurrences of each placeholder are replaced
|
|
1612
|
+
• Example: {token}, {username}, {environment}
|
|
1613
|
+
|
|
1614
|
+
REPL Controls:
|
|
1615
|
+
• Press Enter to add a new line
|
|
1616
|
+
• Type .exec or press Ctrl+D to execute the script
|
|
1617
|
+
• Type .clear to clear the current input
|
|
1618
|
+
• Type .exit or press Ctrl+C twice to exit REPL
|
|
1619
|
+
|
|
1620
|
+
⚠️ IMPORTANT SECURITY WARNING:
|
|
1621
|
+
This command executes scripts with the same permissions and risks as using Scripts - Background directly
|
|
1622
|
+
in ServiceNow. Always:
|
|
1623
|
+
• Review scripts before execution
|
|
1624
|
+
• Test in non-production environments first
|
|
1625
|
+
• Use appropriate scoping to limit access
|
|
1626
|
+
• Be aware of data modification risks
|
|
1627
|
+
• Follow your organization's security policies
|
|
1628
|
+
• Never execute untrusted scripts
|
|
1629
|
+
|
|
1630
|
+
Script Capabilities:
|
|
1631
|
+
Scripts run with full GlideSystem API access and can:
|
|
1632
|
+
• Query and modify database records
|
|
1633
|
+
• Create, update, and delete data
|
|
1634
|
+
• Execute business rules and workflows
|
|
1635
|
+
• Access all APIs available in Scripts - Background
|
|
1636
|
+
• Use gs, GlideRecord, GlideAggregate, and other server-side APIs
|
|
1637
|
+
|
|
1638
|
+
EXAMPLES
|
|
1639
|
+
Start REPL in global scope
|
|
1640
|
+
|
|
1641
|
+
$ nex exec global --auth dev-instance
|
|
1642
|
+
|
|
1643
|
+
Start REPL in custom application scope
|
|
1644
|
+
|
|
1645
|
+
$ nex exec x_my_custom_app --auth dev-instance
|
|
1646
|
+
|
|
1647
|
+
Execute a script file in global scope
|
|
1648
|
+
|
|
1649
|
+
$ nex exec global ./scripts/cleanup.js --auth dev-instance
|
|
1650
|
+
|
|
1651
|
+
Execute a script file in a custom application scope
|
|
1652
|
+
|
|
1653
|
+
$ nex exec x_my_custom_app ./scripts/app-config.js --auth dev-instance
|
|
1654
|
+
|
|
1655
|
+
Execute a parameterized script with single parameter
|
|
1656
|
+
|
|
1657
|
+
$ nex exec global ./scripts/query-user.js --auth dev-instance --params '{"username":"admin"}'
|
|
1658
|
+
|
|
1659
|
+
Execute a parameterized script with multiple parameters
|
|
1660
|
+
|
|
1661
|
+
$ nex exec global ./scripts/update-record.js --auth dev-instance --params \
|
|
1662
|
+
'{"table":"incident","field":"priority","value":"1"}'
|
|
1663
|
+
|
|
1664
|
+
Execute and save output to a file
|
|
1665
|
+
|
|
1666
|
+
$ nex exec global ./scripts/report.js --auth dev-instance > report.txt
|
|
1667
|
+
|
|
1668
|
+
Execute and pipe output to grep for filtering
|
|
1669
|
+
|
|
1670
|
+
$ nex exec global ./scripts/list-users.js --auth dev-instance | grep "admin"
|
|
1671
|
+
|
|
1672
|
+
Execute with debug logging to troubleshoot issues
|
|
1673
|
+
|
|
1674
|
+
$ nex exec global ./script.js --auth dev-instance --log-level debug
|
|
1675
|
+
|
|
1676
|
+
Execute with parameters for template replacement
|
|
1677
|
+
|
|
1678
|
+
$ nex exec global ./script.js --auth dev-instance --params '{"token":"abc123","env":"dev"}'
|
|
1679
|
+
```
|
|
1680
|
+
|
|
1681
|
+
_See code: [src/commands/exec/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/exec/index.ts)_
|
|
1682
|
+
|
|
1683
|
+
## `nex flow action`
|
|
1684
|
+
|
|
1685
|
+
Execute a Flow Designer action by scoped name.
|
|
1686
|
+
|
|
1687
|
+
```
|
|
1688
|
+
USAGE
|
|
1689
|
+
$ nex flow action -n <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-i <value>] [-m
|
|
1690
|
+
foreground|background] [--scope <value>] [--quick]
|
|
1691
|
+
|
|
1692
|
+
FLAGS
|
|
1693
|
+
-a, --auth=<value> Auth alias to use.
|
|
1694
|
+
-i, --inputs=<value> JSON object of input name-value pairs
|
|
1695
|
+
-j, --json Output results as JSON
|
|
1696
|
+
-m, --mode=<option> [default: foreground] Execution mode
|
|
1697
|
+
<options: foreground|background>
|
|
1698
|
+
-n, --name=<value> (required) Scoped name of the action (e.g. global.create_record)
|
|
1699
|
+
--quick Skip execution detail records for better performance
|
|
1700
|
+
--scope=<value> Scope context for script execution
|
|
1701
|
+
|
|
1702
|
+
GLOBAL FLAGS
|
|
1703
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1704
|
+
<options: debug|warn|error|info|trace>
|
|
1705
|
+
|
|
1706
|
+
DESCRIPTION
|
|
1707
|
+
Execute a Flow Designer action by scoped name.
|
|
1708
|
+
|
|
1709
|
+
Runs an action using the sn_fd.FlowAPI ScriptableFlowRunner.
|
|
1710
|
+
|
|
1711
|
+
Features:
|
|
1712
|
+
• Execute actions by scoped name
|
|
1713
|
+
• Pass input values as JSON
|
|
1714
|
+
• Foreground or background execution mode
|
|
1715
|
+
• Returns context ID, outputs, and debug information
|
|
1716
|
+
|
|
1717
|
+
EXAMPLES
|
|
1718
|
+
Run an action
|
|
1719
|
+
|
|
1720
|
+
$ nex flow action --name global.create_record --inputs \
|
|
1721
|
+
'{"table":"incident","values":{"short_description":"Test"}}' --auth dev
|
|
1722
|
+
```
|
|
1723
|
+
|
|
1724
|
+
_See code: [src/commands/flow/action.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/action.ts)_
|
|
1725
|
+
|
|
1726
|
+
## `nex flow cancel`
|
|
1727
|
+
|
|
1728
|
+
Cancel a running or paused flow execution.
|
|
1729
|
+
|
|
1730
|
+
```
|
|
1731
|
+
USAGE
|
|
1732
|
+
$ nex flow cancel -c <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-r <value>] [--scope
|
|
1733
|
+
<value>]
|
|
1734
|
+
|
|
1735
|
+
FLAGS
|
|
1736
|
+
-a, --auth=<value> Auth alias to use.
|
|
1737
|
+
-c, --context-id=<value> (required) Flow execution context sys_id
|
|
1738
|
+
-j, --json Output results as JSON
|
|
1739
|
+
-r, --reason=<value> Cancellation reason
|
|
1740
|
+
--scope=<value> Scope context for script execution
|
|
1741
|
+
|
|
1742
|
+
GLOBAL FLAGS
|
|
1743
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1744
|
+
<options: debug|warn|error|info|trace>
|
|
1745
|
+
|
|
1746
|
+
DESCRIPTION
|
|
1747
|
+
Cancel a running or paused flow execution.
|
|
1748
|
+
|
|
1749
|
+
Cancels a flow context that is in QUEUED, IN_PROGRESS, or WAITING state.
|
|
1750
|
+
|
|
1751
|
+
EXAMPLES
|
|
1752
|
+
Cancel a running flow
|
|
1753
|
+
|
|
1754
|
+
$ nex flow cancel --context-id abc123def456 --auth dev
|
|
1755
|
+
|
|
1756
|
+
Cancel with a reason
|
|
1757
|
+
|
|
1758
|
+
$ nex flow cancel --context-id abc123def456 --reason "No longer needed" --auth dev
|
|
1759
|
+
```
|
|
1760
|
+
|
|
1761
|
+
_See code: [src/commands/flow/cancel.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/cancel.ts)_
|
|
1762
|
+
|
|
1763
|
+
## `nex flow error`
|
|
1764
|
+
|
|
1765
|
+
Retrieve error details from a failed flow execution.
|
|
1766
|
+
|
|
1767
|
+
```
|
|
1768
|
+
USAGE
|
|
1769
|
+
$ nex flow error -c <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--scope <value>]
|
|
1770
|
+
|
|
1771
|
+
FLAGS
|
|
1772
|
+
-a, --auth=<value> Auth alias to use.
|
|
1773
|
+
-c, --context-id=<value> (required) Flow execution context sys_id
|
|
1774
|
+
-j, --json Output results as JSON
|
|
1775
|
+
--scope=<value> Scope context for script execution
|
|
1776
|
+
|
|
1777
|
+
GLOBAL FLAGS
|
|
1778
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1779
|
+
<options: debug|warn|error|info|trace>
|
|
1780
|
+
|
|
1781
|
+
DESCRIPTION
|
|
1782
|
+
Retrieve error details from a failed flow execution.
|
|
1783
|
+
|
|
1784
|
+
Gets the error message from a flow context that ended in an error state.
|
|
1785
|
+
|
|
1786
|
+
EXAMPLES
|
|
1787
|
+
Get flow error details
|
|
1788
|
+
|
|
1789
|
+
$ nex flow error --context-id abc123def456 --auth dev
|
|
1790
|
+
```
|
|
1791
|
+
|
|
1792
|
+
_See code: [src/commands/flow/error.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/error.ts)_
|
|
1793
|
+
|
|
1794
|
+
## `nex flow message`
|
|
1795
|
+
|
|
1796
|
+
Send a message to a paused flow execution.
|
|
1797
|
+
|
|
1798
|
+
```
|
|
1799
|
+
USAGE
|
|
1800
|
+
$ nex flow message -c <value> -m <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-p
|
|
1801
|
+
<value>] [--scope <value>]
|
|
1802
|
+
|
|
1803
|
+
FLAGS
|
|
1804
|
+
-a, --auth=<value> Auth alias to use.
|
|
1805
|
+
-c, --context-id=<value> (required) Flow execution context sys_id
|
|
1806
|
+
-j, --json Output results as JSON
|
|
1807
|
+
-m, --message=<value> (required) Message to send to the flow
|
|
1808
|
+
-p, --payload=<value> Optional JSON payload to include with the message
|
|
1809
|
+
--scope=<value> Scope context for script execution
|
|
1810
|
+
|
|
1811
|
+
GLOBAL FLAGS
|
|
1812
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1813
|
+
<options: debug|warn|error|info|trace>
|
|
1814
|
+
|
|
1815
|
+
DESCRIPTION
|
|
1816
|
+
Send a message to a paused flow execution.
|
|
1817
|
+
|
|
1818
|
+
Sends a message to a flow context that is in a WAITING state (e.g. waiting on a "Wait for Message" action). Supports
|
|
1819
|
+
an optional JSON payload.
|
|
1820
|
+
|
|
1821
|
+
EXAMPLES
|
|
1822
|
+
Send a message to resume a waiting flow
|
|
1823
|
+
|
|
1824
|
+
$ nex flow message --context-id abc123def456 --message "approved" --auth dev
|
|
1825
|
+
|
|
1826
|
+
Send a message with a JSON payload
|
|
1827
|
+
|
|
1828
|
+
$ nex flow message --context-id abc123def456 --message "data_ready" --payload '{"status":"ok"}' --auth dev
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
_See code: [src/commands/flow/message.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/message.ts)_
|
|
1832
|
+
|
|
1833
|
+
## `nex flow outputs`
|
|
1834
|
+
|
|
1835
|
+
Retrieve outputs from a completed flow execution.
|
|
1836
|
+
|
|
1837
|
+
```
|
|
1838
|
+
USAGE
|
|
1839
|
+
$ nex flow outputs -c <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--scope <value>]
|
|
1840
|
+
|
|
1841
|
+
FLAGS
|
|
1842
|
+
-a, --auth=<value> Auth alias to use.
|
|
1843
|
+
-c, --context-id=<value> (required) Flow execution context sys_id
|
|
1844
|
+
-j, --json Output results as JSON
|
|
1845
|
+
--scope=<value> Scope context for script execution
|
|
1846
|
+
|
|
1847
|
+
GLOBAL FLAGS
|
|
1848
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1849
|
+
<options: debug|warn|error|info|trace>
|
|
1850
|
+
|
|
1851
|
+
DESCRIPTION
|
|
1852
|
+
Retrieve outputs from a completed flow execution.
|
|
1853
|
+
|
|
1854
|
+
Gets the output name-value pairs from a flow, subflow, or action execution context.
|
|
1855
|
+
|
|
1856
|
+
EXAMPLES
|
|
1857
|
+
Get flow outputs
|
|
1858
|
+
|
|
1859
|
+
$ nex flow outputs --context-id abc123def456 --auth dev
|
|
1860
|
+
|
|
1861
|
+
Get outputs as JSON
|
|
1862
|
+
|
|
1863
|
+
$ nex flow outputs --context-id abc123def456 --json --auth dev
|
|
1864
|
+
```
|
|
1865
|
+
|
|
1866
|
+
_See code: [src/commands/flow/outputs.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/outputs.ts)_
|
|
1867
|
+
|
|
1868
|
+
## `nex flow run`
|
|
1869
|
+
|
|
1870
|
+
Execute a published Flow Designer flow by scoped name.
|
|
1871
|
+
|
|
1872
|
+
```
|
|
1873
|
+
USAGE
|
|
1874
|
+
$ nex flow run -n <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-i <value>] [-m
|
|
1875
|
+
foreground|background] [--scope <value>] [--quick]
|
|
1876
|
+
|
|
1877
|
+
FLAGS
|
|
1878
|
+
-a, --auth=<value> Auth alias to use.
|
|
1879
|
+
-i, --inputs=<value> JSON object of input name-value pairs
|
|
1880
|
+
-j, --json Output results as JSON
|
|
1881
|
+
-m, --mode=<option> [default: foreground] Execution mode
|
|
1882
|
+
<options: foreground|background>
|
|
1883
|
+
-n, --name=<value> (required) Scoped name of the flow (e.g. global.my_flow)
|
|
1884
|
+
--quick Skip execution detail records for better performance
|
|
1885
|
+
--scope=<value> Scope context for script execution (e.g. global, x_myapp)
|
|
1886
|
+
|
|
1887
|
+
GLOBAL FLAGS
|
|
1888
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1889
|
+
<options: debug|warn|error|info|trace>
|
|
1890
|
+
|
|
1891
|
+
DESCRIPTION
|
|
1892
|
+
Execute a published Flow Designer flow by scoped name.
|
|
1893
|
+
|
|
1894
|
+
Runs a flow using the sn_fd.FlowAPI ScriptableFlowRunner. Supports foreground (synchronous) and background
|
|
1895
|
+
(asynchronous) execution modes.
|
|
1896
|
+
|
|
1897
|
+
Note: This command requires the flow to be published. For testing flows that are not yet published (draft/saved
|
|
1898
|
+
state), use `flow test` instead.
|
|
1899
|
+
|
|
1900
|
+
Features:
|
|
1901
|
+
• Execute flows by scoped name (e.g. global.my_flow)
|
|
1902
|
+
• Pass input values as JSON
|
|
1903
|
+
• Foreground or background execution mode
|
|
1904
|
+
• Quick mode to skip execution detail records
|
|
1905
|
+
• Returns context ID, outputs, and debug information
|
|
1906
|
+
|
|
1907
|
+
EXAMPLES
|
|
1908
|
+
Run a flow in foreground mode
|
|
1909
|
+
|
|
1910
|
+
$ nex flow run --name global.my_flow --auth dev
|
|
1911
|
+
|
|
1912
|
+
Run with inputs
|
|
1913
|
+
|
|
1914
|
+
$ nex flow run --name global.my_flow --inputs '{"record_sys_id":"abc123"}' --auth dev
|
|
1915
|
+
|
|
1916
|
+
Run in background mode
|
|
1917
|
+
|
|
1918
|
+
$ nex flow run --name global.my_flow --mode background --auth dev
|
|
1919
|
+
```
|
|
1920
|
+
|
|
1921
|
+
_See code: [src/commands/flow/run.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/run.ts)_
|
|
1922
|
+
|
|
1923
|
+
## `nex flow status`
|
|
1924
|
+
|
|
1925
|
+
Get the status of a flow execution context.
|
|
1926
|
+
|
|
1927
|
+
```
|
|
1928
|
+
USAGE
|
|
1929
|
+
$ nex flow status -c <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--scope <value>]
|
|
1930
|
+
|
|
1931
|
+
FLAGS
|
|
1932
|
+
-a, --auth=<value> Auth alias to use.
|
|
1933
|
+
-c, --context-id=<value> (required) Flow execution context sys_id
|
|
1934
|
+
-j, --json Output results as JSON
|
|
1935
|
+
--scope=<value> Scope context for script execution
|
|
1936
|
+
|
|
1937
|
+
GLOBAL FLAGS
|
|
1938
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1939
|
+
<options: debug|warn|error|info|trace>
|
|
1940
|
+
|
|
1941
|
+
DESCRIPTION
|
|
1942
|
+
Get the status of a flow execution context.
|
|
1943
|
+
|
|
1944
|
+
Queries sys_flow_context to retrieve the current state of a flow execution.
|
|
1945
|
+
|
|
1946
|
+
Possible states: QUEUED, IN_PROGRESS, WAITING, COMPLETE, CANCELLED, ERROR
|
|
1947
|
+
|
|
1948
|
+
EXAMPLES
|
|
1949
|
+
Check flow execution status
|
|
1950
|
+
|
|
1951
|
+
$ nex flow status --context-id abc123def456 --auth dev
|
|
1952
|
+
```
|
|
1953
|
+
|
|
1954
|
+
_See code: [src/commands/flow/status.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/status.ts)_
|
|
1955
|
+
|
|
1956
|
+
## `nex flow subflow`
|
|
1957
|
+
|
|
1958
|
+
Execute a published Flow Designer subflow by scoped name.
|
|
1959
|
+
|
|
1960
|
+
```
|
|
1961
|
+
USAGE
|
|
1962
|
+
$ nex flow subflow -n <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-i <value>] [-m
|
|
1963
|
+
foreground|background] [--scope <value>] [--quick]
|
|
1964
|
+
|
|
1965
|
+
FLAGS
|
|
1966
|
+
-a, --auth=<value> Auth alias to use.
|
|
1967
|
+
-i, --inputs=<value> JSON object of input name-value pairs
|
|
1968
|
+
-j, --json Output results as JSON
|
|
1969
|
+
-m, --mode=<option> [default: foreground] Execution mode
|
|
1970
|
+
<options: foreground|background>
|
|
1971
|
+
-n, --name=<value> (required) Scoped name of the subflow (e.g. global.my_subflow)
|
|
1972
|
+
--quick Skip execution detail records for better performance
|
|
1973
|
+
--scope=<value> Scope context for script execution
|
|
1974
|
+
|
|
1975
|
+
GLOBAL FLAGS
|
|
1976
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
1977
|
+
<options: debug|warn|error|info|trace>
|
|
1978
|
+
|
|
1979
|
+
DESCRIPTION
|
|
1980
|
+
Execute a published Flow Designer subflow by scoped name.
|
|
1981
|
+
|
|
1982
|
+
Runs a subflow using the sn_fd.FlowAPI ScriptableFlowRunner.
|
|
1983
|
+
|
|
1984
|
+
Note: This command requires the subflow to be published. For testing flows that are not yet published (draft/saved
|
|
1985
|
+
state), use `flow test` instead.
|
|
1986
|
+
|
|
1987
|
+
Features:
|
|
1988
|
+
• Execute subflows by scoped name
|
|
1989
|
+
• Pass input values as JSON
|
|
1990
|
+
• Foreground or background execution mode
|
|
1991
|
+
• Returns context ID, outputs, and debug information
|
|
1992
|
+
|
|
1993
|
+
EXAMPLES
|
|
1994
|
+
Run a subflow
|
|
1995
|
+
|
|
1996
|
+
$ nex flow subflow --name global.my_subflow --auth dev
|
|
1997
|
+
|
|
1998
|
+
Run with inputs
|
|
1999
|
+
|
|
2000
|
+
$ nex flow subflow --name x_myapp.process_record --inputs '{"table":"incident","sys_id":"abc123"}' --auth dev
|
|
2001
|
+
```
|
|
2002
|
+
|
|
2003
|
+
_See code: [src/commands/flow/subflow.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/subflow.ts)_
|
|
2004
|
+
|
|
2005
|
+
## `nex flow test`
|
|
2006
|
+
|
|
2007
|
+
Test a Flow Designer flow without requiring it to be published.
|
|
2008
|
+
|
|
2009
|
+
```
|
|
2010
|
+
USAGE
|
|
2011
|
+
$ nex flow test -f <value> -o <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--scope
|
|
2012
|
+
<value>] [--synchronous]
|
|
2013
|
+
|
|
2014
|
+
FLAGS
|
|
2015
|
+
-a, --auth=<value> Auth alias to use.
|
|
2016
|
+
-f, --flow-id=<value> (required) Flow sys_id or scoped name (e.g. x_myapp.my_flow)
|
|
2017
|
+
-j, --json Output results as JSON
|
|
2018
|
+
-o, --output-map=<value> (required) JSON mapping of trigger output variable names to test values (e.g.
|
|
2019
|
+
'{"current":"<sys_id>","table_name":"change_request"}')
|
|
2020
|
+
--scope=<value> Scope sys_id for transaction scope (auto-resolved from flow definition if omitted)
|
|
2021
|
+
--[no-]synchronous Run test synchronously (default: true)
|
|
2022
|
+
|
|
2023
|
+
GLOBAL FLAGS
|
|
2024
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2025
|
+
<options: debug|warn|error|info|trace>
|
|
2026
|
+
|
|
2027
|
+
DESCRIPTION
|
|
2028
|
+
Test a Flow Designer flow without requiring it to be published.
|
|
2029
|
+
|
|
2030
|
+
Invokes the same API as the "Test" button in Flow Designer, running the flow in its current saved (draft) state.
|
|
2031
|
+
Unlike `flow run` which requires a published flow and uses sn_fd.FlowAPI, `flow test` works on unpublished drafts via
|
|
2032
|
+
the ProcessFlow REST API.
|
|
2033
|
+
|
|
2034
|
+
Features:
|
|
2035
|
+
• Test flows by sys_id or scoped name
|
|
2036
|
+
• Pass trigger output values as JSON via --output-map
|
|
2037
|
+
• Auto-resolves scope from flow definition if not provided
|
|
2038
|
+
• Synchronous or asynchronous execution
|
|
2039
|
+
|
|
2040
|
+
EXAMPLES
|
|
2041
|
+
Test a flow by sys_id
|
|
2042
|
+
|
|
2043
|
+
$ nex flow test --flow-id 887dda5583237210fdb8f7b6feaad32c --output-map \
|
|
2044
|
+
'{"current":"0ecd7552db252200a6a2b31be0b8f5e6","table_name":"change_request"}' --auth dev
|
|
2045
|
+
|
|
2046
|
+
Test a flow by scoped name with explicit scope
|
|
2047
|
+
|
|
2048
|
+
$ nex flow test -f x_myapp.my_flow -o '{"current":"abc123","table_name":"incident"}' --scope x_myapp --auth dev
|
|
2049
|
+
|
|
2050
|
+
Test with JSON output
|
|
2051
|
+
|
|
2052
|
+
$ nex flow test -f 887dda5583237210fdb8f7b6feaad32c -o '{"current":"abc123"}' --json --auth dev
|
|
2053
|
+
```
|
|
2054
|
+
|
|
2055
|
+
_See code: [src/commands/flow/test.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/flow/test.ts)_
|
|
2056
|
+
|
|
2057
|
+
## `nex health check`
|
|
2058
|
+
|
|
2059
|
+
Run a consolidated health check on a ServiceNow instance.
|
|
2060
|
+
|
|
2061
|
+
```
|
|
2062
|
+
USAGE
|
|
2063
|
+
$ nex health check [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--include-version]
|
|
2064
|
+
[--include-cluster] [--include-stuck-jobs] [--include-semaphores] [--include-operational-counts]
|
|
2065
|
+
[--stuck-job-threshold <value>]
|
|
2066
|
+
|
|
2067
|
+
FLAGS
|
|
2068
|
+
-a, --auth=<value> Auth alias to use.
|
|
2069
|
+
-j, --json Output results as JSON
|
|
2070
|
+
--[no-]include-cluster Include cluster node status
|
|
2071
|
+
--[no-]include-operational-counts Include operational record counts (incidents, changes, problems)
|
|
2072
|
+
--[no-]include-semaphores Include active semaphore count
|
|
2073
|
+
--[no-]include-stuck-jobs Include stuck job detection
|
|
2074
|
+
--[no-]include-version Include instance version information
|
|
2075
|
+
--stuck-job-threshold=<value> [default: 30] Minutes threshold for a job to be considered stuck
|
|
2076
|
+
|
|
2077
|
+
GLOBAL FLAGS
|
|
2078
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2079
|
+
<options: debug|warn|error|info|trace>
|
|
2080
|
+
|
|
2081
|
+
DESCRIPTION
|
|
2082
|
+
Run a consolidated health check on a ServiceNow instance.
|
|
2083
|
+
|
|
2084
|
+
Performs comprehensive diagnostics including version info, cluster status, stuck job detection, semaphore counts, and
|
|
2085
|
+
operational record counts.
|
|
2086
|
+
|
|
2087
|
+
Features:
|
|
2088
|
+
• Instance version and build information
|
|
2089
|
+
• Cluster node status
|
|
2090
|
+
• Stuck job detection with configurable threshold
|
|
2091
|
+
• Active semaphore count
|
|
2092
|
+
• Operational counts (incidents, changes, problems)
|
|
2093
|
+
• Color-coded status indicators
|
|
2094
|
+
• JSON output for CI/CD monitoring
|
|
2095
|
+
|
|
2096
|
+
EXAMPLES
|
|
2097
|
+
Run full health check
|
|
2098
|
+
|
|
2099
|
+
$ nex health check --auth dev
|
|
2100
|
+
|
|
2101
|
+
Check only version and stuck jobs
|
|
2102
|
+
|
|
2103
|
+
$ nex health check --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores \
|
|
2104
|
+
--no-include-operational-counts --auth dev
|
|
2105
|
+
|
|
2106
|
+
Health check with custom stuck job threshold
|
|
2107
|
+
|
|
2108
|
+
$ nex health check --stuck-job-threshold 60 --auth dev
|
|
2109
|
+
|
|
2110
|
+
Health check as JSON
|
|
2111
|
+
|
|
2112
|
+
$ nex health check --json --auth dev
|
|
2113
|
+
```
|
|
2114
|
+
|
|
2115
|
+
_See code: [src/commands/health/check.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/health/check.ts)_
|
|
2116
|
+
|
|
2117
|
+
## `nex help [COMMAND]`
|
|
2118
|
+
|
|
2119
|
+
Display help for nex.
|
|
956
2120
|
|
|
957
2121
|
```
|
|
958
2122
|
USAGE
|
|
959
2123
|
$ nex help [COMMAND...] [-n]
|
|
960
2124
|
|
|
961
|
-
ARGUMENTS
|
|
962
|
-
COMMAND... Command to show help for.
|
|
2125
|
+
ARGUMENTS
|
|
2126
|
+
[COMMAND...] Command to show help for.
|
|
2127
|
+
|
|
2128
|
+
FLAGS
|
|
2129
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
2130
|
+
|
|
2131
|
+
DESCRIPTION
|
|
2132
|
+
Display help for nex.
|
|
2133
|
+
```
|
|
2134
|
+
|
|
2135
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_
|
|
2136
|
+
|
|
2137
|
+
## `nex log`
|
|
2138
|
+
|
|
2139
|
+
Tail and monitor ServiceNow system logs in real-time with beautiful formatting.
|
|
2140
|
+
|
|
2141
|
+
```
|
|
2142
|
+
USAGE
|
|
2143
|
+
$ nex log [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-o <value>] [-i <value>]
|
|
2144
|
+
[--no-color] [-f <value>...]
|
|
2145
|
+
|
|
2146
|
+
FLAGS
|
|
2147
|
+
-a, --auth=<value> Auth alias to use.
|
|
2148
|
+
-f, --filter=<value>... Filter logs by field and value. Syntax: field OPERATOR value. Operators: CONTAINS,
|
|
2149
|
+
CONTAINS_CI (case-insensitive), EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI, ENDS_WITH,
|
|
2150
|
+
ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_EQUALS. Field defaults to "message" if omitted.
|
|
2151
|
+
Multiple filters are combined with AND logic.
|
|
2152
|
+
-i, --interval=<value> [default: 1000] Polling interval in milliseconds
|
|
2153
|
+
-o, --output=<value> Output file path to save logs. Creates parent directories if needed.
|
|
2154
|
+
--no-color Disable colored output
|
|
2155
|
+
|
|
2156
|
+
GLOBAL FLAGS
|
|
2157
|
+
--json Format output as json.
|
|
2158
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2159
|
+
<options: debug|warn|error|info|trace>
|
|
2160
|
+
|
|
2161
|
+
DESCRIPTION
|
|
2162
|
+
Tail and monitor ServiceNow system logs in real-time with beautiful formatting.
|
|
2163
|
+
|
|
2164
|
+
This command provides real-time log monitoring with enhanced visual formatting using color-coded output that makes
|
|
2165
|
+
logs easy to scan and understand at a glance. Automatically highlights errors, warnings, success messages, and
|
|
2166
|
+
important keywords.
|
|
2167
|
+
|
|
2168
|
+
Key Features:
|
|
2169
|
+
• Real-time log tailing (like Unix tail -f)
|
|
2170
|
+
• Powerful filtering with multiple operators (CONTAINS, REGEX, EQUALS, etc.)
|
|
2171
|
+
• Smart keyword highlighting (errors in red, warnings in yellow, etc.)
|
|
2172
|
+
• Beautiful color-coded console output with chalk
|
|
2173
|
+
• Export logs to file with automatic appending
|
|
2174
|
+
• Fast 1-second default polling interval
|
|
2175
|
+
• Timestamps and sequence numbers for each log
|
|
2176
|
+
• Graceful shutdown with Ctrl+C
|
|
2177
|
+
• Clean output without colors (--no-color flag)
|
|
2178
|
+
|
|
2179
|
+
Smart Highlighting:
|
|
2180
|
+
• Error terms (error, exception, failed) - highlighted in RED
|
|
2181
|
+
• Warning terms (warn, warning, deprecated) - highlighted in YELLOW
|
|
2182
|
+
• Success terms (success, completed, done) - highlighted in GREEN
|
|
2183
|
+
• System terms (system, user, transaction) - highlighted in BLUE
|
|
2184
|
+
|
|
2185
|
+
Filtering:
|
|
2186
|
+
• Apply filters using --filter flag with syntax: "field OPERATOR value"
|
|
2187
|
+
• Supports case-sensitive and case-insensitive operations
|
|
2188
|
+
• Multiple filters are combined with AND logic
|
|
2189
|
+
• Operators: CONTAINS, CONTAINS_CI, EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI,
|
|
2190
|
+
ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_CONTAINS_CI, NOT_EQUALS, NOT_EQUALS_CI
|
|
2191
|
+
|
|
2192
|
+
Use Cases:
|
|
2193
|
+
• Monitor logs during application development
|
|
2194
|
+
• Debug issues in real-time
|
|
2195
|
+
• Track system events during deployments
|
|
2196
|
+
• Filter logs for specific application or component
|
|
2197
|
+
• Quickly spot errors and warnings
|
|
2198
|
+
• Collect logs for analysis or audit trails
|
|
2199
|
+
|
|
2200
|
+
⚠️ IMPORTANT NOTES:
|
|
2201
|
+
• Press Ctrl+C to stop tailing and exit gracefully
|
|
2202
|
+
• Log files are created/appended automatically
|
|
2203
|
+
• Uses ChannelAjax when available for better performance
|
|
2204
|
+
• Default poll interval is 1 second for real-time monitoring
|
|
2205
|
+
|
|
2206
|
+
EXAMPLES
|
|
2207
|
+
Tail all logs in real-time
|
|
2208
|
+
|
|
2209
|
+
$ nex log --auth dev-instance
|
|
2210
|
+
|
|
2211
|
+
Tail logs and save to a file
|
|
2212
|
+
|
|
2213
|
+
$ nex log --output ./logs/instance-logs.txt --auth dev-instance
|
|
2214
|
+
|
|
2215
|
+
Tail logs with custom polling interval (500ms for faster updates)
|
|
2216
|
+
|
|
2217
|
+
$ nex log --interval 500 --auth dev-instance
|
|
2218
|
+
|
|
2219
|
+
Filter logs containing specific text (case-insensitive)
|
|
2220
|
+
|
|
2221
|
+
$ nex log --filter "message CONTAINS_CI error" --auth dev-instance
|
|
2222
|
+
|
|
2223
|
+
Filter logs with multiple conditions (AND logic)
|
|
2224
|
+
|
|
2225
|
+
$ nex log --filter "message CONTAINS x_taniu_tan_core" --filter "message CONTAINS error" --auth dev-instance
|
|
2226
|
+
|
|
2227
|
+
Filter logs using regex pattern
|
|
2228
|
+
|
|
2229
|
+
$ nex log --filter "message REGEX .*exception.*" --auth dev-instance
|
|
2230
|
+
|
|
2231
|
+
Filter logs by message starting with a pattern
|
|
2232
|
+
|
|
2233
|
+
$ nex log --filter "message STARTS_WITH [ERROR]" --auth dev-instance
|
|
2234
|
+
|
|
2235
|
+
Tail logs without colored output
|
|
2236
|
+
|
|
2237
|
+
$ nex log --no-color --auth dev-instance
|
|
2238
|
+
```
|
|
2239
|
+
|
|
2240
|
+
_See code: [src/commands/log/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/log/index.ts)_
|
|
2241
|
+
|
|
2242
|
+
## `nex plugins`
|
|
2243
|
+
|
|
2244
|
+
List installed plugins.
|
|
2245
|
+
|
|
2246
|
+
```
|
|
2247
|
+
USAGE
|
|
2248
|
+
$ nex plugins [--json] [--core]
|
|
2249
|
+
|
|
2250
|
+
FLAGS
|
|
2251
|
+
--core Show core plugins.
|
|
2252
|
+
|
|
2253
|
+
GLOBAL FLAGS
|
|
2254
|
+
--json Format output as json.
|
|
2255
|
+
|
|
2256
|
+
DESCRIPTION
|
|
2257
|
+
List installed plugins.
|
|
2258
|
+
|
|
2259
|
+
EXAMPLES
|
|
2260
|
+
$ nex plugins
|
|
2261
|
+
```
|
|
2262
|
+
|
|
2263
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/index.ts)_
|
|
2264
|
+
|
|
2265
|
+
## `nex plugins add PLUGIN`
|
|
2266
|
+
|
|
2267
|
+
Installs a plugin into nex.
|
|
2268
|
+
|
|
2269
|
+
```
|
|
2270
|
+
USAGE
|
|
2271
|
+
$ nex plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
2272
|
+
|
|
2273
|
+
ARGUMENTS
|
|
2274
|
+
PLUGIN... Plugin to install.
|
|
2275
|
+
|
|
2276
|
+
FLAGS
|
|
2277
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
2278
|
+
-h, --help Show CLI help.
|
|
2279
|
+
-s, --silent Silences npm output.
|
|
2280
|
+
-v, --verbose Show verbose npm output.
|
|
2281
|
+
|
|
2282
|
+
GLOBAL FLAGS
|
|
2283
|
+
--json Format output as json.
|
|
2284
|
+
|
|
2285
|
+
DESCRIPTION
|
|
2286
|
+
Installs a plugin into nex.
|
|
2287
|
+
|
|
2288
|
+
Uses npm to install plugins.
|
|
2289
|
+
|
|
2290
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
2291
|
+
|
|
2292
|
+
Use the NEX_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
2293
|
+
Use the NEX_NPM_REGISTRY environment variable to set the npm registry.
|
|
2294
|
+
|
|
2295
|
+
ALIASES
|
|
2296
|
+
$ nex plugins add
|
|
2297
|
+
|
|
2298
|
+
EXAMPLES
|
|
2299
|
+
Install a plugin from npm registry.
|
|
2300
|
+
|
|
2301
|
+
$ nex plugins add myplugin
|
|
2302
|
+
|
|
2303
|
+
Install a plugin from a github url.
|
|
2304
|
+
|
|
2305
|
+
$ nex plugins add https://github.com/someuser/someplugin
|
|
2306
|
+
|
|
2307
|
+
Install a plugin from a github slug.
|
|
2308
|
+
|
|
2309
|
+
$ nex plugins add someuser/someplugin
|
|
2310
|
+
```
|
|
2311
|
+
|
|
2312
|
+
## `nex plugins:inspect PLUGIN...`
|
|
2313
|
+
|
|
2314
|
+
Displays installation properties of a plugin.
|
|
2315
|
+
|
|
2316
|
+
```
|
|
2317
|
+
USAGE
|
|
2318
|
+
$ nex plugins inspect PLUGIN...
|
|
2319
|
+
|
|
2320
|
+
ARGUMENTS
|
|
2321
|
+
PLUGIN... [default: .] Plugin to inspect.
|
|
2322
|
+
|
|
2323
|
+
FLAGS
|
|
2324
|
+
-h, --help Show CLI help.
|
|
2325
|
+
-v, --verbose
|
|
2326
|
+
|
|
2327
|
+
GLOBAL FLAGS
|
|
2328
|
+
--json Format output as json.
|
|
2329
|
+
|
|
2330
|
+
DESCRIPTION
|
|
2331
|
+
Displays installation properties of a plugin.
|
|
2332
|
+
|
|
2333
|
+
EXAMPLES
|
|
2334
|
+
$ nex plugins inspect myplugin
|
|
2335
|
+
```
|
|
2336
|
+
|
|
2337
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/inspect.ts)_
|
|
2338
|
+
|
|
2339
|
+
## `nex plugins install PLUGIN`
|
|
2340
|
+
|
|
2341
|
+
Installs a plugin into nex.
|
|
2342
|
+
|
|
2343
|
+
```
|
|
2344
|
+
USAGE
|
|
2345
|
+
$ nex plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
2346
|
+
|
|
2347
|
+
ARGUMENTS
|
|
2348
|
+
PLUGIN... Plugin to install.
|
|
2349
|
+
|
|
2350
|
+
FLAGS
|
|
2351
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
2352
|
+
-h, --help Show CLI help.
|
|
2353
|
+
-s, --silent Silences npm output.
|
|
2354
|
+
-v, --verbose Show verbose npm output.
|
|
2355
|
+
|
|
2356
|
+
GLOBAL FLAGS
|
|
2357
|
+
--json Format output as json.
|
|
2358
|
+
|
|
2359
|
+
DESCRIPTION
|
|
2360
|
+
Installs a plugin into nex.
|
|
2361
|
+
|
|
2362
|
+
Uses npm to install plugins.
|
|
2363
|
+
|
|
2364
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
2365
|
+
|
|
2366
|
+
Use the NEX_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
2367
|
+
Use the NEX_NPM_REGISTRY environment variable to set the npm registry.
|
|
2368
|
+
|
|
2369
|
+
ALIASES
|
|
2370
|
+
$ nex plugins add
|
|
2371
|
+
|
|
2372
|
+
EXAMPLES
|
|
2373
|
+
Install a plugin from npm registry.
|
|
2374
|
+
|
|
2375
|
+
$ nex plugins install myplugin
|
|
2376
|
+
|
|
2377
|
+
Install a plugin from a github url.
|
|
2378
|
+
|
|
2379
|
+
$ nex plugins install https://github.com/someuser/someplugin
|
|
2380
|
+
|
|
2381
|
+
Install a plugin from a github slug.
|
|
2382
|
+
|
|
2383
|
+
$ nex plugins install someuser/someplugin
|
|
2384
|
+
```
|
|
2385
|
+
|
|
2386
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/install.ts)_
|
|
2387
|
+
|
|
2388
|
+
## `nex plugins link PATH`
|
|
2389
|
+
|
|
2390
|
+
Links a plugin into the CLI for development.
|
|
2391
|
+
|
|
2392
|
+
```
|
|
2393
|
+
USAGE
|
|
2394
|
+
$ nex plugins link PATH [-h] [--install] [-v]
|
|
2395
|
+
|
|
2396
|
+
ARGUMENTS
|
|
2397
|
+
PATH [default: .] path to plugin
|
|
2398
|
+
|
|
2399
|
+
FLAGS
|
|
2400
|
+
-h, --help Show CLI help.
|
|
2401
|
+
-v, --verbose
|
|
2402
|
+
--[no-]install Install dependencies after linking the plugin.
|
|
2403
|
+
|
|
2404
|
+
DESCRIPTION
|
|
2405
|
+
Links a plugin into the CLI for development.
|
|
2406
|
+
|
|
2407
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
2408
|
+
|
|
2409
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
2410
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
EXAMPLES
|
|
2414
|
+
$ nex plugins link myplugin
|
|
2415
|
+
```
|
|
2416
|
+
|
|
2417
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/link.ts)_
|
|
2418
|
+
|
|
2419
|
+
## `nex plugins remove [PLUGIN]`
|
|
2420
|
+
|
|
2421
|
+
Removes a plugin from the CLI.
|
|
2422
|
+
|
|
2423
|
+
```
|
|
2424
|
+
USAGE
|
|
2425
|
+
$ nex plugins remove [PLUGIN...] [-h] [-v]
|
|
2426
|
+
|
|
2427
|
+
ARGUMENTS
|
|
2428
|
+
[PLUGIN...] plugin to uninstall
|
|
2429
|
+
|
|
2430
|
+
FLAGS
|
|
2431
|
+
-h, --help Show CLI help.
|
|
2432
|
+
-v, --verbose
|
|
2433
|
+
|
|
2434
|
+
DESCRIPTION
|
|
2435
|
+
Removes a plugin from the CLI.
|
|
2436
|
+
|
|
2437
|
+
ALIASES
|
|
2438
|
+
$ nex plugins unlink
|
|
2439
|
+
$ nex plugins remove
|
|
2440
|
+
|
|
2441
|
+
EXAMPLES
|
|
2442
|
+
$ nex plugins remove myplugin
|
|
2443
|
+
```
|
|
2444
|
+
|
|
2445
|
+
## `nex plugins reset`
|
|
2446
|
+
|
|
2447
|
+
Remove all user-installed and linked plugins.
|
|
2448
|
+
|
|
2449
|
+
```
|
|
2450
|
+
USAGE
|
|
2451
|
+
$ nex plugins reset [--hard] [--reinstall]
|
|
2452
|
+
|
|
2453
|
+
FLAGS
|
|
2454
|
+
--hard Delete node_modules and package manager related files in addition to uninstalling plugins.
|
|
2455
|
+
--reinstall Reinstall all plugins after uninstalling.
|
|
2456
|
+
```
|
|
2457
|
+
|
|
2458
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/reset.ts)_
|
|
2459
|
+
|
|
2460
|
+
## `nex plugins uninstall [PLUGIN]`
|
|
2461
|
+
|
|
2462
|
+
Removes a plugin from the CLI.
|
|
2463
|
+
|
|
2464
|
+
```
|
|
2465
|
+
USAGE
|
|
2466
|
+
$ nex plugins uninstall [PLUGIN...] [-h] [-v]
|
|
2467
|
+
|
|
2468
|
+
ARGUMENTS
|
|
2469
|
+
[PLUGIN...] plugin to uninstall
|
|
2470
|
+
|
|
2471
|
+
FLAGS
|
|
2472
|
+
-h, --help Show CLI help.
|
|
2473
|
+
-v, --verbose
|
|
2474
|
+
|
|
2475
|
+
DESCRIPTION
|
|
2476
|
+
Removes a plugin from the CLI.
|
|
2477
|
+
|
|
2478
|
+
ALIASES
|
|
2479
|
+
$ nex plugins unlink
|
|
2480
|
+
$ nex plugins remove
|
|
2481
|
+
|
|
2482
|
+
EXAMPLES
|
|
2483
|
+
$ nex plugins uninstall myplugin
|
|
2484
|
+
```
|
|
2485
|
+
|
|
2486
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/uninstall.ts)_
|
|
2487
|
+
|
|
2488
|
+
## `nex plugins unlink [PLUGIN]`
|
|
2489
|
+
|
|
2490
|
+
Removes a plugin from the CLI.
|
|
2491
|
+
|
|
2492
|
+
```
|
|
2493
|
+
USAGE
|
|
2494
|
+
$ nex plugins unlink [PLUGIN...] [-h] [-v]
|
|
2495
|
+
|
|
2496
|
+
ARGUMENTS
|
|
2497
|
+
[PLUGIN...] plugin to uninstall
|
|
2498
|
+
|
|
2499
|
+
FLAGS
|
|
2500
|
+
-h, --help Show CLI help.
|
|
2501
|
+
-v, --verbose
|
|
2502
|
+
|
|
2503
|
+
DESCRIPTION
|
|
2504
|
+
Removes a plugin from the CLI.
|
|
2505
|
+
|
|
2506
|
+
ALIASES
|
|
2507
|
+
$ nex plugins unlink
|
|
2508
|
+
$ nex plugins remove
|
|
2509
|
+
|
|
2510
|
+
EXAMPLES
|
|
2511
|
+
$ nex plugins unlink myplugin
|
|
2512
|
+
```
|
|
2513
|
+
|
|
2514
|
+
## `nex plugins update`
|
|
2515
|
+
|
|
2516
|
+
Update installed plugins.
|
|
2517
|
+
|
|
2518
|
+
```
|
|
2519
|
+
USAGE
|
|
2520
|
+
$ nex plugins update [-h] [-v]
|
|
2521
|
+
|
|
2522
|
+
FLAGS
|
|
2523
|
+
-h, --help Show CLI help.
|
|
2524
|
+
-v, --verbose
|
|
2525
|
+
|
|
2526
|
+
DESCRIPTION
|
|
2527
|
+
Update installed plugins.
|
|
2528
|
+
```
|
|
2529
|
+
|
|
2530
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.4.58/src/commands/plugins/update.ts)_
|
|
2531
|
+
|
|
2532
|
+
## `nex query`
|
|
2533
|
+
|
|
2534
|
+
Query any ServiceNow table using the Table API.
|
|
2535
|
+
|
|
2536
|
+
```
|
|
2537
|
+
USAGE
|
|
2538
|
+
$ nex query -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-q <value>] [-f
|
|
2539
|
+
<value>] [-d] [-l <value>]
|
|
2540
|
+
|
|
2541
|
+
FLAGS
|
|
2542
|
+
-a, --auth=<value> Auth alias to use.
|
|
2543
|
+
-d, --display-value Return display values instead of internal values
|
|
2544
|
+
-f, --fields=<value> Comma-separated list of fields to return
|
|
2545
|
+
-j, --json Output results as JSON
|
|
2546
|
+
-l, --limit=<value> [default: 20] Maximum number of records to return
|
|
2547
|
+
-q, --query=<value> ServiceNow encoded query string
|
|
2548
|
+
-t, --table=<value> (required) ServiceNow table name to query
|
|
2549
|
+
|
|
2550
|
+
GLOBAL FLAGS
|
|
2551
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2552
|
+
<options: debug|warn|error|info|trace>
|
|
2553
|
+
|
|
2554
|
+
DESCRIPTION
|
|
2555
|
+
Query any ServiceNow table using the Table API.
|
|
2556
|
+
|
|
2557
|
+
Retrieve records from any table with support for encoded queries, field selection, display values, and configurable
|
|
2558
|
+
limits.
|
|
2559
|
+
|
|
2560
|
+
Features:
|
|
2561
|
+
• Query any table with encoded query strings
|
|
2562
|
+
• Select specific fields to return
|
|
2563
|
+
• Toggle display values vs. internal values
|
|
2564
|
+
• Configurable record limit
|
|
2565
|
+
• JSON output for scripting and CI/CD
|
|
2566
|
+
|
|
2567
|
+
EXAMPLES
|
|
2568
|
+
Query active incidents
|
|
2569
|
+
|
|
2570
|
+
$ nex query --table incident --query "active=true" --limit 10 --auth dev
|
|
2571
|
+
|
|
2572
|
+
Query with specific fields and display values
|
|
2573
|
+
|
|
2574
|
+
$ nex query --table incident --query "priority=1" --fields "number,short_description,state" --display-value \
|
|
2575
|
+
--auth dev
|
|
2576
|
+
|
|
2577
|
+
Query as JSON output
|
|
2578
|
+
|
|
2579
|
+
$ nex query --table sys_user --query "active=true" --limit 5 --json --auth dev
|
|
2580
|
+
```
|
|
2581
|
+
|
|
2582
|
+
_See code: [src/commands/query/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/query/index.ts)_
|
|
2583
|
+
|
|
2584
|
+
## `nex query app`
|
|
2585
|
+
|
|
2586
|
+
Search for applications by name across scoped apps and plugins.
|
|
2587
|
+
|
|
2588
|
+
```
|
|
2589
|
+
USAGE
|
|
2590
|
+
$ nex query app -s <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-a] [-l <value>]
|
|
2591
|
+
|
|
2592
|
+
FLAGS
|
|
2593
|
+
-a, --active Only show active applications
|
|
2594
|
+
-a, --auth=<value> Auth alias to use.
|
|
2595
|
+
-j, --json Output results as JSON
|
|
2596
|
+
-l, --limit=<value> [default: 20] Maximum number of results to return
|
|
2597
|
+
-s, --search=<value> (required) Application name search term
|
|
2598
|
+
|
|
2599
|
+
GLOBAL FLAGS
|
|
2600
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2601
|
+
<options: debug|warn|error|info|trace>
|
|
2602
|
+
|
|
2603
|
+
DESCRIPTION
|
|
2604
|
+
Search for applications by name across scoped apps and plugins.
|
|
2605
|
+
|
|
2606
|
+
Searches the sys_scope table for applications matching the provided search term.
|
|
2607
|
+
|
|
2608
|
+
Features:
|
|
2609
|
+
• Search by name (case-insensitive contains)
|
|
2610
|
+
• Filter active/inactive applications
|
|
2611
|
+
• Configurable result limit
|
|
2612
|
+
• JSON output for scripting
|
|
2613
|
+
|
|
2614
|
+
EXAMPLES
|
|
2615
|
+
Search for ITSM applications
|
|
2616
|
+
|
|
2617
|
+
$ nex query app --search "ITSM" --auth dev
|
|
2618
|
+
|
|
2619
|
+
Search active apps only
|
|
2620
|
+
|
|
2621
|
+
$ nex query app --search "HR" --active --auth dev
|
|
2622
|
+
```
|
|
2623
|
+
|
|
2624
|
+
_See code: [src/commands/query/app.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/query/app.ts)_
|
|
2625
|
+
|
|
2626
|
+
## `nex query columns`
|
|
2627
|
+
|
|
2628
|
+
List and search columns (fields) on a ServiceNow table.
|
|
2629
|
+
|
|
2630
|
+
```
|
|
2631
|
+
USAGE
|
|
2632
|
+
$ nex query columns -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-s <value>]
|
|
2633
|
+
|
|
2634
|
+
FLAGS
|
|
2635
|
+
-a, --auth=<value> Auth alias to use.
|
|
2636
|
+
-j, --json Output results as JSON
|
|
2637
|
+
-s, --search=<value> Filter columns by name or label (case-insensitive)
|
|
2638
|
+
-t, --table=<value> (required) ServiceNow table name to list columns for
|
|
2639
|
+
|
|
2640
|
+
GLOBAL FLAGS
|
|
2641
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2642
|
+
<options: debug|warn|error|info|trace>
|
|
2643
|
+
|
|
2644
|
+
DESCRIPTION
|
|
2645
|
+
List and search columns (fields) on a ServiceNow table.
|
|
2646
|
+
|
|
2647
|
+
Retrieves all field definitions for a table from the sys_dictionary, with optional name/label filtering.
|
|
2648
|
+
|
|
2649
|
+
Features:
|
|
2650
|
+
• List all fields with types, lengths, and constraints
|
|
2651
|
+
• Search/filter fields by name or label
|
|
2652
|
+
• JSON output for scripting
|
|
2653
|
+
|
|
2654
|
+
EXAMPLES
|
|
2655
|
+
List all columns on the incident table
|
|
2656
|
+
|
|
2657
|
+
$ nex query columns --table incident --auth dev
|
|
2658
|
+
|
|
2659
|
+
Search for date-related columns
|
|
2660
|
+
|
|
2661
|
+
$ nex query columns --table incident --search "date" --auth dev
|
|
2662
|
+
|
|
2663
|
+
List columns as JSON
|
|
2664
|
+
|
|
2665
|
+
$ nex query columns --table incident --json --auth dev
|
|
2666
|
+
```
|
|
2667
|
+
|
|
2668
|
+
_See code: [src/commands/query/columns.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/query/columns.ts)_
|
|
2669
|
+
|
|
2670
|
+
## `nex query syslog`
|
|
2671
|
+
|
|
2672
|
+
Query ServiceNow system logs (one-shot, non-tailing).
|
|
2673
|
+
|
|
2674
|
+
```
|
|
2675
|
+
USAGE
|
|
2676
|
+
$ nex query syslog [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-q <value>] [-l <value>]
|
|
2677
|
+
|
|
2678
|
+
FLAGS
|
|
2679
|
+
-a, --auth=<value> Auth alias to use.
|
|
2680
|
+
-j, --json Output results as JSON
|
|
2681
|
+
-l, --limit=<value> [default: 100] Maximum number of syslog records to return
|
|
2682
|
+
-q, --query=<value> ServiceNow encoded query string for filtering syslog records
|
|
2683
|
+
|
|
2684
|
+
GLOBAL FLAGS
|
|
2685
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2686
|
+
<options: debug|warn|error|info|trace>
|
|
2687
|
+
|
|
2688
|
+
DESCRIPTION
|
|
2689
|
+
Query ServiceNow system logs (one-shot, non-tailing).
|
|
2690
|
+
|
|
2691
|
+
Retrieves syslog records with optional encoded query filtering and configurable limits. For real-time log tailing, use
|
|
2692
|
+
the "log tail" command instead.
|
|
2693
|
+
|
|
2694
|
+
Features:
|
|
2695
|
+
• Query syslog with encoded query strings
|
|
2696
|
+
• Configurable record limit
|
|
2697
|
+
• Formatted table output with timestamps, levels, and sources
|
|
2698
|
+
• JSON output for scripting
|
|
2699
|
+
|
|
2700
|
+
EXAMPLES
|
|
2701
|
+
Query recent error logs
|
|
2702
|
+
|
|
2703
|
+
$ nex query syslog --query "level=2" --limit 20 --auth dev
|
|
2704
|
+
|
|
2705
|
+
Query all recent syslog entries
|
|
2706
|
+
|
|
2707
|
+
$ nex query syslog --limit 50 --auth dev
|
|
2708
|
+
|
|
2709
|
+
Query syslog as JSON
|
|
2710
|
+
|
|
2711
|
+
$ nex query syslog --query "sourceLIKEincident" --json --auth dev
|
|
2712
|
+
```
|
|
2713
|
+
|
|
2714
|
+
_See code: [src/commands/query/syslog.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/query/syslog.ts)_
|
|
2715
|
+
|
|
2716
|
+
## `nex schema`
|
|
2717
|
+
|
|
2718
|
+
Discover and inspect a ServiceNow table schema including fields, types, and relationships.
|
|
2719
|
+
|
|
2720
|
+
```
|
|
2721
|
+
USAGE
|
|
2722
|
+
$ nex schema -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [--include-choices]
|
|
2723
|
+
[--include-relationships] [--include-ui-policies] [--include-business-rules]
|
|
2724
|
+
|
|
2725
|
+
FLAGS
|
|
2726
|
+
-a, --auth=<value> Auth alias to use.
|
|
2727
|
+
-j, --json Output results as JSON
|
|
2728
|
+
-t, --table=<value> (required) ServiceNow table name to discover schema for
|
|
2729
|
+
--include-business-rules Include business rules in the schema output
|
|
2730
|
+
--include-choices Include field choices in the schema output
|
|
2731
|
+
--include-relationships Include table relationships in the schema output
|
|
2732
|
+
--include-ui-policies Include UI policies in the schema output
|
|
2733
|
+
|
|
2734
|
+
GLOBAL FLAGS
|
|
2735
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2736
|
+
<options: debug|warn|error|info|trace>
|
|
2737
|
+
|
|
2738
|
+
DESCRIPTION
|
|
2739
|
+
Discover and inspect a ServiceNow table schema including fields, types, and relationships.
|
|
2740
|
+
|
|
2741
|
+
This command retrieves the full schema definition for a ServiceNow table, including all fields, their types,
|
|
2742
|
+
constraints, and optionally choices, relationships, UI policies, and business rules.
|
|
2743
|
+
|
|
2744
|
+
Features:
|
|
2745
|
+
• List all fields with types, lengths, and constraints
|
|
2746
|
+
• Optionally include field choices
|
|
2747
|
+
• Optionally include table relationships
|
|
2748
|
+
• Optionally include UI policies
|
|
2749
|
+
• Optionally include business rules
|
|
2750
|
+
• JSON output for CI/CD integration
|
|
2751
|
+
|
|
2752
|
+
EXAMPLES
|
|
2753
|
+
Discover incident table schema
|
|
2754
|
+
|
|
2755
|
+
$ nex schema --table incident --auth dev
|
|
2756
|
+
|
|
2757
|
+
Include choices and relationships
|
|
2758
|
+
|
|
2759
|
+
$ nex schema --table incident --include-choices --include-relationships --auth dev
|
|
2760
|
+
```
|
|
2761
|
+
|
|
2762
|
+
_See code: [src/commands/schema/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/schema/index.ts)_
|
|
2763
|
+
|
|
2764
|
+
## `nex schema field`
|
|
2765
|
+
|
|
2766
|
+
Get detailed information about a specific field on a ServiceNow table.
|
|
2767
|
+
|
|
2768
|
+
```
|
|
2769
|
+
USAGE
|
|
2770
|
+
$ nex schema field -t <value> -f <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
2771
|
+
|
|
2772
|
+
FLAGS
|
|
2773
|
+
-a, --auth=<value> Auth alias to use.
|
|
2774
|
+
-f, --field=<value> (required) Field name to explain
|
|
2775
|
+
-j, --json Output results as JSON
|
|
2776
|
+
-t, --table=<value> (required) ServiceNow table name
|
|
2777
|
+
|
|
2778
|
+
GLOBAL FLAGS
|
|
2779
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2780
|
+
<options: debug|warn|error|info|trace>
|
|
2781
|
+
|
|
2782
|
+
DESCRIPTION
|
|
2783
|
+
Get detailed information about a specific field on a ServiceNow table.
|
|
2784
|
+
|
|
2785
|
+
This command retrieves comprehensive details about a single field, including its type, constraints, choices, and other
|
|
2786
|
+
metadata. Useful for understanding field definitions during development.
|
|
2787
|
+
|
|
2788
|
+
EXAMPLES
|
|
2789
|
+
Explain the state field on incident table
|
|
2790
|
+
|
|
2791
|
+
$ nex schema field --table incident --field state --auth dev
|
|
2792
|
+
|
|
2793
|
+
Explain the priority field on incident table with JSON output
|
|
2794
|
+
|
|
2795
|
+
$ nex schema field --table incident --field priority --json --auth dev
|
|
2796
|
+
```
|
|
2797
|
+
|
|
2798
|
+
_See code: [src/commands/schema/field.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/schema/field.ts)_
|
|
2799
|
+
|
|
2800
|
+
## `nex schema validate-catalog`
|
|
2801
|
+
|
|
2802
|
+
Validate a ServiceNow catalog item configuration for common issues.
|
|
2803
|
+
|
|
2804
|
+
```
|
|
2805
|
+
USAGE
|
|
2806
|
+
$ nex schema validate-catalog -s <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
2807
|
+
|
|
2808
|
+
FLAGS
|
|
2809
|
+
-a, --auth=<value> Auth alias to use.
|
|
2810
|
+
-j, --json Output results as JSON
|
|
2811
|
+
-s, --sys-id=<value> (required) Catalog item sys_id to validate
|
|
2812
|
+
|
|
2813
|
+
GLOBAL FLAGS
|
|
2814
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2815
|
+
<options: debug|warn|error|info|trace>
|
|
2816
|
+
|
|
2817
|
+
DESCRIPTION
|
|
2818
|
+
Validate a ServiceNow catalog item configuration for common issues.
|
|
2819
|
+
|
|
2820
|
+
This command checks a catalog item configuration and reports any validation issues, warnings, or errors found. Useful
|
|
2821
|
+
for ensuring catalog items are properly configured before deployment.
|
|
2822
|
+
|
|
2823
|
+
EXAMPLES
|
|
2824
|
+
Validate a catalog item by sys_id
|
|
2825
|
+
|
|
2826
|
+
$ nex schema validate-catalog --sys-id a1b2c3d4e5f6 --auth dev
|
|
2827
|
+
|
|
2828
|
+
Validate a catalog item with JSON output
|
|
2829
|
+
|
|
2830
|
+
$ nex schema validate-catalog --sys-id a1b2c3d4e5f6 --json --auth dev
|
|
2831
|
+
```
|
|
2832
|
+
|
|
2833
|
+
_See code: [src/commands/schema/validate-catalog.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/schema/validate-catalog.ts)_
|
|
2834
|
+
|
|
2835
|
+
## `nex scope`
|
|
2836
|
+
|
|
2837
|
+
Get the current application scope or list available applications.
|
|
2838
|
+
|
|
2839
|
+
```
|
|
2840
|
+
USAGE
|
|
2841
|
+
$ nex scope [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-l]
|
|
2842
|
+
|
|
2843
|
+
FLAGS
|
|
2844
|
+
-a, --auth=<value> Auth alias to use.
|
|
2845
|
+
-l, --list List all available applications
|
|
2846
|
+
|
|
2847
|
+
GLOBAL FLAGS
|
|
2848
|
+
--json Format output as json.
|
|
2849
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2850
|
+
<options: debug|warn|error|info|trace>
|
|
2851
|
+
|
|
2852
|
+
DESCRIPTION
|
|
2853
|
+
Get the current application scope or list available applications.
|
|
2854
|
+
|
|
2855
|
+
EXAMPLES
|
|
2856
|
+
Get the current application scope
|
|
2857
|
+
|
|
2858
|
+
$ nex scope --auth dev
|
|
2859
|
+
|
|
2860
|
+
List all available applications
|
|
2861
|
+
|
|
2862
|
+
$ nex scope --list --auth dev
|
|
2863
|
+
|
|
2864
|
+
List applications as JSON
|
|
2865
|
+
|
|
2866
|
+
$ nex scope -l --json --auth dev
|
|
2867
|
+
```
|
|
2868
|
+
|
|
2869
|
+
_See code: [src/commands/scope/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/scope/index.ts)_
|
|
2870
|
+
|
|
2871
|
+
## `nex scope set`
|
|
2872
|
+
|
|
2873
|
+
Set the current application scope on a ServiceNow instance.
|
|
2874
|
+
|
|
2875
|
+
```
|
|
2876
|
+
USAGE
|
|
2877
|
+
$ nex scope set -a <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
2878
|
+
|
|
2879
|
+
FLAGS
|
|
2880
|
+
-a, --app-id=<value> (required) 32-char sys_id of application
|
|
2881
|
+
-a, --auth=<value> Auth alias to use.
|
|
2882
|
+
|
|
2883
|
+
GLOBAL FLAGS
|
|
2884
|
+
--json Format output as json.
|
|
2885
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2886
|
+
<options: debug|warn|error|info|trace>
|
|
2887
|
+
|
|
2888
|
+
DESCRIPTION
|
|
2889
|
+
Set the current application scope on a ServiceNow instance.
|
|
2890
|
+
|
|
2891
|
+
EXAMPLES
|
|
2892
|
+
Set application scope by sys_id
|
|
2893
|
+
|
|
2894
|
+
$ nex scope set --app-id abc123def456ghi789jkl012mno345pq --auth dev
|
|
2895
|
+
|
|
2896
|
+
Set application scope and output as JSON
|
|
2897
|
+
|
|
2898
|
+
$ nex scope set -a abc123def456ghi789jkl012mno345pq --json --auth dev
|
|
2899
|
+
```
|
|
2900
|
+
|
|
2901
|
+
_See code: [src/commands/scope/set.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/scope/set.ts)_
|
|
2902
|
+
|
|
2903
|
+
## `nex script-sync pull`
|
|
2904
|
+
|
|
2905
|
+
Pull a script from a ServiceNow instance to a local file.
|
|
2906
|
+
|
|
2907
|
+
```
|
|
2908
|
+
USAGE
|
|
2909
|
+
$ nex script-sync pull -n <value> -t sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client
|
|
2910
|
+
[--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-o <value>]
|
|
2911
|
+
|
|
2912
|
+
FLAGS
|
|
2913
|
+
-a, --auth=<value> Auth alias to use.
|
|
2914
|
+
-n, --name=<value> (required) Name of the script to pull
|
|
2915
|
+
-o, --output=<value> Output file path. If not specified, a file name is auto-generated.
|
|
2916
|
+
-t, --type=<option> (required) Type of script to pull
|
|
2917
|
+
<options: sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client>
|
|
2918
|
+
|
|
2919
|
+
GLOBAL FLAGS
|
|
2920
|
+
--json Format output as json.
|
|
2921
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2922
|
+
<options: debug|warn|error|info|trace>
|
|
2923
|
+
|
|
2924
|
+
DESCRIPTION
|
|
2925
|
+
Pull a script from a ServiceNow instance to a local file.
|
|
2926
|
+
|
|
2927
|
+
This command downloads a script record from your ServiceNow instance and saves it as a local file. Supports multiple
|
|
2928
|
+
script types including Script Includes, Business Rules, UI Scripts, UI Actions, and Client Scripts.
|
|
2929
|
+
|
|
2930
|
+
Features:
|
|
2931
|
+
• Download scripts by name and type
|
|
2932
|
+
• Custom output file path support
|
|
2933
|
+
• Auto-generated file names based on script name and type
|
|
2934
|
+
• JSON output for CI/CD integration
|
|
2935
|
+
|
|
2936
|
+
EXAMPLES
|
|
2937
|
+
Pull a Script Include to auto-generated file name
|
|
2938
|
+
|
|
2939
|
+
$ nex script-sync pull --name MyScriptInclude --type sys_script_include --auth dev-instance
|
|
2940
|
+
|
|
2941
|
+
Pull a Business Rule to a specific file
|
|
2942
|
+
|
|
2943
|
+
$ nex script-sync pull --name MyBusinessRule --type sys_script --output ./scripts/my-rule.js --auth dev-instance
|
|
2944
|
+
|
|
2945
|
+
Pull a Client Script with JSON output
|
|
2946
|
+
|
|
2947
|
+
$ nex script-sync pull -n MyClientScript -t sys_script_client --json --auth dev-instance
|
|
2948
|
+
```
|
|
2949
|
+
|
|
2950
|
+
_See code: [src/commands/script-sync/pull.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/script-sync/pull.ts)_
|
|
2951
|
+
|
|
2952
|
+
## `nex script-sync push`
|
|
2953
|
+
|
|
2954
|
+
Push a local script file to a ServiceNow instance.
|
|
2955
|
+
|
|
2956
|
+
```
|
|
2957
|
+
USAGE
|
|
2958
|
+
$ nex script-sync push -n <value> -t sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client -f
|
|
2959
|
+
<value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
2960
|
+
|
|
2961
|
+
FLAGS
|
|
2962
|
+
-a, --auth=<value> Auth alias to use.
|
|
2963
|
+
-f, --file=<value> (required) Path to the local script file to push
|
|
2964
|
+
-n, --name=<value> (required) Name of the script to push
|
|
2965
|
+
-t, --type=<option> (required) Type of script to push
|
|
2966
|
+
<options: sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client>
|
|
2967
|
+
|
|
2968
|
+
GLOBAL FLAGS
|
|
2969
|
+
--json Format output as json.
|
|
2970
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
2971
|
+
<options: debug|warn|error|info|trace>
|
|
2972
|
+
|
|
2973
|
+
DESCRIPTION
|
|
2974
|
+
Push a local script file to a ServiceNow instance.
|
|
2975
|
+
|
|
2976
|
+
This command uploads a local script file to your ServiceNow instance, updating the corresponding script record.
|
|
2977
|
+
Supports multiple script types including Script Includes, Business Rules, UI Scripts, UI Actions, and Client Scripts.
|
|
2978
|
+
|
|
2979
|
+
Features:
|
|
2980
|
+
• Upload scripts by name and type
|
|
2981
|
+
• Specify the local file to push
|
|
2982
|
+
• JSON output for CI/CD integration
|
|
2983
|
+
• Detailed push result reporting
|
|
2984
|
+
|
|
2985
|
+
EXAMPLES
|
|
2986
|
+
Push a Script Include from a local file
|
|
2987
|
+
|
|
2988
|
+
$ nex script-sync push --name MyScriptInclude --type sys_script_include --file ./scripts/MyScriptInclude.js \
|
|
2989
|
+
--auth dev-instance
|
|
2990
|
+
|
|
2991
|
+
Push a Business Rule with short flags
|
|
2992
|
+
|
|
2993
|
+
$ nex script-sync push -n MyBusinessRule -t sys_script -f ./scripts/my-rule.js -a dev-instance
|
|
2994
|
+
|
|
2995
|
+
Push a UI Script with JSON output
|
|
2996
|
+
|
|
2997
|
+
$ nex script-sync push -n MyUIScript -t sys_ui_script -f ./scripts/ui-script.js --json --auth dev-instance
|
|
2998
|
+
```
|
|
2999
|
+
|
|
3000
|
+
_See code: [src/commands/script-sync/push.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/script-sync/push.ts)_
|
|
3001
|
+
|
|
3002
|
+
## `nex script-sync sync`
|
|
3003
|
+
|
|
3004
|
+
Synchronize all scripts in a directory with a ServiceNow instance.
|
|
3005
|
+
|
|
3006
|
+
```
|
|
3007
|
+
USAGE
|
|
3008
|
+
$ nex script-sync sync -d <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-t
|
|
3009
|
+
sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client...]
|
|
3010
|
+
|
|
3011
|
+
FLAGS
|
|
3012
|
+
-a, --auth=<value> Auth alias to use.
|
|
3013
|
+
-d, --directory=<value> (required) Directory containing script files to synchronize
|
|
3014
|
+
-t, --types=<option>... Script types to synchronize. Can be specified multiple times to include multiple types.
|
|
3015
|
+
<options: sys_script_include|sys_script|sys_ui_script|sys_ui_action|sys_script_client>
|
|
3016
|
+
|
|
3017
|
+
GLOBAL FLAGS
|
|
3018
|
+
--json Format output as json.
|
|
3019
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3020
|
+
<options: debug|warn|error|info|trace>
|
|
3021
|
+
|
|
3022
|
+
DESCRIPTION
|
|
3023
|
+
Synchronize all scripts in a directory with a ServiceNow instance.
|
|
3024
|
+
|
|
3025
|
+
This command scans a local directory for script files and synchronizes them with the corresponding records on your
|
|
3026
|
+
ServiceNow instance. You can optionally filter by script types to synchronize only specific kinds of scripts.
|
|
3027
|
+
|
|
3028
|
+
Features:
|
|
3029
|
+
• Batch synchronization of all scripts in a directory
|
|
3030
|
+
• Filter by one or more script types
|
|
3031
|
+
• Summary report with success/failure counts
|
|
3032
|
+
• JSON output for CI/CD integration
|
|
3033
|
+
|
|
3034
|
+
EXAMPLES
|
|
3035
|
+
Sync all scripts in a directory
|
|
3036
|
+
|
|
3037
|
+
$ nex script-sync sync --directory ./scripts --auth dev-instance
|
|
3038
|
+
|
|
3039
|
+
Sync only Script Includes and Business Rules
|
|
3040
|
+
|
|
3041
|
+
$ nex script-sync sync --directory ./scripts --types sys_script_include --types sys_script --auth dev-instance
|
|
3042
|
+
|
|
3043
|
+
Sync with JSON output for CI/CD
|
|
3044
|
+
|
|
3045
|
+
$ nex script-sync sync -d ./scripts --json --auth dev-instance
|
|
3046
|
+
```
|
|
3047
|
+
|
|
3048
|
+
_See code: [src/commands/script-sync/sync.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/script-sync/sync.ts)_
|
|
3049
|
+
|
|
3050
|
+
## `nex search`
|
|
3051
|
+
|
|
3052
|
+
Search platform code across a ServiceNow instance.
|
|
3053
|
+
|
|
3054
|
+
```
|
|
3055
|
+
USAGE
|
|
3056
|
+
$ nex search -t <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-l <value>] [-s
|
|
3057
|
+
<value>] [-g <value>] [--table <value>]
|
|
3058
|
+
|
|
3059
|
+
FLAGS
|
|
3060
|
+
-a, --auth=<value> Auth alias to use.
|
|
3061
|
+
-g, --search-group=<value> Search group to search within (required when using --table)
|
|
3062
|
+
-l, --limit=<value> Maximum number of results to return
|
|
3063
|
+
-s, --scope=<value> Application scope to search within
|
|
3064
|
+
-t, --term=<value> (required) Search term to look for in platform code
|
|
3065
|
+
--table=<value> Table name to search within (requires --search-group)
|
|
3066
|
+
|
|
3067
|
+
GLOBAL FLAGS
|
|
3068
|
+
--json Format output as json.
|
|
3069
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3070
|
+
<options: debug|warn|error|info|trace>
|
|
3071
|
+
|
|
3072
|
+
DESCRIPTION
|
|
3073
|
+
Search platform code across a ServiceNow instance.
|
|
3074
|
+
|
|
3075
|
+
This command allows you to search through code stored on the platform, including scripts, business rules, UI pages,
|
|
3076
|
+
and other scriptable records. You can search globally, within a specific application scope, or within a specific table
|
|
3077
|
+
and search group.
|
|
3078
|
+
|
|
3079
|
+
Features:
|
|
3080
|
+
• Full-text code search across the platform
|
|
3081
|
+
• Scope-specific search within application boundaries
|
|
3082
|
+
• Table-specific search within a search group
|
|
3083
|
+
• JSON output for CI/CD integration
|
|
3084
|
+
• Configurable result limits
|
|
3085
|
+
|
|
3086
|
+
EXAMPLES
|
|
3087
|
+
Search for a term across the entire instance
|
|
3088
|
+
|
|
3089
|
+
$ nex search --term "GlideRecord" --auth dev-instance
|
|
3090
|
+
|
|
3091
|
+
Search within a specific application scope
|
|
3092
|
+
|
|
3093
|
+
$ nex search --term "getValue" --scope x_my_app --auth dev-instance
|
|
3094
|
+
|
|
3095
|
+
Search within a specific table and search group
|
|
3096
|
+
|
|
3097
|
+
$ nex search --term "initialize" --search-group "Script Includes" --table sys_script_include --auth dev-instance
|
|
3098
|
+
|
|
3099
|
+
Search with a result limit and JSON output
|
|
3100
|
+
|
|
3101
|
+
$ nex search --term "GlideRecord" --limit 10 --json --auth dev-instance
|
|
3102
|
+
```
|
|
3103
|
+
|
|
3104
|
+
_See code: [src/commands/search/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/search/index.ts)_
|
|
3105
|
+
|
|
3106
|
+
## `nex search add-table`
|
|
3107
|
+
|
|
3108
|
+
Add a table to a code search group on a ServiceNow instance.
|
|
3109
|
+
|
|
3110
|
+
```
|
|
3111
|
+
USAGE
|
|
3112
|
+
$ nex search add-table -f <value> -g <value> -t <value> [--json] [-a <value>] [--log-level
|
|
3113
|
+
debug|warn|error|info|trace]
|
|
3114
|
+
|
|
3115
|
+
FLAGS
|
|
3116
|
+
-a, --auth=<value> Auth alias to use.
|
|
3117
|
+
-f, --search-fields=<value> (required) Comma-separated list of fields to index for search
|
|
3118
|
+
-g, --search-group=<value> (required) Search group to add the table to
|
|
3119
|
+
-t, --table=<value> (required) Table name to add to the search group
|
|
3120
|
+
|
|
3121
|
+
GLOBAL FLAGS
|
|
3122
|
+
--json Format output as json.
|
|
3123
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3124
|
+
<options: debug|warn|error|info|trace>
|
|
3125
|
+
|
|
3126
|
+
DESCRIPTION
|
|
3127
|
+
Add a table to a code search group on a ServiceNow instance.
|
|
3128
|
+
|
|
3129
|
+
This command registers a new table and its searchable fields with a search group, making the table's records
|
|
3130
|
+
discoverable through code search. This is useful when you need to include custom tables in code search results.
|
|
3131
|
+
|
|
3132
|
+
Features:
|
|
3133
|
+
• Add custom tables to search groups
|
|
3134
|
+
• Specify which fields should be indexed
|
|
3135
|
+
• JSON output for scripting and automation
|
|
3136
|
+
|
|
3137
|
+
EXAMPLES
|
|
3138
|
+
Add a table to a search group
|
|
3139
|
+
|
|
3140
|
+
$ nex search add-table --table sys_script_include --search-fields script --search-group "Script Includes" --auth \
|
|
3141
|
+
dev-instance
|
|
3142
|
+
|
|
3143
|
+
Add a table with multiple search fields
|
|
3144
|
+
|
|
3145
|
+
$ nex search add-table --table sys_ui_page --search-fields "html,client_script,processing_script" --search-group \
|
|
3146
|
+
"UI Pages" --auth dev-instance
|
|
3147
|
+
|
|
3148
|
+
Add a table with JSON output
|
|
3149
|
+
|
|
3150
|
+
$ nex search add-table --table u_custom_script --search-fields script --search-group "Custom" --json --auth \
|
|
3151
|
+
dev-instance
|
|
3152
|
+
```
|
|
3153
|
+
|
|
3154
|
+
_See code: [src/commands/search/add-table.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/search/add-table.ts)_
|
|
3155
|
+
|
|
3156
|
+
## `nex search groups`
|
|
3157
|
+
|
|
3158
|
+
List all available code search groups on a ServiceNow instance.
|
|
3159
|
+
|
|
3160
|
+
```
|
|
3161
|
+
USAGE
|
|
3162
|
+
$ nex search groups [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3163
|
+
|
|
3164
|
+
FLAGS
|
|
3165
|
+
-a, --auth=<value> Auth alias to use.
|
|
3166
|
+
|
|
3167
|
+
GLOBAL FLAGS
|
|
3168
|
+
--json Format output as json.
|
|
3169
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3170
|
+
<options: debug|warn|error|info|trace>
|
|
3171
|
+
|
|
3172
|
+
DESCRIPTION
|
|
3173
|
+
List all available code search groups on a ServiceNow instance.
|
|
3174
|
+
|
|
3175
|
+
Search groups organize searchable tables into logical categories. Use this command to discover which search groups are
|
|
3176
|
+
configured, then use the group names with other search commands to narrow your search scope.
|
|
3177
|
+
|
|
3178
|
+
Features:
|
|
3179
|
+
• List all configured search groups
|
|
3180
|
+
• JSON output for scripting and automation
|
|
3181
|
+
|
|
3182
|
+
EXAMPLES
|
|
3183
|
+
List all search groups
|
|
3184
|
+
|
|
3185
|
+
$ nex search groups --auth dev-instance
|
|
3186
|
+
|
|
3187
|
+
List search groups with JSON output
|
|
3188
|
+
|
|
3189
|
+
$ nex search groups --json --auth dev-instance
|
|
3190
|
+
```
|
|
3191
|
+
|
|
3192
|
+
_See code: [src/commands/search/groups.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/search/groups.ts)_
|
|
3193
|
+
|
|
3194
|
+
## `nex search tables`
|
|
3195
|
+
|
|
3196
|
+
List tables configured for a specific code search group.
|
|
3197
|
+
|
|
3198
|
+
```
|
|
3199
|
+
USAGE
|
|
3200
|
+
$ nex search tables -g <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
963
3201
|
|
|
964
3202
|
FLAGS
|
|
965
|
-
-
|
|
3203
|
+
-a, --auth=<value> Auth alias to use.
|
|
3204
|
+
-g, --search-group=<value> (required) Search group name to list tables for
|
|
3205
|
+
|
|
3206
|
+
GLOBAL FLAGS
|
|
3207
|
+
--json Format output as json.
|
|
3208
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3209
|
+
<options: debug|warn|error|info|trace>
|
|
966
3210
|
|
|
967
3211
|
DESCRIPTION
|
|
968
|
-
|
|
3212
|
+
List tables configured for a specific code search group.
|
|
3213
|
+
|
|
3214
|
+
Each search group contains one or more tables that are indexed for code search. Use this command to discover which
|
|
3215
|
+
tables belong to a search group, including the fields that are searchable on each table.
|
|
3216
|
+
|
|
3217
|
+
Features:
|
|
3218
|
+
• List all tables in a search group
|
|
3219
|
+
• View searchable fields per table
|
|
3220
|
+
• JSON output for scripting and automation
|
|
3221
|
+
|
|
3222
|
+
EXAMPLES
|
|
3223
|
+
List tables in a search group
|
|
3224
|
+
|
|
3225
|
+
$ nex search tables --search-group "Script Includes" --auth dev-instance
|
|
3226
|
+
|
|
3227
|
+
List tables with JSON output
|
|
3228
|
+
|
|
3229
|
+
$ nex search tables --search-group "Business Rules" --json --auth dev-instance
|
|
969
3230
|
```
|
|
970
3231
|
|
|
971
|
-
_See code: [
|
|
3232
|
+
_See code: [src/commands/search/tables.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/search/tables.ts)_
|
|
972
3233
|
|
|
973
|
-
## `nex
|
|
3234
|
+
## `nex store install`
|
|
974
3235
|
|
|
975
|
-
|
|
3236
|
+
Install an application from the ServiceNow Store.
|
|
976
3237
|
|
|
977
3238
|
```
|
|
978
3239
|
USAGE
|
|
979
|
-
$ nex
|
|
980
|
-
[--no-
|
|
3240
|
+
$ nex store install -a <value> -v <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3241
|
+
[--demo-data] [--no-wait] [--poll-interval <value>] [--timeout <value>]
|
|
981
3242
|
|
|
982
3243
|
FLAGS
|
|
983
|
-
-a, --
|
|
984
|
-
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
--no-color Disable colored output
|
|
3244
|
+
-a, --app-id=<value> (required) Store application sys_id
|
|
3245
|
+
-a, --auth=<value> Auth alias to use.
|
|
3246
|
+
-v, --version=<value> (required) Application version to install
|
|
3247
|
+
--demo-data Load demo data during installation
|
|
3248
|
+
--no-wait Do not wait for installation to complete
|
|
3249
|
+
--poll-interval=<value> [default: 5000] Polling interval in milliseconds
|
|
3250
|
+
--timeout=<value> [default: 1800000] Installation timeout in milliseconds
|
|
991
3251
|
|
|
992
3252
|
GLOBAL FLAGS
|
|
993
3253
|
--json Format output as json.
|
|
@@ -995,373 +3255,771 @@ GLOBAL FLAGS
|
|
|
995
3255
|
<options: debug|warn|error|info|trace>
|
|
996
3256
|
|
|
997
3257
|
DESCRIPTION
|
|
998
|
-
|
|
3258
|
+
Install an application from the ServiceNow Store.
|
|
999
3259
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
important keywords.
|
|
3260
|
+
EXAMPLES
|
|
3261
|
+
Install a store application and wait for completion
|
|
1003
3262
|
|
|
1004
|
-
|
|
1005
|
-
• Real-time log tailing (like Unix tail -f)
|
|
1006
|
-
• Powerful filtering with multiple operators (CONTAINS, REGEX, EQUALS, etc.)
|
|
1007
|
-
• Smart keyword highlighting (errors in red, warnings in yellow, etc.)
|
|
1008
|
-
• Beautiful color-coded console output with chalk
|
|
1009
|
-
• Export logs to file with automatic appending
|
|
1010
|
-
• Fast 1-second default polling interval
|
|
1011
|
-
• Timestamps and sequence numbers for each log
|
|
1012
|
-
• Graceful shutdown with Ctrl+C
|
|
1013
|
-
• Clean output without colors (--no-color flag)
|
|
3263
|
+
$ nex store install --app-id abc123 --version 1.0.0 --auth dev
|
|
1014
3264
|
|
|
1015
|
-
|
|
1016
|
-
• Error terms (error, exception, failed) - highlighted in RED
|
|
1017
|
-
• Warning terms (warn, warning, deprecated) - highlighted in YELLOW
|
|
1018
|
-
• Success terms (success, completed, done) - highlighted in GREEN
|
|
1019
|
-
• System terms (system, user, transaction) - highlighted in BLUE
|
|
3265
|
+
Install without waiting for completion
|
|
1020
3266
|
|
|
1021
|
-
|
|
1022
|
-
• Apply filters using --filter flag with syntax: "field OPERATOR value"
|
|
1023
|
-
• Supports case-sensitive and case-insensitive operations
|
|
1024
|
-
• Multiple filters are combined with AND logic
|
|
1025
|
-
• Operators: CONTAINS, CONTAINS_CI, EQUALS, EQUALS_CI, STARTS_WITH, STARTS_WITH_CI,
|
|
1026
|
-
ENDS_WITH, ENDS_WITH_CI, REGEX, NOT_CONTAINS, NOT_CONTAINS_CI, NOT_EQUALS, NOT_EQUALS_CI
|
|
3267
|
+
$ nex store install --app-id abc123 --version 1.0.0 --no-wait --auth dev
|
|
1027
3268
|
|
|
1028
|
-
|
|
1029
|
-
• Monitor logs during application development
|
|
1030
|
-
• Debug issues in real-time
|
|
1031
|
-
• Track system events during deployments
|
|
1032
|
-
• Filter logs for specific application or component
|
|
1033
|
-
• Quickly spot errors and warnings
|
|
1034
|
-
• Collect logs for analysis or audit trails
|
|
3269
|
+
Install with demo data
|
|
1035
3270
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
3271
|
+
$ nex store install -a abc123 -v 1.0.0 --demo-data --auth dev
|
|
3272
|
+
```
|
|
3273
|
+
|
|
3274
|
+
_See code: [src/commands/store/install.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/store/install.ts)_
|
|
3275
|
+
|
|
3276
|
+
## `nex store search`
|
|
3277
|
+
|
|
3278
|
+
Search for applications in the ServiceNow Store.
|
|
3279
|
+
|
|
3280
|
+
```
|
|
3281
|
+
USAGE
|
|
3282
|
+
$ nex store search [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--limit <value>] [--tab
|
|
3283
|
+
available_for_you|installed|updates] [-t <value>]
|
|
3284
|
+
|
|
3285
|
+
FLAGS
|
|
3286
|
+
-a, --auth=<value> Auth alias to use.
|
|
3287
|
+
-t, --term=<value> Search term
|
|
3288
|
+
--limit=<value> [default: 20] Maximum number of results to return
|
|
3289
|
+
--tab=<option> [default: available_for_you] Store tab context to search
|
|
3290
|
+
<options: available_for_you|installed|updates>
|
|
3291
|
+
|
|
3292
|
+
GLOBAL FLAGS
|
|
3293
|
+
--json Format output as json.
|
|
3294
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3295
|
+
<options: debug|warn|error|info|trace>
|
|
3296
|
+
|
|
3297
|
+
DESCRIPTION
|
|
3298
|
+
Search for applications in the ServiceNow Store.
|
|
1041
3299
|
|
|
1042
3300
|
EXAMPLES
|
|
1043
|
-
|
|
3301
|
+
Search for applications matching a term
|
|
1044
3302
|
|
|
1045
|
-
$ nex
|
|
3303
|
+
$ nex store search --term "ITSM" --auth dev
|
|
1046
3304
|
|
|
1047
|
-
|
|
3305
|
+
List installed applications
|
|
1048
3306
|
|
|
1049
|
-
$ nex
|
|
3307
|
+
$ nex store search --tab installed --auth dev
|
|
1050
3308
|
|
|
1051
|
-
|
|
3309
|
+
List applications with available updates
|
|
1052
3310
|
|
|
1053
|
-
$ nex
|
|
3311
|
+
$ nex store search --tab updates --limit 10 --auth dev
|
|
3312
|
+
```
|
|
1054
3313
|
|
|
1055
|
-
|
|
3314
|
+
_See code: [src/commands/store/search.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/store/search.ts)_
|
|
3315
|
+
|
|
3316
|
+
## `nex store update`
|
|
3317
|
+
|
|
3318
|
+
Update a ServiceNow Store application to a new version.
|
|
3319
|
+
|
|
3320
|
+
```
|
|
3321
|
+
USAGE
|
|
3322
|
+
$ nex store update -a <value> -v <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3323
|
+
[--no-wait] [--poll-interval <value>] [--timeout <value>]
|
|
3324
|
+
|
|
3325
|
+
FLAGS
|
|
3326
|
+
-a, --app-id=<value> (required) Store application sys_id
|
|
3327
|
+
-a, --auth=<value> Auth alias to use.
|
|
3328
|
+
-v, --version=<value> (required) Target application version
|
|
3329
|
+
--no-wait Do not wait for update to complete
|
|
3330
|
+
--poll-interval=<value> [default: 5000] Polling interval in milliseconds
|
|
3331
|
+
--timeout=<value> [default: 1800000] Update timeout in milliseconds
|
|
3332
|
+
|
|
3333
|
+
GLOBAL FLAGS
|
|
3334
|
+
--json Format output as json.
|
|
3335
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3336
|
+
<options: debug|warn|error|info|trace>
|
|
3337
|
+
|
|
3338
|
+
DESCRIPTION
|
|
3339
|
+
Update a ServiceNow Store application to a new version.
|
|
3340
|
+
|
|
3341
|
+
EXAMPLES
|
|
3342
|
+
Update a store application and wait for completion
|
|
3343
|
+
|
|
3344
|
+
$ nex store update --app-id abc123 --version 2.0.0 --auth dev
|
|
3345
|
+
|
|
3346
|
+
Update without waiting for completion
|
|
3347
|
+
|
|
3348
|
+
$ nex store update --app-id abc123 --version 2.0.0 --no-wait --auth dev
|
|
3349
|
+
|
|
3350
|
+
Update with custom timeout (1 hour)
|
|
3351
|
+
|
|
3352
|
+
$ nex store update -a abc123 -v 2.0.0 --timeout 3600000 --auth dev
|
|
3353
|
+
```
|
|
3354
|
+
|
|
3355
|
+
_See code: [src/commands/store/update.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/store/update.ts)_
|
|
3356
|
+
|
|
3357
|
+
## `nex store validate`
|
|
3358
|
+
|
|
3359
|
+
Validate a batch installation definition file.
|
|
3360
|
+
|
|
3361
|
+
```
|
|
3362
|
+
USAGE
|
|
3363
|
+
$ nex store validate -f <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3364
|
+
|
|
3365
|
+
FLAGS
|
|
3366
|
+
-a, --auth=<value> Auth alias to use.
|
|
3367
|
+
-f, --file=<value> (required) Path to batch definition JSON file
|
|
3368
|
+
|
|
3369
|
+
GLOBAL FLAGS
|
|
3370
|
+
--json Format output as json.
|
|
3371
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3372
|
+
<options: debug|warn|error|info|trace>
|
|
3373
|
+
|
|
3374
|
+
DESCRIPTION
|
|
3375
|
+
Validate a batch installation definition file.
|
|
3376
|
+
|
|
3377
|
+
EXAMPLES
|
|
3378
|
+
Validate a batch definition file
|
|
3379
|
+
|
|
3380
|
+
$ nex store validate --file ./batch-definition.json --auth dev
|
|
3381
|
+
```
|
|
3382
|
+
|
|
3383
|
+
_See code: [src/commands/store/validate.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/store/validate.ts)_
|
|
3384
|
+
|
|
3385
|
+
## `nex task approve`
|
|
3386
|
+
|
|
3387
|
+
Approve a ServiceNow change request.
|
|
3388
|
+
|
|
3389
|
+
```
|
|
3390
|
+
USAGE
|
|
3391
|
+
$ nex task approve -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-c <value>]
|
|
3392
|
+
|
|
3393
|
+
FLAGS
|
|
3394
|
+
-a, --auth=<value> Auth alias to use.
|
|
3395
|
+
-c, --comments=<value> Approval comments
|
|
3396
|
+
-n, --number=<value> (required) Change request number (e.g., CHG0010001)
|
|
3397
|
+
|
|
3398
|
+
GLOBAL FLAGS
|
|
3399
|
+
--json Format output as json.
|
|
3400
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3401
|
+
<options: debug|warn|error|info|trace>
|
|
3402
|
+
|
|
3403
|
+
DESCRIPTION
|
|
3404
|
+
Approve a ServiceNow change request.
|
|
3405
|
+
|
|
3406
|
+
This command approves a change request identified by its number. You can optionally provide approval comments.
|
|
3407
|
+
|
|
3408
|
+
Features:
|
|
3409
|
+
- Approve change requests
|
|
3410
|
+
- Optionally add approval comments
|
|
3411
|
+
- Auto-resolves change request number to sys_id
|
|
3412
|
+
|
|
3413
|
+
EXAMPLES
|
|
3414
|
+
Approve a change request
|
|
3415
|
+
|
|
3416
|
+
$ nex task approve --number CHG0010001 --auth dev
|
|
3417
|
+
|
|
3418
|
+
Approve a change request with comments
|
|
3419
|
+
|
|
3420
|
+
$ nex task approve -n CHG0010001 -c "Looks good, approved" --auth dev
|
|
3421
|
+
```
|
|
3422
|
+
|
|
3423
|
+
_See code: [src/commands/task/approve.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/approve.ts)_
|
|
3424
|
+
|
|
3425
|
+
## `nex task assign`
|
|
3426
|
+
|
|
3427
|
+
Assign a ServiceNow task to a user or group.
|
|
3428
|
+
|
|
3429
|
+
```
|
|
3430
|
+
USAGE
|
|
3431
|
+
$ nex task assign -n <value> -u <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-g
|
|
3432
|
+
<value>] [--table <value>]
|
|
3433
|
+
|
|
3434
|
+
FLAGS
|
|
3435
|
+
-a, --auth=<value> Auth alias to use.
|
|
3436
|
+
-g, --group=<value> Assignment group
|
|
3437
|
+
-n, --number=<value> (required) Task number (e.g., INC0010001)
|
|
3438
|
+
-u, --user=<value> (required) User to assign the task to
|
|
3439
|
+
--table=<value> [default: task] ServiceNow table name
|
|
3440
|
+
|
|
3441
|
+
GLOBAL FLAGS
|
|
3442
|
+
--json Format output as json.
|
|
3443
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3444
|
+
<options: debug|warn|error|info|trace>
|
|
3445
|
+
|
|
3446
|
+
DESCRIPTION
|
|
3447
|
+
Assign a ServiceNow task to a user or group.
|
|
3448
|
+
|
|
3449
|
+
This command assigns a task record identified by its number to a specified user and/or group. You can assign to a
|
|
3450
|
+
user, a group, or both simultaneously.
|
|
3451
|
+
|
|
3452
|
+
Features:
|
|
3453
|
+
- Assign tasks to individual users
|
|
3454
|
+
- Assign tasks to assignment groups
|
|
3455
|
+
- Assign to both user and group at once
|
|
3456
|
+
- Supports any task-based table
|
|
3457
|
+
- Auto-resolves task number to sys_id
|
|
3458
|
+
|
|
3459
|
+
EXAMPLES
|
|
3460
|
+
Assign an incident to a user
|
|
3461
|
+
|
|
3462
|
+
$ nex task assign --number INC0010001 --user admin --auth dev
|
|
3463
|
+
|
|
3464
|
+
Assign an incident to a user and group
|
|
3465
|
+
|
|
3466
|
+
$ nex task assign -n INC0010001 -u admin -g "Service Desk" --auth dev
|
|
3467
|
+
|
|
3468
|
+
Assign a change request to a user
|
|
3469
|
+
|
|
3470
|
+
$ nex task assign --number CHG0010001 --table change_request --user admin --auth dev
|
|
3471
|
+
```
|
|
3472
|
+
|
|
3473
|
+
_See code: [src/commands/task/assign.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/assign.ts)_
|
|
3474
|
+
|
|
3475
|
+
## `nex task close`
|
|
3476
|
+
|
|
3477
|
+
Close a ServiceNow incident.
|
|
3478
|
+
|
|
3479
|
+
```
|
|
3480
|
+
USAGE
|
|
3481
|
+
$ nex task close --notes <value> -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3482
|
+
[--close-code <value>]
|
|
3483
|
+
|
|
3484
|
+
FLAGS
|
|
3485
|
+
-a, --auth=<value> Auth alias to use.
|
|
3486
|
+
-n, --number=<value> (required) Incident number (e.g., INC0010001)
|
|
3487
|
+
--close-code=<value> Close code for the closure
|
|
3488
|
+
--notes=<value> (required) Close notes
|
|
3489
|
+
|
|
3490
|
+
GLOBAL FLAGS
|
|
3491
|
+
--json Format output as json.
|
|
3492
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3493
|
+
<options: debug|warn|error|info|trace>
|
|
3494
|
+
|
|
3495
|
+
DESCRIPTION
|
|
3496
|
+
Close a ServiceNow incident.
|
|
3497
|
+
|
|
3498
|
+
This command closes an incident identified by its number, setting the close notes and optionally a close code. The
|
|
3499
|
+
incident must be in a state that allows closure.
|
|
3500
|
+
|
|
3501
|
+
Features:
|
|
3502
|
+
- Close incidents with close notes
|
|
3503
|
+
- Optionally specify a close code
|
|
3504
|
+
- Auto-resolves incident number to sys_id
|
|
3505
|
+
|
|
3506
|
+
EXAMPLES
|
|
3507
|
+
Close an incident with close notes
|
|
3508
|
+
|
|
3509
|
+
$ nex task close --number INC0010001 --notes "Issue confirmed resolved by user" --auth dev
|
|
3510
|
+
|
|
3511
|
+
Close with a specific close code
|
|
3512
|
+
|
|
3513
|
+
$ nex task close -n INC0010001 --notes "Closed" --close-code "Solved (Permanently)" --auth dev
|
|
3514
|
+
```
|
|
3515
|
+
|
|
3516
|
+
_See code: [src/commands/task/close.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/close.ts)_
|
|
3517
|
+
|
|
3518
|
+
## `nex task comment`
|
|
3519
|
+
|
|
3520
|
+
Add a comment or work note to a ServiceNow task.
|
|
3521
|
+
|
|
3522
|
+
```
|
|
3523
|
+
USAGE
|
|
3524
|
+
$ nex task comment -c <value> -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3525
|
+
[--table <value>] [--work-note]
|
|
3526
|
+
|
|
3527
|
+
FLAGS
|
|
3528
|
+
-a, --auth=<value> Auth alias to use.
|
|
3529
|
+
-c, --comment=<value> (required) Comment text to add
|
|
3530
|
+
-n, --number=<value> (required) Task number (e.g., INC0010001)
|
|
3531
|
+
--table=<value> [default: task] ServiceNow table name
|
|
3532
|
+
--work-note Add as work note instead of comment
|
|
3533
|
+
|
|
3534
|
+
GLOBAL FLAGS
|
|
3535
|
+
--json Format output as json.
|
|
3536
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3537
|
+
<options: debug|warn|error|info|trace>
|
|
3538
|
+
|
|
3539
|
+
DESCRIPTION
|
|
3540
|
+
Add a comment or work note to a ServiceNow task.
|
|
3541
|
+
|
|
3542
|
+
This command adds a comment or work note to a task record identified by its number. By default, comments are added as
|
|
3543
|
+
customer-visible comments. Use the --work-note flag to add an internal work note instead.
|
|
3544
|
+
|
|
3545
|
+
Features:
|
|
3546
|
+
- Add customer-visible comments to any task
|
|
3547
|
+
- Add internal work notes visible only to fulfiller teams
|
|
3548
|
+
- Supports any task-based table (incident, change_request, etc.)
|
|
3549
|
+
- Auto-resolves task number to sys_id
|
|
3550
|
+
|
|
3551
|
+
EXAMPLES
|
|
3552
|
+
Add a comment to an incident
|
|
3553
|
+
|
|
3554
|
+
$ nex task comment --number INC0010001 --comment "Investigating the issue" --auth dev
|
|
3555
|
+
|
|
3556
|
+
Add a work note to an incident
|
|
3557
|
+
|
|
3558
|
+
$ nex task comment -n INC0010001 -c "Internal update" --work-note --auth dev
|
|
3559
|
+
|
|
3560
|
+
Add a comment to a change request
|
|
3561
|
+
|
|
3562
|
+
$ nex task comment --number CHG0010001 --table change_request --comment "Approved" --auth dev
|
|
3563
|
+
```
|
|
3564
|
+
|
|
3565
|
+
_See code: [src/commands/task/comment.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/comment.ts)_
|
|
3566
|
+
|
|
3567
|
+
## `nex task find`
|
|
3568
|
+
|
|
3569
|
+
Find a ServiceNow task by its number.
|
|
3570
|
+
|
|
3571
|
+
```
|
|
3572
|
+
USAGE
|
|
3573
|
+
$ nex task find -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--table <value>]
|
|
3574
|
+
|
|
3575
|
+
FLAGS
|
|
3576
|
+
-a, --auth=<value> Auth alias to use.
|
|
3577
|
+
-n, --number=<value> (required) Task number (e.g., INC0010001, CHG0010001)
|
|
3578
|
+
--table=<value> [default: task] ServiceNow table name
|
|
3579
|
+
|
|
3580
|
+
GLOBAL FLAGS
|
|
3581
|
+
--json Format output as json.
|
|
3582
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3583
|
+
<options: debug|warn|error|info|trace>
|
|
1056
3584
|
|
|
1057
|
-
|
|
3585
|
+
DESCRIPTION
|
|
3586
|
+
Find a ServiceNow task by its number.
|
|
1058
3587
|
|
|
1059
|
-
|
|
3588
|
+
This command looks up a task record by its number in the specified table. Returns the full task details including
|
|
3589
|
+
sys_id, description, state, and assignment information.
|
|
1060
3590
|
|
|
1061
|
-
|
|
3591
|
+
Features:
|
|
3592
|
+
- Look up any task by number
|
|
3593
|
+
- Supports any task-based table
|
|
3594
|
+
- JSON output for scripting and automation
|
|
1062
3595
|
|
|
1063
|
-
|
|
3596
|
+
EXAMPLES
|
|
3597
|
+
Find an incident by number
|
|
1064
3598
|
|
|
1065
|
-
$ nex
|
|
3599
|
+
$ nex task find --number INC0010001 --auth dev
|
|
1066
3600
|
|
|
1067
|
-
|
|
3601
|
+
Find a change request by number
|
|
1068
3602
|
|
|
1069
|
-
$ nex
|
|
3603
|
+
$ nex task find -n CHG0010001 --table change_request --auth dev
|
|
1070
3604
|
|
|
1071
|
-
|
|
3605
|
+
Find an incident and output as JSON
|
|
1072
3606
|
|
|
1073
|
-
$ nex
|
|
3607
|
+
$ nex task find -n INC0010001 --json --auth dev
|
|
1074
3608
|
```
|
|
1075
3609
|
|
|
1076
|
-
|
|
3610
|
+
_See code: [src/commands/task/find.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/find.ts)_
|
|
1077
3611
|
|
|
1078
|
-
|
|
3612
|
+
## `nex task resolve`
|
|
3613
|
+
|
|
3614
|
+
Resolve a ServiceNow incident with resolution notes.
|
|
1079
3615
|
|
|
1080
3616
|
```
|
|
1081
3617
|
USAGE
|
|
1082
|
-
$ nex
|
|
3618
|
+
$ nex task resolve --notes <value> -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
3619
|
+
[--close-code <value>]
|
|
1083
3620
|
|
|
1084
3621
|
FLAGS
|
|
1085
|
-
--
|
|
3622
|
+
-a, --auth=<value> Auth alias to use.
|
|
3623
|
+
-n, --number=<value> (required) Incident number (e.g., INC0010001)
|
|
3624
|
+
--close-code=<value> Close code for the resolution
|
|
3625
|
+
--notes=<value> (required) Resolution notes
|
|
1086
3626
|
|
|
1087
3627
|
GLOBAL FLAGS
|
|
1088
|
-
--json
|
|
3628
|
+
--json Format output as json.
|
|
3629
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3630
|
+
<options: debug|warn|error|info|trace>
|
|
1089
3631
|
|
|
1090
3632
|
DESCRIPTION
|
|
1091
|
-
|
|
3633
|
+
Resolve a ServiceNow incident with resolution notes.
|
|
3634
|
+
|
|
3635
|
+
This command resolves an incident identified by its number, setting the resolution notes and optionally a close code.
|
|
3636
|
+
The incident must be in a state that allows resolution.
|
|
3637
|
+
|
|
3638
|
+
Features:
|
|
3639
|
+
- Resolve incidents with resolution notes
|
|
3640
|
+
- Optionally specify a close code
|
|
3641
|
+
- Auto-resolves incident number to sys_id
|
|
1092
3642
|
|
|
1093
3643
|
EXAMPLES
|
|
1094
|
-
|
|
3644
|
+
Resolve an incident with resolution notes
|
|
3645
|
+
|
|
3646
|
+
$ nex task resolve --number INC0010001 --notes "Issue resolved by restarting the service" --auth dev
|
|
3647
|
+
|
|
3648
|
+
Resolve with a specific close code
|
|
3649
|
+
|
|
3650
|
+
$ nex task resolve -n INC0010001 --notes "Fixed" --close-code "Solved (Permanently)" --auth dev
|
|
1095
3651
|
```
|
|
1096
3652
|
|
|
1097
|
-
_See code: [
|
|
3653
|
+
_See code: [src/commands/task/resolve.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/task/resolve.ts)_
|
|
1098
3654
|
|
|
1099
|
-
## `nex
|
|
3655
|
+
## `nex update-set`
|
|
1100
3656
|
|
|
1101
|
-
|
|
3657
|
+
List update sets on a ServiceNow instance.
|
|
1102
3658
|
|
|
1103
3659
|
```
|
|
1104
3660
|
USAGE
|
|
1105
|
-
$ nex
|
|
1106
|
-
|
|
1107
|
-
ARGUMENTS
|
|
1108
|
-
PLUGIN... Plugin to install.
|
|
3661
|
+
$ nex update-set [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--limit <value>] [-q <value>]
|
|
1109
3662
|
|
|
1110
3663
|
FLAGS
|
|
1111
|
-
-
|
|
1112
|
-
-
|
|
1113
|
-
|
|
1114
|
-
-v, --verbose Show verbose npm output.
|
|
3664
|
+
-a, --auth=<value> Auth alias to use.
|
|
3665
|
+
-q, --query=<value> Encoded query filter
|
|
3666
|
+
--limit=<value> [default: 20] Maximum number of update sets to return
|
|
1115
3667
|
|
|
1116
3668
|
GLOBAL FLAGS
|
|
1117
|
-
--json
|
|
3669
|
+
--json Format output as json.
|
|
3670
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3671
|
+
<options: debug|warn|error|info|trace>
|
|
1118
3672
|
|
|
1119
3673
|
DESCRIPTION
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
Uses npm to install plugins.
|
|
1123
|
-
|
|
1124
|
-
Installation of a user-installed plugin will override a core plugin.
|
|
1125
|
-
|
|
1126
|
-
Use the NEX_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
1127
|
-
Use the NEX_NPM_REGISTRY environment variable to set the npm registry.
|
|
1128
|
-
|
|
1129
|
-
ALIASES
|
|
1130
|
-
$ nex plugins add
|
|
3674
|
+
List update sets on a ServiceNow instance.
|
|
1131
3675
|
|
|
1132
3676
|
EXAMPLES
|
|
1133
|
-
|
|
3677
|
+
List update sets with default limit
|
|
1134
3678
|
|
|
1135
|
-
$ nex
|
|
3679
|
+
$ nex update-set --auth dev-instance
|
|
1136
3680
|
|
|
1137
|
-
|
|
3681
|
+
List update sets with a custom query filter
|
|
1138
3682
|
|
|
1139
|
-
$ nex
|
|
3683
|
+
$ nex update-set --query "state=in progress" --limit 50 --auth dev-instance
|
|
1140
3684
|
|
|
1141
|
-
|
|
3685
|
+
List update sets with JSON output
|
|
1142
3686
|
|
|
1143
|
-
$ nex
|
|
3687
|
+
$ nex update-set --json --auth dev-instance
|
|
1144
3688
|
```
|
|
1145
3689
|
|
|
1146
|
-
|
|
3690
|
+
_See code: [src/commands/update-set/index.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/index.ts)_
|
|
1147
3691
|
|
|
1148
|
-
|
|
3692
|
+
## `nex update-set clone`
|
|
3693
|
+
|
|
3694
|
+
Clone an update set and its records.
|
|
1149
3695
|
|
|
1150
3696
|
```
|
|
1151
3697
|
USAGE
|
|
1152
|
-
$ nex
|
|
1153
|
-
|
|
1154
|
-
ARGUMENTS
|
|
1155
|
-
PLUGIN... [default: .] Plugin to inspect.
|
|
3698
|
+
$ nex update-set clone -n <value> -s <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1156
3699
|
|
|
1157
3700
|
FLAGS
|
|
1158
|
-
-
|
|
1159
|
-
-
|
|
3701
|
+
-a, --auth=<value> Auth alias to use.
|
|
3702
|
+
-n, --name=<value> (required) Name for the cloned update set
|
|
3703
|
+
-s, --source=<value> (required) Source update set sys_id
|
|
1160
3704
|
|
|
1161
3705
|
GLOBAL FLAGS
|
|
1162
|
-
--json
|
|
3706
|
+
--json Format output as json.
|
|
3707
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3708
|
+
<options: debug|warn|error|info|trace>
|
|
1163
3709
|
|
|
1164
3710
|
DESCRIPTION
|
|
1165
|
-
|
|
3711
|
+
Clone an update set and its records.
|
|
1166
3712
|
|
|
1167
3713
|
EXAMPLES
|
|
1168
|
-
|
|
3714
|
+
Clone an update set
|
|
3715
|
+
|
|
3716
|
+
$ nex update-set clone --source us-001 --name "Cloned Set" --auth dev-instance
|
|
3717
|
+
|
|
3718
|
+
Clone with JSON output
|
|
3719
|
+
|
|
3720
|
+
$ nex update-set clone --source us-001 --name "Cloned Set" --json --auth dev-instance
|
|
1169
3721
|
```
|
|
1170
3722
|
|
|
1171
|
-
_See code: [
|
|
3723
|
+
_See code: [src/commands/update-set/clone.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/clone.ts)_
|
|
1172
3724
|
|
|
1173
|
-
## `nex
|
|
3725
|
+
## `nex update-set create`
|
|
1174
3726
|
|
|
1175
|
-
|
|
3727
|
+
Create a new update set.
|
|
1176
3728
|
|
|
1177
3729
|
```
|
|
1178
3730
|
USAGE
|
|
1179
|
-
$ nex
|
|
1180
|
-
|
|
1181
|
-
ARGUMENTS
|
|
1182
|
-
PLUGIN... Plugin to install.
|
|
3731
|
+
$ nex update-set create -n <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--application
|
|
3732
|
+
<value>] [-d <value>]
|
|
1183
3733
|
|
|
1184
3734
|
FLAGS
|
|
1185
|
-
-
|
|
1186
|
-
-
|
|
1187
|
-
-
|
|
1188
|
-
|
|
3735
|
+
-a, --auth=<value> Auth alias to use.
|
|
3736
|
+
-d, --description=<value> Description for the new update set
|
|
3737
|
+
-n, --name=<value> (required) Name for the new update set
|
|
3738
|
+
--application=<value> Application scope for the new update set
|
|
1189
3739
|
|
|
1190
3740
|
GLOBAL FLAGS
|
|
1191
|
-
--json
|
|
3741
|
+
--json Format output as json.
|
|
3742
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3743
|
+
<options: debug|warn|error|info|trace>
|
|
1192
3744
|
|
|
1193
3745
|
DESCRIPTION
|
|
1194
|
-
|
|
3746
|
+
Create a new update set.
|
|
1195
3747
|
|
|
1196
|
-
|
|
3748
|
+
EXAMPLES
|
|
3749
|
+
Create a new update set with a name
|
|
1197
3750
|
|
|
1198
|
-
|
|
3751
|
+
$ nex update-set create --name "My Feature Set" --auth dev-instance
|
|
1199
3752
|
|
|
1200
|
-
|
|
1201
|
-
Use the NEX_NPM_REGISTRY environment variable to set the npm registry.
|
|
3753
|
+
Create with name and description
|
|
1202
3754
|
|
|
1203
|
-
|
|
1204
|
-
|
|
3755
|
+
$ nex update-set create --name "My Feature Set" --description "Update set for feature X" --auth dev-instance
|
|
3756
|
+
|
|
3757
|
+
Create within a specific application scope
|
|
3758
|
+
|
|
3759
|
+
$ nex update-set create --name "My Feature Set" --application x_my_app --auth dev-instance
|
|
3760
|
+
```
|
|
3761
|
+
|
|
3762
|
+
_See code: [src/commands/update-set/create.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/create.ts)_
|
|
3763
|
+
|
|
3764
|
+
## `nex update-set current`
|
|
3765
|
+
|
|
3766
|
+
Get or set the current update set.
|
|
3767
|
+
|
|
3768
|
+
```
|
|
3769
|
+
USAGE
|
|
3770
|
+
$ nex update-set current [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [-s <value>]
|
|
3771
|
+
|
|
3772
|
+
FLAGS
|
|
3773
|
+
-a, --auth=<value> Auth alias to use.
|
|
3774
|
+
-s, --set=<value> sys_id of update set to make current
|
|
3775
|
+
|
|
3776
|
+
GLOBAL FLAGS
|
|
3777
|
+
--json Format output as json.
|
|
3778
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3779
|
+
<options: debug|warn|error|info|trace>
|
|
3780
|
+
|
|
3781
|
+
DESCRIPTION
|
|
3782
|
+
Get or set the current update set.
|
|
1205
3783
|
|
|
1206
3784
|
EXAMPLES
|
|
1207
|
-
|
|
3785
|
+
Get the current update set
|
|
1208
3786
|
|
|
1209
|
-
$ nex
|
|
3787
|
+
$ nex update-set current --auth dev-instance
|
|
1210
3788
|
|
|
1211
|
-
|
|
3789
|
+
Set the current update set by sys_id
|
|
1212
3790
|
|
|
1213
|
-
$ nex
|
|
3791
|
+
$ nex update-set current --set us-001 --auth dev-instance
|
|
1214
3792
|
|
|
1215
|
-
|
|
3793
|
+
Get the current update set as JSON
|
|
1216
3794
|
|
|
1217
|
-
$ nex
|
|
3795
|
+
$ nex update-set current --json --auth dev-instance
|
|
1218
3796
|
```
|
|
1219
3797
|
|
|
1220
|
-
_See code: [
|
|
3798
|
+
_See code: [src/commands/update-set/current.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/current.ts)_
|
|
1221
3799
|
|
|
1222
|
-
## `nex
|
|
3800
|
+
## `nex update-set inspect`
|
|
1223
3801
|
|
|
1224
|
-
|
|
3802
|
+
Inspect the components of an update set.
|
|
1225
3803
|
|
|
1226
3804
|
```
|
|
1227
3805
|
USAGE
|
|
1228
|
-
$ nex
|
|
1229
|
-
|
|
1230
|
-
ARGUMENTS
|
|
1231
|
-
PATH [default: .] path to plugin
|
|
3806
|
+
$ nex update-set inspect -s <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1232
3807
|
|
|
1233
3808
|
FLAGS
|
|
1234
|
-
-
|
|
1235
|
-
-
|
|
1236
|
-
|
|
3809
|
+
-a, --auth=<value> Auth alias to use.
|
|
3810
|
+
-s, --sys-id=<value> (required) sys_id of the update set to inspect
|
|
3811
|
+
|
|
3812
|
+
GLOBAL FLAGS
|
|
3813
|
+
--json Format output as json.
|
|
3814
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3815
|
+
<options: debug|warn|error|info|trace>
|
|
1237
3816
|
|
|
1238
3817
|
DESCRIPTION
|
|
1239
|
-
|
|
3818
|
+
Inspect the components of an update set.
|
|
1240
3819
|
|
|
1241
|
-
|
|
3820
|
+
EXAMPLES
|
|
3821
|
+
Inspect an update set by sys_id
|
|
1242
3822
|
|
|
1243
|
-
|
|
1244
|
-
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
3823
|
+
$ nex update-set inspect --sys-id us-001 --auth dev-instance
|
|
1245
3824
|
|
|
3825
|
+
Inspect with JSON output
|
|
1246
3826
|
|
|
1247
|
-
|
|
1248
|
-
$ nex plugins link myplugin
|
|
3827
|
+
$ nex update-set inspect --sys-id us-001 --json --auth dev-instance
|
|
1249
3828
|
```
|
|
1250
3829
|
|
|
1251
|
-
_See code: [
|
|
3830
|
+
_See code: [src/commands/update-set/inspect.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/inspect.ts)_
|
|
1252
3831
|
|
|
1253
|
-
## `nex
|
|
3832
|
+
## `nex update-set move`
|
|
1254
3833
|
|
|
1255
|
-
|
|
3834
|
+
Move records between update sets.
|
|
1256
3835
|
|
|
1257
3836
|
```
|
|
1258
3837
|
USAGE
|
|
1259
|
-
$ nex
|
|
1260
|
-
|
|
1261
|
-
ARGUMENTS
|
|
1262
|
-
PLUGIN... plugin to uninstall
|
|
3838
|
+
$ nex update-set move --target <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace] [--records
|
|
3839
|
+
<value>] [--source <value>]
|
|
1263
3840
|
|
|
1264
3841
|
FLAGS
|
|
1265
|
-
-
|
|
1266
|
-
-
|
|
3842
|
+
-a, --auth=<value> Auth alias to use.
|
|
3843
|
+
--records=<value> Comma-separated sys_ids of records to move
|
|
3844
|
+
--source=<value> Source update set sys_id
|
|
3845
|
+
--target=<value> (required) Target update set sys_id
|
|
1267
3846
|
|
|
1268
|
-
|
|
1269
|
-
|
|
3847
|
+
GLOBAL FLAGS
|
|
3848
|
+
--json Format output as json.
|
|
3849
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3850
|
+
<options: debug|warn|error|info|trace>
|
|
1270
3851
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
$ nex plugins remove
|
|
3852
|
+
DESCRIPTION
|
|
3853
|
+
Move records between update sets.
|
|
1274
3854
|
|
|
1275
3855
|
EXAMPLES
|
|
1276
|
-
|
|
3856
|
+
Move all records from one update set to another
|
|
3857
|
+
|
|
3858
|
+
$ nex update-set move --target us-002 --source us-001 --auth dev-instance
|
|
3859
|
+
|
|
3860
|
+
Move specific records to a target update set
|
|
3861
|
+
|
|
3862
|
+
$ nex update-set move --target us-002 --records "rec-001,rec-002,rec-003" --auth dev-instance
|
|
3863
|
+
|
|
3864
|
+
Move records with JSON output
|
|
3865
|
+
|
|
3866
|
+
$ nex update-set move --target us-002 --source us-001 --json --auth dev-instance
|
|
1277
3867
|
```
|
|
1278
3868
|
|
|
1279
|
-
|
|
3869
|
+
_See code: [src/commands/update-set/move.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/update-set/move.ts)_
|
|
1280
3870
|
|
|
1281
|
-
|
|
3871
|
+
## `nex workflow create`
|
|
3872
|
+
|
|
3873
|
+
Create a complete workflow from a JSON specification file.
|
|
1282
3874
|
|
|
1283
3875
|
```
|
|
1284
3876
|
USAGE
|
|
1285
|
-
$ nex
|
|
3877
|
+
$ nex workflow create -s <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1286
3878
|
|
|
1287
3879
|
FLAGS
|
|
1288
|
-
--
|
|
1289
|
-
--
|
|
3880
|
+
-a, --auth=<value> Auth alias to use.
|
|
3881
|
+
-s, --spec=<value> (required) Path to workflow JSON specification file
|
|
3882
|
+
|
|
3883
|
+
GLOBAL FLAGS
|
|
3884
|
+
--json Format output as json.
|
|
3885
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3886
|
+
<options: debug|warn|error|info|trace>
|
|
3887
|
+
|
|
3888
|
+
DESCRIPTION
|
|
3889
|
+
Create a complete workflow from a JSON specification file.
|
|
3890
|
+
|
|
3891
|
+
EXAMPLES
|
|
3892
|
+
Create a workflow from a JSON spec file
|
|
3893
|
+
|
|
3894
|
+
$ nex workflow create --spec ./workflow.json --auth dev
|
|
3895
|
+
|
|
3896
|
+
Create a workflow and output result as JSON
|
|
3897
|
+
|
|
3898
|
+
$ nex workflow create -s ./workflow.json --json --auth dev
|
|
1290
3899
|
```
|
|
1291
3900
|
|
|
1292
|
-
_See code: [
|
|
3901
|
+
_See code: [src/commands/workflow/create.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/workflow/create.ts)_
|
|
1293
3902
|
|
|
1294
|
-
## `nex
|
|
3903
|
+
## `nex workflow publish`
|
|
1295
3904
|
|
|
1296
|
-
|
|
3905
|
+
Publish a workflow version.
|
|
1297
3906
|
|
|
1298
3907
|
```
|
|
1299
3908
|
USAGE
|
|
1300
|
-
$ nex
|
|
1301
|
-
|
|
1302
|
-
ARGUMENTS
|
|
1303
|
-
PLUGIN... plugin to uninstall
|
|
3909
|
+
$ nex workflow publish -s <value> -v <value> [--json] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1304
3910
|
|
|
1305
3911
|
FLAGS
|
|
1306
|
-
-
|
|
1307
|
-
-
|
|
3912
|
+
-a, --auth=<value> Auth alias to use.
|
|
3913
|
+
-s, --start-activity=<value> (required) Sys ID of the start activity
|
|
3914
|
+
-v, --version-id=<value> (required) Sys ID of the workflow version to publish
|
|
1308
3915
|
|
|
1309
|
-
|
|
1310
|
-
|
|
3916
|
+
GLOBAL FLAGS
|
|
3917
|
+
--json Format output as json.
|
|
3918
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3919
|
+
<options: debug|warn|error|info|trace>
|
|
1311
3920
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
$ nex plugins remove
|
|
3921
|
+
DESCRIPTION
|
|
3922
|
+
Publish a workflow version.
|
|
1315
3923
|
|
|
1316
3924
|
EXAMPLES
|
|
1317
|
-
|
|
3925
|
+
Publish a workflow version
|
|
3926
|
+
|
|
3927
|
+
$ nex workflow publish --version-id wfv-001 --start-activity act-001 --auth dev
|
|
3928
|
+
|
|
3929
|
+
Publish a workflow version and output as JSON
|
|
3930
|
+
|
|
3931
|
+
$ nex workflow publish -v wfv-001 -s act-001 --json --auth dev
|
|
1318
3932
|
```
|
|
1319
3933
|
|
|
1320
|
-
_See code: [
|
|
3934
|
+
_See code: [src/commands/workflow/publish.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/workflow/publish.ts)_
|
|
1321
3935
|
|
|
1322
|
-
## `nex
|
|
3936
|
+
## `nex xml export`
|
|
1323
3937
|
|
|
1324
|
-
|
|
3938
|
+
Export a single ServiceNow record as XML.
|
|
1325
3939
|
|
|
1326
3940
|
```
|
|
1327
3941
|
USAGE
|
|
1328
|
-
$ nex
|
|
1329
|
-
|
|
1330
|
-
ARGUMENTS
|
|
1331
|
-
PLUGIN... plugin to uninstall
|
|
3942
|
+
$ nex xml export -t <value> -s <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace] [-o <value>]
|
|
1332
3943
|
|
|
1333
3944
|
FLAGS
|
|
1334
|
-
-
|
|
1335
|
-
-
|
|
3945
|
+
-a, --auth=<value> Auth alias to use.
|
|
3946
|
+
-j, --json Output results as JSON
|
|
3947
|
+
-o, --output=<value> File path to write the exported XML to. If omitted, XML is printed to stdout.
|
|
3948
|
+
-s, --sys-id=<value> (required) Sys ID of the record to export
|
|
3949
|
+
-t, --table=<value> (required) Table name of the record to export
|
|
3950
|
+
|
|
3951
|
+
GLOBAL FLAGS
|
|
3952
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3953
|
+
<options: debug|warn|error|info|trace>
|
|
1336
3954
|
|
|
1337
3955
|
DESCRIPTION
|
|
1338
|
-
|
|
3956
|
+
Export a single ServiceNow record as XML.
|
|
1339
3957
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
3958
|
+
Downloads the XML representation of a specific record from a ServiceNow table. Without --output, the XML is printed to
|
|
3959
|
+
stdout. With --output, the XML is written to the specified file path.
|
|
3960
|
+
|
|
3961
|
+
Features:
|
|
3962
|
+
• Export any record by table and sys_id
|
|
3963
|
+
• Print XML to stdout for piping to other tools
|
|
3964
|
+
• Save directly to a file with --output
|
|
3965
|
+
• JSON output mode for CI/CD integration
|
|
1343
3966
|
|
|
1344
3967
|
EXAMPLES
|
|
1345
|
-
|
|
3968
|
+
Export a record to stdout
|
|
3969
|
+
|
|
3970
|
+
$ nex xml export --table sys_script_include --sys-id abc123def456 --auth dev
|
|
3971
|
+
|
|
3972
|
+
Export and save to a file
|
|
3973
|
+
|
|
3974
|
+
$ nex xml export --table incident --sys-id abc123 --output ./export.xml --auth dev
|
|
3975
|
+
|
|
3976
|
+
Export as JSON metadata
|
|
3977
|
+
|
|
3978
|
+
$ nex xml export --table sys_script --sys-id abc123 --json --auth dev
|
|
1346
3979
|
```
|
|
1347
3980
|
|
|
1348
|
-
|
|
3981
|
+
_See code: [src/commands/xml/export.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/xml/export.ts)_
|
|
1349
3982
|
|
|
1350
|
-
|
|
3983
|
+
## `nex xml import`
|
|
3984
|
+
|
|
3985
|
+
Import XML records into a ServiceNow instance.
|
|
1351
3986
|
|
|
1352
3987
|
```
|
|
1353
3988
|
USAGE
|
|
1354
|
-
$ nex
|
|
3989
|
+
$ nex xml import -f <value> -t <value> [-j] [-a <value>] [--log-level debug|warn|error|info|trace]
|
|
1355
3990
|
|
|
1356
3991
|
FLAGS
|
|
1357
|
-
-
|
|
1358
|
-
-
|
|
3992
|
+
-a, --auth=<value> Auth alias to use.
|
|
3993
|
+
-f, --file=<value> (required) Path to the XML file to import
|
|
3994
|
+
-j, --json Output results as JSON
|
|
3995
|
+
-t, --table=<value> (required) Target table to import records into
|
|
3996
|
+
|
|
3997
|
+
GLOBAL FLAGS
|
|
3998
|
+
--log-level=<option> [default: info] Specify level for logging.
|
|
3999
|
+
<options: debug|warn|error|info|trace>
|
|
1359
4000
|
|
|
1360
4001
|
DESCRIPTION
|
|
1361
|
-
|
|
4002
|
+
Import XML records into a ServiceNow instance.
|
|
4003
|
+
|
|
4004
|
+
Reads an XML file and imports its contents into the specified target table. The XML should be in ServiceNow unload
|
|
4005
|
+
format.
|
|
4006
|
+
|
|
4007
|
+
Features:
|
|
4008
|
+
• Import from local XML files
|
|
4009
|
+
• Target a specific table
|
|
4010
|
+
• JSON output mode for CI/CD integration
|
|
4011
|
+
|
|
4012
|
+
EXAMPLES
|
|
4013
|
+
Import records from an XML file
|
|
4014
|
+
|
|
4015
|
+
$ nex xml import --file ./export.xml --table sys_script_include --auth dev
|
|
4016
|
+
|
|
4017
|
+
Import with JSON output
|
|
4018
|
+
|
|
4019
|
+
$ nex xml import --file ./records.xml --table incident --json --auth dev
|
|
1362
4020
|
```
|
|
1363
4021
|
|
|
1364
|
-
_See code: [
|
|
4022
|
+
_See code: [src/commands/xml/import.ts](https://github.com/sonisoft-cnanda/now-sdk-ext-cli/blob/v2.1.0/src/commands/xml/import.ts)_
|
|
1365
4023
|
<!-- commandsstop -->
|
|
1366
4024
|
|
|
1367
4025
|
---
|
|
@@ -1675,7 +4333,7 @@ jobs:
|
|
|
1675
4333
|
- name: Setup Node.js
|
|
1676
4334
|
uses: actions/setup-node@v3
|
|
1677
4335
|
with:
|
|
1678
|
-
node-version: '
|
|
4336
|
+
node-version: '22'
|
|
1679
4337
|
|
|
1680
4338
|
- name: Install Dependencies
|
|
1681
4339
|
run: |
|
|
@@ -1709,7 +4367,7 @@ jobs:
|
|
|
1709
4367
|
|
|
1710
4368
|
```yaml
|
|
1711
4369
|
servicenow-tests:
|
|
1712
|
-
image: node:
|
|
4370
|
+
image: node:22
|
|
1713
4371
|
stage: test
|
|
1714
4372
|
before_script:
|
|
1715
4373
|
- npm install -g @servicenow/sdk
|
|
@@ -2152,7 +4810,7 @@ npm install
|
|
|
2152
4810
|
# Build
|
|
2153
4811
|
npm run build
|
|
2154
4812
|
|
|
2155
|
-
# Run tests (
|
|
4813
|
+
# Run tests (960+ tests)
|
|
2156
4814
|
npm test
|
|
2157
4815
|
|
|
2158
4816
|
# Run linter
|