@sonisoft/now-sdk-ext-cli 5.5.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1881,20 +1881,10 @@
1881
1881
  "upload.js"
1882
1882
  ]
1883
1883
  },
1884
- "batch:create": {
1884
+ "auth:browser-session": {
1885
1885
  "aliases": [],
1886
1886
  "args": {},
1887
- "description": "Batch create records on a ServiceNow instance from a JSON file.",
1888
- "examples": [
1889
- {
1890
- "command": "<%= config.bin %> <%= command.id %> --file ./records.json --auth dev",
1891
- "description": "Create records from a JSON file"
1892
- },
1893
- {
1894
- "command": "<%= config.bin %> <%= command.id %> --file ./records.json --no-transaction --auth dev",
1895
- "description": "Create records without transactional mode"
1896
- }
1897
- ],
1887
+ "description": "Create a verified Playwright cookie session using a stored SDK alias.",
1898
1888
  "flags": {
1899
1889
  "json": {
1900
1890
  "description": "Format output as json.",
@@ -1905,90 +1895,82 @@
1905
1895
  },
1906
1896
  "auth": {
1907
1897
  "char": "a",
1908
- "description": "Auth alias to use.",
1898
+ "description": "Stored SDK credential alias.",
1909
1899
  "name": "auth",
1910
- "required": false,
1900
+ "required": true,
1911
1901
  "hasDynamicHelp": false,
1912
1902
  "multiple": false,
1913
1903
  "type": "option"
1914
1904
  },
1915
1905
  "cred-store": {
1916
- "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
1917
- "helpGroup": "GLOBAL",
1906
+ "description": "Use the headless credential store.",
1918
1907
  "name": "cred-store",
1919
- "required": false,
1920
- "allowNo": false,
1921
- "type": "boolean"
1922
- },
1923
- "deny-execute": {
1924
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
1925
- "helpGroup": "GLOBAL",
1926
- "name": "deny-execute",
1927
- "required": false,
1928
- "allowNo": false,
1929
- "type": "boolean"
1930
- },
1931
- "deny-write": {
1932
- "description": "Refuse any change to instance data for this invocation.",
1933
- "helpGroup": "GLOBAL",
1934
- "name": "deny-write",
1935
- "required": false,
1936
1908
  "allowNo": false,
1937
1909
  "type": "boolean"
1938
1910
  },
1939
- "log-dir": {
1940
- "description": "Directory to write log files to. Implies --log-file.",
1941
- "helpGroup": "GLOBAL",
1942
- "name": "log-dir",
1943
- "required": false,
1944
- "hasDynamicHelp": false,
1945
- "multiple": false,
1946
- "type": "option"
1947
- },
1948
- "log-file": {
1949
- "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
1950
- "helpGroup": "GLOBAL",
1951
- "name": "log-file",
1952
- "required": false,
1911
+ "force": {
1912
+ "description": "Replace an existing regular output file.",
1913
+ "name": "force",
1953
1914
  "allowNo": false,
1954
1915
  "type": "boolean"
1955
1916
  },
1956
- "log-level": {
1957
- "helpGroup": "GLOBAL",
1958
- "name": "log-level",
1959
- "summary": "Specify level for logging.",
1960
- "default": "info",
1917
+ "output": {
1918
+ "description": "Owner-only Playwright storage-state file.",
1919
+ "name": "output",
1920
+ "required": true,
1961
1921
  "hasDynamicHelp": false,
1962
1922
  "multiple": false,
1963
- "options": [
1964
- "debug",
1965
- "warn",
1966
- "error",
1967
- "info",
1968
- "trace"
1969
- ],
1970
1923
  "type": "option"
1924
+ }
1925
+ },
1926
+ "hasDynamicHelp": false,
1927
+ "hiddenAliases": [],
1928
+ "id": "auth:browser-session",
1929
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
1930
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
1931
+ "pluginType": "core",
1932
+ "strict": true,
1933
+ "enableJsonFlag": true,
1934
+ "isESM": true,
1935
+ "relativePath": [
1936
+ "dist",
1937
+ "commands",
1938
+ "auth",
1939
+ "browser-session.js"
1940
+ ]
1941
+ },
1942
+ "auth:delete": {
1943
+ "aliases": [],
1944
+ "args": {
1945
+ "alias": {
1946
+ "description": "Alias to remove",
1947
+ "name": "alias",
1948
+ "required": false
1949
+ }
1950
+ },
1951
+ "description": "Remove a credential from the store.\n\nThis does not touch the OS keyring — a copy stored there before migrating remains.",
1952
+ "examples": [
1953
+ {
1954
+ "command": "<%= config.bin %> <%= command.id %> dev206299",
1955
+ "description": "Remove one alias"
1971
1956
  },
1972
- "read-only": {
1973
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
1957
+ {
1958
+ "command": "<%= config.bin %> <%= command.id %> --all",
1959
+ "description": "Remove every stored credential"
1960
+ }
1961
+ ],
1962
+ "flags": {
1963
+ "cred-store": {
1964
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
1974
1965
  "helpGroup": "GLOBAL",
1975
- "name": "read-only",
1966
+ "name": "cred-store",
1976
1967
  "required": false,
1977
1968
  "allowNo": false,
1978
1969
  "type": "boolean"
1979
1970
  },
1980
- "file": {
1981
- "char": "f",
1982
- "description": "Path to JSON file with create operations",
1983
- "name": "file",
1984
- "required": true,
1985
- "hasDynamicHelp": false,
1986
- "multiple": false,
1987
- "type": "option"
1988
- },
1989
- "transaction": {
1990
- "description": "Stop on first error (transactional)",
1991
- "name": "transaction",
1971
+ "all": {
1972
+ "description": "Remove every stored credential",
1973
+ "name": "all",
1992
1974
  "required": false,
1993
1975
  "allowNo": false,
1994
1976
  "type": "boolean"
@@ -1996,32 +1978,32 @@
1996
1978
  },
1997
1979
  "hasDynamicHelp": false,
1998
1980
  "hiddenAliases": [],
1999
- "id": "batch:create",
1981
+ "id": "auth:delete",
2000
1982
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2001
1983
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2002
1984
  "pluginType": "core",
2003
1985
  "strict": true,
2004
- "enableJsonFlag": true,
1986
+ "enableJsonFlag": false,
2005
1987
  "isESM": true,
2006
1988
  "relativePath": [
2007
1989
  "dist",
2008
1990
  "commands",
2009
- "batch",
2010
- "create.js"
1991
+ "auth",
1992
+ "delete.js"
2011
1993
  ]
2012
1994
  },
2013
- "batch:update": {
1995
+ "auth:doctor": {
2014
1996
  "aliases": [],
2015
1997
  "args": {},
2016
- "description": "Batch update records on a ServiceNow instance from a JSON file.",
1998
+ "description": "Diagnose credential storage: whether the SDK shim is active, which backend is in use, and what is stored.",
2017
1999
  "examples": [
2018
2000
  {
2019
- "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --auth dev",
2020
- "description": "Update records from a JSON file"
2001
+ "command": "<%= config.bin %> <%= command.id %>",
2002
+ "description": "Check credential storage health"
2021
2003
  },
2022
2004
  {
2023
- "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --stop-on-error --auth dev",
2024
- "description": "Update records and stop on first error"
2005
+ "command": "<%= config.bin %> <%= command.id %> --json",
2006
+ "description": "Machine-readable output for CI"
2025
2007
  }
2026
2008
  ],
2027
2009
  "flags": {
@@ -2032,100 +2014,18 @@
2032
2014
  "allowNo": false,
2033
2015
  "type": "boolean"
2034
2016
  },
2035
- "auth": {
2036
- "char": "a",
2037
- "description": "Auth alias to use.",
2038
- "name": "auth",
2039
- "required": false,
2040
- "hasDynamicHelp": false,
2041
- "multiple": false,
2042
- "type": "option"
2043
- },
2044
2017
  "cred-store": {
2045
- "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
2018
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
2046
2019
  "helpGroup": "GLOBAL",
2047
2020
  "name": "cred-store",
2048
2021
  "required": false,
2049
2022
  "allowNo": false,
2050
2023
  "type": "boolean"
2051
- },
2052
- "deny-execute": {
2053
- "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
2054
- "helpGroup": "GLOBAL",
2055
- "name": "deny-execute",
2056
- "required": false,
2057
- "allowNo": false,
2058
- "type": "boolean"
2059
- },
2060
- "deny-write": {
2061
- "description": "Refuse any change to instance data for this invocation.",
2062
- "helpGroup": "GLOBAL",
2063
- "name": "deny-write",
2064
- "required": false,
2065
- "allowNo": false,
2066
- "type": "boolean"
2067
- },
2068
- "log-dir": {
2069
- "description": "Directory to write log files to. Implies --log-file.",
2070
- "helpGroup": "GLOBAL",
2071
- "name": "log-dir",
2072
- "required": false,
2073
- "hasDynamicHelp": false,
2074
- "multiple": false,
2075
- "type": "option"
2076
- },
2077
- "log-file": {
2078
- "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
2079
- "helpGroup": "GLOBAL",
2080
- "name": "log-file",
2081
- "required": false,
2082
- "allowNo": false,
2083
- "type": "boolean"
2084
- },
2085
- "log-level": {
2086
- "helpGroup": "GLOBAL",
2087
- "name": "log-level",
2088
- "summary": "Specify level for logging.",
2089
- "default": "info",
2090
- "hasDynamicHelp": false,
2091
- "multiple": false,
2092
- "options": [
2093
- "debug",
2094
- "warn",
2095
- "error",
2096
- "info",
2097
- "trace"
2098
- ],
2099
- "type": "option"
2100
- },
2101
- "read-only": {
2102
- "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
2103
- "helpGroup": "GLOBAL",
2104
- "name": "read-only",
2105
- "required": false,
2106
- "allowNo": false,
2107
- "type": "boolean"
2108
- },
2109
- "file": {
2110
- "char": "f",
2111
- "description": "Path to JSON file with update operations",
2112
- "name": "file",
2113
- "required": true,
2114
- "hasDynamicHelp": false,
2115
- "multiple": false,
2116
- "type": "option"
2117
- },
2118
- "stop-on-error": {
2119
- "description": "Stop processing on first error",
2120
- "name": "stop-on-error",
2121
- "required": false,
2122
- "allowNo": false,
2123
- "type": "boolean"
2124
2024
  }
2125
2025
  },
2126
2026
  "hasDynamicHelp": false,
2127
2027
  "hiddenAliases": [],
2128
- "id": "batch:update",
2028
+ "id": "auth:doctor",
2129
2029
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2130
2030
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2131
2031
  "pluginType": "core",
@@ -2135,35 +2035,223 @@
2135
2035
  "relativePath": [
2136
2036
  "dist",
2137
2037
  "commands",
2138
- "batch",
2139
- "update.js"
2038
+ "auth",
2039
+ "doctor.js"
2140
2040
  ]
2141
2041
  },
2142
- "behavior:details": {
2042
+ "auth:list": {
2143
2043
  "aliases": [],
2144
2044
  "args": {},
2145
- "description": "Retrieve known behavior artifacts without rediscovery. Repeat --reference kind:source_table:sys_id for up to 50 records. Add --details scripts, --details definitions or --details dependencies to include bodies immediately. Source references are returned by behavior discovery; flows also accept flows:sys_hub_flow:<sys_id>.",
2045
+ "description": "List credentials in the headless-safe credential store.\n\nThese are the credentials the ServiceNow SDK reads via the sn-credstore shim, which works in non-interactive sessions where the OS keyring cannot be unlocked.\n\nSecrets are never printed.",
2146
2046
  "examples": [
2147
- "<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json"
2047
+ {
2048
+ "command": "<%= config.bin %> <%= command.id %>",
2049
+ "description": "List stored credentials"
2050
+ },
2051
+ {
2052
+ "command": "<%= config.bin %> <%= command.id %> --json",
2053
+ "description": "List as JSON for scripting"
2054
+ }
2148
2055
  ],
2149
2056
  "flags": {
2150
2057
  "json": {
2151
- "description": "Emit one JSON document",
2058
+ "description": "Format output as json.",
2059
+ "helpGroup": "GLOBAL",
2152
2060
  "name": "json",
2153
2061
  "allowNo": false,
2154
2062
  "type": "boolean"
2155
2063
  },
2156
- "auth": {
2157
- "char": "a",
2158
- "description": "Auth alias to use.",
2159
- "name": "auth",
2160
- "required": false,
2161
- "hasDynamicHelp": false,
2162
- "multiple": false,
2163
- "type": "option"
2164
- },
2165
2064
  "cred-store": {
2166
- "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
2065
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
2066
+ "helpGroup": "GLOBAL",
2067
+ "name": "cred-store",
2068
+ "required": false,
2069
+ "allowNo": false,
2070
+ "type": "boolean"
2071
+ }
2072
+ },
2073
+ "hasDynamicHelp": false,
2074
+ "hiddenAliases": [],
2075
+ "id": "auth:list",
2076
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2077
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2078
+ "pluginType": "core",
2079
+ "strict": true,
2080
+ "enableJsonFlag": true,
2081
+ "isESM": true,
2082
+ "relativePath": [
2083
+ "dist",
2084
+ "commands",
2085
+ "auth",
2086
+ "list.js"
2087
+ ]
2088
+ },
2089
+ "auth:open": {
2090
+ "aliases": [],
2091
+ "args": {},
2092
+ "description": "Open a verified UI session in a dedicated desktop browser using a stored SDK alias.",
2093
+ "examples": [
2094
+ {
2095
+ "command": "<%= config.bin %> <%= command.id %> -a bcbsscdev --cred-store",
2096
+ "description": "Open the alias in Edge"
2097
+ },
2098
+ {
2099
+ "command": "<%= config.bin %> <%= command.id %> -a dev206299 --browser chrome",
2100
+ "description": "Open in Chrome"
2101
+ },
2102
+ {
2103
+ "command": "<%= config.bin %> <%= command.id %> -a dev206299 --cdp http://127.0.0.1:9222",
2104
+ "description": "Inject into an already-debuggable browser"
2105
+ }
2106
+ ],
2107
+ "flags": {
2108
+ "json": {
2109
+ "description": "Format output as json.",
2110
+ "helpGroup": "GLOBAL",
2111
+ "name": "json",
2112
+ "allowNo": false,
2113
+ "type": "boolean"
2114
+ },
2115
+ "auth": {
2116
+ "char": "a",
2117
+ "description": "Stored SDK credential alias.",
2118
+ "name": "auth",
2119
+ "required": true,
2120
+ "hasDynamicHelp": false,
2121
+ "multiple": false,
2122
+ "type": "option"
2123
+ },
2124
+ "browser": {
2125
+ "description": "Desktop browser to launch. Ignored when --cdp is set.",
2126
+ "name": "browser",
2127
+ "default": "edge",
2128
+ "hasDynamicHelp": false,
2129
+ "multiple": false,
2130
+ "options": [
2131
+ "edge",
2132
+ "chrome",
2133
+ "brave"
2134
+ ],
2135
+ "type": "option"
2136
+ },
2137
+ "cdp": {
2138
+ "description": "Existing DevTools URL. Skips launching a browser.",
2139
+ "name": "cdp",
2140
+ "hasDynamicHelp": false,
2141
+ "multiple": false,
2142
+ "type": "option"
2143
+ },
2144
+ "cred-store": {
2145
+ "description": "Use the headless credential store.",
2146
+ "name": "cred-store",
2147
+ "allowNo": false,
2148
+ "type": "boolean"
2149
+ },
2150
+ "force": {
2151
+ "description": "Replace an existing regular output file.",
2152
+ "name": "force",
2153
+ "allowNo": false,
2154
+ "type": "boolean"
2155
+ },
2156
+ "output": {
2157
+ "description": "Optional owner-only Playwright storage-state file.",
2158
+ "name": "output",
2159
+ "hasDynamicHelp": false,
2160
+ "multiple": false,
2161
+ "type": "option"
2162
+ }
2163
+ },
2164
+ "hasDynamicHelp": false,
2165
+ "hiddenAliases": [],
2166
+ "id": "auth:open",
2167
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2168
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2169
+ "pluginType": "core",
2170
+ "strict": true,
2171
+ "enableJsonFlag": true,
2172
+ "isESM": true,
2173
+ "relativePath": [
2174
+ "dist",
2175
+ "commands",
2176
+ "auth",
2177
+ "open.js"
2178
+ ]
2179
+ },
2180
+ "auth:use": {
2181
+ "aliases": [],
2182
+ "args": {
2183
+ "alias": {
2184
+ "description": "Alias to make the default",
2185
+ "name": "alias",
2186
+ "required": true
2187
+ }
2188
+ },
2189
+ "description": "Set the default credential alias.\n\nCommands run without --auth use this alias.",
2190
+ "examples": [
2191
+ {
2192
+ "command": "<%= config.bin %> <%= command.id %> dev206299",
2193
+ "description": "Make dev206299 the default"
2194
+ }
2195
+ ],
2196
+ "flags": {
2197
+ "cred-store": {
2198
+ "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
2199
+ "helpGroup": "GLOBAL",
2200
+ "name": "cred-store",
2201
+ "required": false,
2202
+ "allowNo": false,
2203
+ "type": "boolean"
2204
+ }
2205
+ },
2206
+ "hasDynamicHelp": false,
2207
+ "hiddenAliases": [],
2208
+ "id": "auth:use",
2209
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2210
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
2211
+ "pluginType": "core",
2212
+ "strict": true,
2213
+ "enableJsonFlag": false,
2214
+ "isESM": true,
2215
+ "relativePath": [
2216
+ "dist",
2217
+ "commands",
2218
+ "auth",
2219
+ "use.js"
2220
+ ]
2221
+ },
2222
+ "batch:create": {
2223
+ "aliases": [],
2224
+ "args": {},
2225
+ "description": "Batch create records on a ServiceNow instance from a JSON file.",
2226
+ "examples": [
2227
+ {
2228
+ "command": "<%= config.bin %> <%= command.id %> --file ./records.json --auth dev",
2229
+ "description": "Create records from a JSON file"
2230
+ },
2231
+ {
2232
+ "command": "<%= config.bin %> <%= command.id %> --file ./records.json --no-transaction --auth dev",
2233
+ "description": "Create records without transactional mode"
2234
+ }
2235
+ ],
2236
+ "flags": {
2237
+ "json": {
2238
+ "description": "Format output as json.",
2239
+ "helpGroup": "GLOBAL",
2240
+ "name": "json",
2241
+ "allowNo": false,
2242
+ "type": "boolean"
2243
+ },
2244
+ "auth": {
2245
+ "char": "a",
2246
+ "description": "Auth alias to use.",
2247
+ "name": "auth",
2248
+ "required": false,
2249
+ "hasDynamicHelp": false,
2250
+ "multiple": false,
2251
+ "type": "option"
2252
+ },
2253
+ "cred-store": {
2254
+ "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
2167
2255
  "helpGroup": "GLOBAL",
2168
2256
  "name": "cred-store",
2169
2257
  "required": false,
@@ -2227,53 +2315,26 @@
2227
2315
  "allowNo": false,
2228
2316
  "type": "boolean"
2229
2317
  },
2230
- "dependency-depth": {
2231
- "description": "Expand one dependency level; requires --details dependencies",
2232
- "name": "dependency-depth",
2233
- "default": 0,
2234
- "hasDynamicHelp": false,
2235
- "multiple": false,
2236
- "type": "option"
2237
- },
2238
- "details": {
2239
- "description": "Include selected detail now; repeat for multiple kinds",
2240
- "name": "details",
2241
- "hasDynamicHelp": false,
2242
- "multiple": true,
2243
- "options": [
2244
- "scripts",
2245
- "definitions",
2246
- "dependencies"
2247
- ],
2248
- "type": "option"
2249
- },
2250
- "max-bytes": {
2251
- "description": "Maximum JSON response bytes; omissions include retrieval references",
2252
- "name": "max-bytes",
2253
- "default": 65536,
2254
- "hasDynamicHelp": false,
2255
- "multiple": false,
2256
- "type": "option"
2257
- },
2258
- "scope": {
2259
- "description": "Transaction scope for flow definition reads",
2260
- "name": "scope",
2318
+ "file": {
2319
+ "char": "f",
2320
+ "description": "Path to JSON file with create operations",
2321
+ "name": "file",
2322
+ "required": true,
2261
2323
  "hasDynamicHelp": false,
2262
2324
  "multiple": false,
2263
2325
  "type": "option"
2264
2326
  },
2265
- "reference": {
2266
- "description": "kind:source_table:sys_id; repeat for a batch",
2267
- "name": "reference",
2268
- "required": true,
2269
- "hasDynamicHelp": false,
2270
- "multiple": true,
2271
- "type": "option"
2327
+ "transaction": {
2328
+ "description": "Stop on first error (transactional)",
2329
+ "name": "transaction",
2330
+ "required": false,
2331
+ "allowNo": false,
2332
+ "type": "boolean"
2272
2333
  }
2273
2334
  },
2274
2335
  "hasDynamicHelp": false,
2275
2336
  "hiddenAliases": [],
2276
- "id": "behavior:details",
2337
+ "id": "batch:create",
2277
2338
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2278
2339
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2279
2340
  "pluginType": "core",
@@ -2283,21 +2344,28 @@
2283
2344
  "relativePath": [
2284
2345
  "dist",
2285
2346
  "commands",
2286
- "behavior",
2287
- "details.js"
2347
+ "batch",
2348
+ "create.js"
2288
2349
  ]
2289
2350
  },
2290
- "behavior": {
2351
+ "batch:update": {
2291
2352
  "aliases": [],
2292
2353
  "args": {},
2293
- "description": "Discover table behavior: rules, UI actions/scripts, UI/data policies, workflows, flows and state models. Active and applicable inherited behavior is included by default. Conditions describe configuration, not a prediction of execution. Select categories and details to control output size.",
2354
+ "description": "Batch update records on a ServiceNow instance from a JSON file.",
2294
2355
  "examples": [
2295
- "<%= config.bin %> <%= command.id %> --table incident --auth dev --json",
2296
- "<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json"
2356
+ {
2357
+ "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --auth dev",
2358
+ "description": "Update records from a JSON file"
2359
+ },
2360
+ {
2361
+ "command": "<%= config.bin %> <%= command.id %> --file ./updates.json --stop-on-error --auth dev",
2362
+ "description": "Update records and stop on first error"
2363
+ }
2297
2364
  ],
2298
2365
  "flags": {
2299
2366
  "json": {
2300
- "description": "Emit one JSON document",
2367
+ "description": "Format output as json.",
2368
+ "helpGroup": "GLOBAL",
2301
2369
  "name": "json",
2302
2370
  "allowNo": false,
2303
2371
  "type": "boolean"
@@ -2376,112 +2444,26 @@
2376
2444
  "allowNo": false,
2377
2445
  "type": "boolean"
2378
2446
  },
2379
- "dependency-depth": {
2380
- "description": "Expand one dependency level; requires --details dependencies",
2381
- "name": "dependency-depth",
2382
- "default": 0,
2447
+ "file": {
2448
+ "char": "f",
2449
+ "description": "Path to JSON file with update operations",
2450
+ "name": "file",
2451
+ "required": true,
2383
2452
  "hasDynamicHelp": false,
2384
2453
  "multiple": false,
2385
2454
  "type": "option"
2386
2455
  },
2387
- "details": {
2388
- "description": "Include selected detail now; repeat for multiple kinds",
2389
- "name": "details",
2390
- "hasDynamicHelp": false,
2391
- "multiple": true,
2392
- "options": [
2393
- "scripts",
2394
- "definitions",
2395
- "dependencies"
2396
- ],
2397
- "type": "option"
2398
- },
2399
- "max-bytes": {
2400
- "description": "Maximum JSON response bytes; omissions include retrieval references",
2401
- "name": "max-bytes",
2402
- "default": 65536,
2403
- "hasDynamicHelp": false,
2404
- "multiple": false,
2405
- "type": "option"
2406
- },
2407
- "scope": {
2408
- "description": "Transaction scope for flow definition reads",
2409
- "name": "scope",
2410
- "hasDynamicHelp": false,
2411
- "multiple": false,
2412
- "type": "option"
2413
- },
2414
- "category": {
2415
- "description": "Category to inspect; repeat to select several, default all",
2416
- "name": "category",
2417
- "hasDynamicHelp": false,
2418
- "multiple": true,
2419
- "options": [
2420
- "business_rules",
2421
- "ui_actions",
2422
- "client_scripts",
2423
- "ui_policies",
2424
- "data_policies",
2425
- "workflows",
2426
- "flows",
2427
- "state_models"
2428
- ],
2429
- "type": "option"
2430
- },
2431
- "cursor": {
2432
- "description": "Continuation token; requires exactly one --category and the same filters",
2433
- "name": "cursor",
2434
- "hasDynamicHelp": false,
2435
- "multiple": false,
2436
- "type": "option"
2437
- },
2438
- "include-inactive": {
2439
- "description": "Include inactive/published and draft candidates when discoverable",
2440
- "name": "include-inactive",
2456
+ "stop-on-error": {
2457
+ "description": "Stop processing on first error",
2458
+ "name": "stop-on-error",
2459
+ "required": false,
2441
2460
  "allowNo": false,
2442
2461
  "type": "boolean"
2443
- },
2444
- "include-inherited": {
2445
- "description": "Include applicable ancestor behavior",
2446
- "name": "include-inherited",
2447
- "allowNo": true,
2448
- "type": "boolean"
2449
- },
2450
- "limit": {
2451
- "description": "Maximum items per category",
2452
- "name": "limit",
2453
- "default": 50,
2454
- "hasDynamicHelp": false,
2455
- "multiple": false,
2456
- "type": "option"
2457
- },
2458
- "name": {
2459
- "description": "Metadata name contains this text",
2460
- "name": "name",
2461
- "hasDynamicHelp": false,
2462
- "multiple": false,
2463
- "type": "option"
2464
- },
2465
- "sys-id": {
2466
- "description": "Metadata source sys_id to include; repeat for multiple records",
2467
- "name": "sys-id",
2468
- "hasDynamicHelp": false,
2469
- "multiple": true,
2470
- "type": "option"
2471
- },
2472
- "table": {
2473
- "char": "t",
2474
- "description": "Target table name",
2475
- "name": "table",
2476
- "required": true,
2477
- "hasDynamicHelp": false,
2478
- "multiple": false,
2479
- "type": "option"
2480
2462
  }
2481
2463
  },
2482
2464
  "hasDynamicHelp": false,
2483
2465
  "hiddenAliases": [],
2484
- "id": "behavior",
2466
+ "id": "batch:update",
2485
2467
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2486
2468
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2487
2469
  "pluginType": "core",
@@ -2491,38 +2473,21 @@
2491
2473
  "relativePath": [
2492
2474
  "dist",
2493
2475
  "commands",
2494
- "behavior",
2495
- "index.js"
2476
+ "batch",
2477
+ "update.js"
2496
2478
  ]
2497
2479
  },
2498
- "bulk:delete": {
2480
+ "behavior:details": {
2499
2481
  "aliases": [],
2500
2482
  "args": {},
2501
- "description": "Bulk delete records matching an encoded query.\n\nFinds all records in a table matching the given query, then deletes each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without deleting)\n • Encoded query filtering\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2483
+ "description": "Retrieve known behavior artifacts without rediscovery. Repeat --reference kind:source_table:sys_id for up to 50 records. Add --details scripts, --details definitions or --details dependencies to include bodies immediately. Source references are returned by behavior discovery; flows also accept flows:sys_hub_flow:<sys_id>.",
2502
2484
  "examples": [
2503
- {
2504
- "description": "Dry run — see how many records would be deleted",
2505
- "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --auth dev"
2506
- },
2507
- {
2508
- "description": "Execute the delete (requires --confirm)",
2509
- "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --confirm --auth dev"
2510
- },
2511
- {
2512
- "description": "Delete with custom limit",
2513
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=false^closed_at<2023-01-01\" --limit 1000 --confirm --auth dev"
2514
- },
2515
- {
2516
- "description": "Delete as JSON output",
2517
- "command": "<%= config.bin %> <%= command.id %> --table u_staging --query \"processed=true\" --confirm --json --auth dev"
2518
- }
2485
+ "<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json"
2519
2486
  ],
2520
2487
  "flags": {
2521
2488
  "json": {
2522
- "char": "j",
2523
- "description": "Output results as JSON",
2489
+ "description": "Emit one JSON document",
2524
2490
  "name": "json",
2525
- "required": false,
2526
2491
  "allowNo": false,
2527
2492
  "type": "boolean"
2528
2493
  },
@@ -2600,45 +2565,53 @@
2600
2565
  "allowNo": false,
2601
2566
  "type": "boolean"
2602
2567
  },
2603
- "table": {
2604
- "char": "t",
2605
- "description": "Table name to delete records from",
2606
- "name": "table",
2607
- "required": true,
2568
+ "dependency-depth": {
2569
+ "description": "Expand one dependency level; requires --details dependencies",
2570
+ "name": "dependency-depth",
2571
+ "default": 0,
2608
2572
  "hasDynamicHelp": false,
2609
2573
  "multiple": false,
2610
2574
  "type": "option"
2611
2575
  },
2612
- "query": {
2613
- "char": "q",
2614
- "description": "Encoded query to match records for deletion",
2615
- "name": "query",
2616
- "required": true,
2576
+ "details": {
2577
+ "description": "Include selected detail now; repeat for multiple kinds",
2578
+ "name": "details",
2617
2579
  "hasDynamicHelp": false,
2618
- "multiple": false,
2580
+ "multiple": true,
2581
+ "options": [
2582
+ "scripts",
2583
+ "definitions",
2584
+ "dependencies"
2585
+ ],
2619
2586
  "type": "option"
2620
2587
  },
2621
- "confirm": {
2622
- "description": "Execute the delete (without this flag, performs a dry run)",
2623
- "name": "confirm",
2624
- "required": false,
2625
- "allowNo": false,
2626
- "type": "boolean"
2588
+ "max-bytes": {
2589
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2590
+ "name": "max-bytes",
2591
+ "default": 65536,
2592
+ "hasDynamicHelp": false,
2593
+ "multiple": false,
2594
+ "type": "option"
2627
2595
  },
2628
- "limit": {
2629
- "char": "l",
2630
- "description": "Maximum number of records to delete (default 200, max 10000)",
2631
- "name": "limit",
2632
- "required": false,
2633
- "default": 200,
2596
+ "scope": {
2597
+ "description": "Transaction scope for flow definition reads",
2598
+ "name": "scope",
2634
2599
  "hasDynamicHelp": false,
2635
2600
  "multiple": false,
2636
2601
  "type": "option"
2602
+ },
2603
+ "reference": {
2604
+ "description": "kind:source_table:sys_id; repeat for a batch",
2605
+ "name": "reference",
2606
+ "required": true,
2607
+ "hasDynamicHelp": false,
2608
+ "multiple": true,
2609
+ "type": "option"
2637
2610
  }
2638
2611
  },
2639
2612
  "hasDynamicHelp": false,
2640
2613
  "hiddenAliases": [],
2641
- "id": "bulk:delete",
2614
+ "id": "behavior:details",
2642
2615
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2643
2616
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2644
2617
  "pluginType": "core",
@@ -2648,38 +2621,22 @@
2648
2621
  "relativePath": [
2649
2622
  "dist",
2650
2623
  "commands",
2651
- "bulk",
2652
- "delete.js"
2624
+ "behavior",
2625
+ "details.js"
2653
2626
  ]
2654
2627
  },
2655
- "bulk:update": {
2628
+ "behavior": {
2656
2629
  "aliases": [],
2657
2630
  "args": {},
2658
- "description": "Bulk update records matching an encoded query.\n\nFinds all records in a table matching the given query, then applies field updates to each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without modifying data)\n • Encoded query filtering\n • JSON field=value pairs for update data\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2631
+ "description": "Discover table behavior: rules, UI actions/scripts, UI/data policies, workflows, flows and state models. Active and applicable inherited behavior is included by default. Conditions describe configuration, not a prediction of execution. Select categories and details to control output size.",
2659
2632
  "examples": [
2660
- {
2661
- "description": "Dry run — see how many records would be updated",
2662
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --auth dev"
2663
- },
2664
- {
2665
- "description": "Execute the update (requires --confirm)",
2666
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --confirm --auth dev"
2667
- },
2668
- {
2669
- "description": "Update with custom limit",
2670
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"state=1\" --data '{\"assignment_group\":\"group-sys-id\"}' --limit 500 --confirm --auth dev"
2671
- },
2672
- {
2673
- "description": "Update as JSON output",
2674
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --data '{\"state\":\"6\"}' --confirm --json --auth dev"
2675
- }
2633
+ "<%= config.bin %> <%= command.id %> --table incident --auth dev --json",
2634
+ "<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json"
2676
2635
  ],
2677
2636
  "flags": {
2678
2637
  "json": {
2679
- "char": "j",
2680
- "description": "Output results as JSON",
2638
+ "description": "Emit one JSON document",
2681
2639
  "name": "json",
2682
- "required": false,
2683
2640
  "allowNo": false,
2684
2641
  "type": "boolean"
2685
2642
  },
@@ -2757,54 +2714,112 @@
2757
2714
  "allowNo": false,
2758
2715
  "type": "boolean"
2759
2716
  },
2760
- "table": {
2761
- "char": "t",
2762
- "description": "Table name to update records in",
2763
- "name": "table",
2764
- "required": true,
2717
+ "dependency-depth": {
2718
+ "description": "Expand one dependency level; requires --details dependencies",
2719
+ "name": "dependency-depth",
2720
+ "default": 0,
2765
2721
  "hasDynamicHelp": false,
2766
2722
  "multiple": false,
2767
2723
  "type": "option"
2768
2724
  },
2769
- "query": {
2770
- "char": "q",
2771
- "description": "Encoded query to match records",
2772
- "name": "query",
2773
- "required": true,
2725
+ "details": {
2726
+ "description": "Include selected detail now; repeat for multiple kinds",
2727
+ "name": "details",
2774
2728
  "hasDynamicHelp": false,
2775
- "multiple": false,
2729
+ "multiple": true,
2730
+ "options": [
2731
+ "scripts",
2732
+ "definitions",
2733
+ "dependencies"
2734
+ ],
2776
2735
  "type": "option"
2777
2736
  },
2778
- "data": {
2779
- "char": "d",
2780
- "description": "JSON object of field=value pairs to apply (e.g. '{\"priority\":\"4\",\"state\":\"2\"}')",
2781
- "name": "data",
2782
- "required": true,
2737
+ "max-bytes": {
2738
+ "description": "Maximum JSON response bytes; omissions include retrieval references",
2739
+ "name": "max-bytes",
2740
+ "default": 65536,
2783
2741
  "hasDynamicHelp": false,
2784
2742
  "multiple": false,
2785
2743
  "type": "option"
2786
2744
  },
2787
- "confirm": {
2788
- "description": "Execute the update (without this flag, performs a dry run)",
2789
- "name": "confirm",
2790
- "required": false,
2791
- "allowNo": false,
2792
- "type": "boolean"
2793
- },
2794
- "limit": {
2795
- "char": "l",
2796
- "description": "Maximum number of records to update (default 200, max 10000)",
2797
- "name": "limit",
2798
- "required": false,
2799
- "default": 200,
2745
+ "scope": {
2746
+ "description": "Transaction scope for flow definition reads",
2747
+ "name": "scope",
2800
2748
  "hasDynamicHelp": false,
2801
2749
  "multiple": false,
2802
2750
  "type": "option"
2803
- }
2804
- },
2805
- "hasDynamicHelp": false,
2806
- "hiddenAliases": [],
2807
- "id": "bulk:update",
2751
+ },
2752
+ "category": {
2753
+ "description": "Category to inspect; repeat to select several, default all",
2754
+ "name": "category",
2755
+ "hasDynamicHelp": false,
2756
+ "multiple": true,
2757
+ "options": [
2758
+ "business_rules",
2759
+ "ui_actions",
2760
+ "client_scripts",
2761
+ "ui_policies",
2762
+ "data_policies",
2763
+ "workflows",
2764
+ "flows",
2765
+ "state_models"
2766
+ ],
2767
+ "type": "option"
2768
+ },
2769
+ "cursor": {
2770
+ "description": "Continuation token; requires exactly one --category and the same filters",
2771
+ "name": "cursor",
2772
+ "hasDynamicHelp": false,
2773
+ "multiple": false,
2774
+ "type": "option"
2775
+ },
2776
+ "include-inactive": {
2777
+ "description": "Include inactive/published and draft candidates when discoverable",
2778
+ "name": "include-inactive",
2779
+ "allowNo": false,
2780
+ "type": "boolean"
2781
+ },
2782
+ "include-inherited": {
2783
+ "description": "Include applicable ancestor behavior",
2784
+ "name": "include-inherited",
2785
+ "allowNo": true,
2786
+ "type": "boolean"
2787
+ },
2788
+ "limit": {
2789
+ "description": "Maximum items per category",
2790
+ "name": "limit",
2791
+ "default": 50,
2792
+ "hasDynamicHelp": false,
2793
+ "multiple": false,
2794
+ "type": "option"
2795
+ },
2796
+ "name": {
2797
+ "description": "Metadata name contains this text",
2798
+ "name": "name",
2799
+ "hasDynamicHelp": false,
2800
+ "multiple": false,
2801
+ "type": "option"
2802
+ },
2803
+ "sys-id": {
2804
+ "description": "Metadata source sys_id to include; repeat for multiple records",
2805
+ "name": "sys-id",
2806
+ "hasDynamicHelp": false,
2807
+ "multiple": true,
2808
+ "type": "option"
2809
+ },
2810
+ "table": {
2811
+ "char": "t",
2812
+ "description": "Target table name",
2813
+ "name": "table",
2814
+ "required": true,
2815
+ "hasDynamicHelp": false,
2816
+ "multiple": false,
2817
+ "type": "option"
2818
+ }
2819
+ },
2820
+ "hasDynamicHelp": false,
2821
+ "hiddenAliases": [],
2822
+ "id": "behavior",
2808
2823
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2809
2824
  "pluginName": "@sonisoft/now-sdk-ext-cli",
2810
2825
  "pluginType": "core",
@@ -2814,72 +2829,38 @@
2814
2829
  "relativePath": [
2815
2830
  "dist",
2816
2831
  "commands",
2817
- "bulk",
2818
- "update.js"
2832
+ "behavior",
2833
+ "index.js"
2819
2834
  ]
2820
2835
  },
2821
- "exec": {
2836
+ "bulk:delete": {
2822
2837
  "aliases": [],
2823
- "args": {
2824
- "scope": {
2825
- "description": "Scope to execute script in. Use \"global\" for global scope.",
2826
- "name": "scope",
2827
- "required": true
2828
- },
2829
- "file": {
2830
- "description": "File to execute in scripts background. If omitted, starts REPL mode.",
2831
- "name": "file",
2832
- "required": false
2833
- }
2834
- },
2835
- "description": "Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.\n\nThis command allows you to run JavaScript either from files or interactively via REPL mode. It mimics the functionality of the Scripts - Background interface in ServiceNow, providing a way to execute scripts programmatically without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.\n\nModes:\n • File Mode: Provide a file path to execute scripts from a file\n • REPL Mode: Omit the file path to start an interactive session\n\nFeatures:\n • Execute local JavaScript files remotely\n • Interactive REPL for ad-hoc script execution\n • Script parameterization with {placeholder} replacement\n • Multi-line script support in REPL\n • Scope-aware execution (global or custom scope)\n • Real-time console output capture\n • Pipe-able output for command chaining\n • Debug logging support\n • Useful for data migration, testing, and administrative tasks\n\nScript Parameterization:\n Use {paramName} placeholders in your script files, then provide values via --params:\n • Supports any JSON-serializable values (strings, numbers, booleans)\n • Multiple parameters supported\n • All occurrences of each placeholder are replaced\n • Example: {token}, {username}, {environment}\n\nREPL Controls:\n • Press Enter to add a new line\n • Type .exec or press Ctrl+D to execute the script\n • Type .clear to clear the current input\n • Type .exit or press Ctrl+C twice to exit REPL\n\n⚠️ IMPORTANT SECURITY WARNING:\nThis command executes scripts with the same permissions and risks as using Scripts - Background directly\nin ServiceNow. Always:\n • Review scripts before execution\n • Test in non-production environments first\n • Use appropriate scoping to limit access\n • Be aware of data modification risks\n • Follow your organization's security policies\n • Never execute untrusted scripts\n\nScript Capabilities:\n Scripts run with full GlideSystem API access and can:\n • Query and modify database records\n • Create, update, and delete data\n • Execute business rules and workflows\n • Access all APIs available in Scripts - Background\n • Use gs, GlideRecord, GlideAggregate, and other server-side APIs",
2838
+ "args": {},
2839
+ "description": "Bulk delete records matching an encoded query.\n\nFinds all records in a table matching the given query, then deletes each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without deleting)\n • Encoded query filtering\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
2836
2840
  "examples": [
2837
2841
  {
2838
- "description": "Start REPL in global scope",
2839
- "command": "<%= config.bin %> <%= command.id %> global --auth dev-instance"
2840
- },
2841
- {
2842
- "description": "Start REPL in custom application scope",
2843
- "command": "<%= config.bin %> <%= command.id %> x_my_custom_app --auth dev-instance"
2844
- },
2845
- {
2846
- "description": "Execute a script file in global scope",
2847
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/cleanup.js --auth dev-instance"
2848
- },
2849
- {
2850
- "description": "Execute a script file in a custom application scope",
2851
- "command": "<%= config.bin %> <%= command.id %> x_my_custom_app ./scripts/app-config.js --auth dev-instance"
2852
- },
2853
- {
2854
- "description": "Execute a parameterized script with single parameter",
2855
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/query-user.js --auth dev-instance --params '{\"username\":\"admin\"}'"
2856
- },
2857
- {
2858
- "description": "Execute a parameterized script with multiple parameters",
2859
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/update-record.js --auth dev-instance --params '{\"table\":\"incident\",\"field\":\"priority\",\"value\":\"1\"}'"
2860
- },
2861
- {
2862
- "description": "Execute and save output to a file",
2863
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
2842
+ "description": "Dry run — see how many records would be deleted",
2843
+ "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --auth dev"
2864
2844
  },
2865
2845
  {
2866
- "description": "Execute and pipe output to grep for filtering",
2867
- "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
2846
+ "description": "Execute the delete (requires --confirm)",
2847
+ "command": "<%= config.bin %> <%= command.id %> --table u_temp_import --query \"sys_created_on<2024-01-01\" --confirm --auth dev"
2868
2848
  },
2869
2849
  {
2870
- "description": "Execute with debug logging to troubleshoot issues",
2871
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
2850
+ "description": "Delete with custom limit",
2851
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=false^closed_at<2023-01-01\" --limit 1000 --confirm --auth dev"
2872
2852
  },
2873
2853
  {
2874
- "description": "Execute with parameters for template replacement",
2875
- "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
2854
+ "description": "Delete as JSON output",
2855
+ "command": "<%= config.bin %> <%= command.id %> --table u_staging --query \"processed=true\" --confirm --json --auth dev"
2876
2856
  }
2877
2857
  ],
2878
2858
  "flags": {
2879
2859
  "json": {
2880
- "description": "Format output as json.",
2881
- "helpGroup": "GLOBAL",
2860
+ "char": "j",
2861
+ "description": "Output results as JSON",
2882
2862
  "name": "json",
2863
+ "required": false,
2883
2864
  "allowNo": false,
2884
2865
  "type": "boolean"
2885
2866
  },
@@ -2957,242 +2938,78 @@
2957
2938
  "allowNo": false,
2958
2939
  "type": "boolean"
2959
2940
  },
2960
- "params": {
2961
- "char": "p",
2962
- "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
2963
- "name": "params",
2964
- "required": false,
2941
+ "table": {
2942
+ "char": "t",
2943
+ "description": "Table name to delete records from",
2944
+ "name": "table",
2945
+ "required": true,
2965
2946
  "hasDynamicHelp": false,
2966
2947
  "multiple": false,
2967
- "type": "option"
2968
- }
2969
- },
2970
- "hasDynamicHelp": false,
2971
- "hiddenAliases": [],
2972
- "id": "exec",
2973
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
2974
- "pluginName": "@sonisoft/now-sdk-ext-cli",
2975
- "pluginType": "core",
2976
- "strict": true,
2977
- "enableJsonFlag": true,
2978
- "autocomplete": {},
2979
- "isESM": true,
2980
- "relativePath": [
2981
- "dist",
2982
- "commands",
2983
- "exec",
2984
- "index.js"
2985
- ]
2986
- },
2987
- "auth:delete": {
2988
- "aliases": [],
2989
- "args": {
2990
- "alias": {
2991
- "description": "Alias to remove",
2992
- "name": "alias",
2993
- "required": false
2994
- }
2995
- },
2996
- "description": "Remove a credential from the store.\n\nThis does not touch the OS keyring — a copy stored there before migrating remains.",
2997
- "examples": [
2998
- {
2999
- "command": "<%= config.bin %> <%= command.id %> dev206299",
3000
- "description": "Remove one alias"
3001
- },
3002
- {
3003
- "command": "<%= config.bin %> <%= command.id %> --all",
3004
- "description": "Remove every stored credential"
3005
- }
3006
- ],
3007
- "flags": {
3008
- "cred-store": {
3009
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3010
- "helpGroup": "GLOBAL",
3011
- "name": "cred-store",
3012
- "required": false,
3013
- "allowNo": false,
3014
- "type": "boolean"
3015
- },
3016
- "all": {
3017
- "description": "Remove every stored credential",
3018
- "name": "all",
3019
- "required": false,
3020
- "allowNo": false,
3021
- "type": "boolean"
3022
- }
3023
- },
3024
- "hasDynamicHelp": false,
3025
- "hiddenAliases": [],
3026
- "id": "auth:delete",
3027
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3028
- "pluginName": "@sonisoft/now-sdk-ext-cli",
3029
- "pluginType": "core",
3030
- "strict": true,
3031
- "enableJsonFlag": false,
3032
- "isESM": true,
3033
- "relativePath": [
3034
- "dist",
3035
- "commands",
3036
- "auth",
3037
- "delete.js"
3038
- ]
3039
- },
3040
- "auth:doctor": {
3041
- "aliases": [],
3042
- "args": {},
3043
- "description": "Diagnose credential storage: whether the SDK shim is active, which backend is in use, and what is stored.",
3044
- "examples": [
3045
- {
3046
- "command": "<%= config.bin %> <%= command.id %>",
3047
- "description": "Check credential storage health"
3048
- },
3049
- {
3050
- "command": "<%= config.bin %> <%= command.id %> --json",
3051
- "description": "Machine-readable output for CI"
3052
- }
3053
- ],
3054
- "flags": {
3055
- "json": {
3056
- "description": "Format output as json.",
3057
- "helpGroup": "GLOBAL",
3058
- "name": "json",
3059
- "allowNo": false,
3060
- "type": "boolean"
3061
- },
3062
- "cred-store": {
3063
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3064
- "helpGroup": "GLOBAL",
3065
- "name": "cred-store",
3066
- "required": false,
3067
- "allowNo": false,
3068
- "type": "boolean"
3069
- }
3070
- },
3071
- "hasDynamicHelp": false,
3072
- "hiddenAliases": [],
3073
- "id": "auth:doctor",
3074
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3075
- "pluginName": "@sonisoft/now-sdk-ext-cli",
3076
- "pluginType": "core",
3077
- "strict": true,
3078
- "enableJsonFlag": true,
3079
- "isESM": true,
3080
- "relativePath": [
3081
- "dist",
3082
- "commands",
3083
- "auth",
3084
- "doctor.js"
3085
- ]
3086
- },
3087
- "auth:list": {
3088
- "aliases": [],
3089
- "args": {},
3090
- "description": "List credentials in the headless-safe credential store.\n\nThese are the credentials the ServiceNow SDK reads via the sn-credstore shim, which works in non-interactive sessions where the OS keyring cannot be unlocked.\n\nSecrets are never printed.",
3091
- "examples": [
3092
- {
3093
- "command": "<%= config.bin %> <%= command.id %>",
3094
- "description": "List stored credentials"
3095
- },
3096
- {
3097
- "command": "<%= config.bin %> <%= command.id %> --json",
3098
- "description": "List as JSON for scripting"
3099
- }
3100
- ],
3101
- "flags": {
3102
- "json": {
3103
- "description": "Format output as json.",
3104
- "helpGroup": "GLOBAL",
3105
- "name": "json",
3106
- "allowNo": false,
3107
- "type": "boolean"
3108
- },
3109
- "cred-store": {
3110
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3111
- "helpGroup": "GLOBAL",
3112
- "name": "cred-store",
3113
- "required": false,
3114
- "allowNo": false,
3115
- "type": "boolean"
3116
- }
3117
- },
3118
- "hasDynamicHelp": false,
3119
- "hiddenAliases": [],
3120
- "id": "auth:list",
3121
- "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3122
- "pluginName": "@sonisoft/now-sdk-ext-cli",
3123
- "pluginType": "core",
3124
- "strict": true,
3125
- "enableJsonFlag": true,
3126
- "isESM": true,
3127
- "relativePath": [
3128
- "dist",
3129
- "commands",
3130
- "auth",
3131
- "list.js"
3132
- ]
3133
- },
3134
- "auth:use": {
3135
- "aliases": [],
3136
- "args": {
3137
- "alias": {
3138
- "description": "Alias to make the default",
3139
- "name": "alias",
3140
- "required": true
3141
- }
3142
- },
3143
- "description": "Set the default credential alias.\n\nCommands run without --auth use this alias.",
3144
- "examples": [
3145
- {
3146
- "command": "<%= config.bin %> <%= command.id %> dev206299",
3147
- "description": "Make dev206299 the default"
3148
- }
3149
- ],
3150
- "flags": {
3151
- "cred-store": {
3152
- "description": "Accepted for symmetry with other commands and ignored — the auth commands always use @sonisoft/sn-credstore.",
3153
- "helpGroup": "GLOBAL",
3154
- "name": "cred-store",
2948
+ "type": "option"
2949
+ },
2950
+ "query": {
2951
+ "char": "q",
2952
+ "description": "Encoded query to match records for deletion",
2953
+ "name": "query",
2954
+ "required": true,
2955
+ "hasDynamicHelp": false,
2956
+ "multiple": false,
2957
+ "type": "option"
2958
+ },
2959
+ "confirm": {
2960
+ "description": "Execute the delete (without this flag, performs a dry run)",
2961
+ "name": "confirm",
3155
2962
  "required": false,
3156
2963
  "allowNo": false,
3157
2964
  "type": "boolean"
2965
+ },
2966
+ "limit": {
2967
+ "char": "l",
2968
+ "description": "Maximum number of records to delete (default 200, max 10000)",
2969
+ "name": "limit",
2970
+ "required": false,
2971
+ "default": 200,
2972
+ "hasDynamicHelp": false,
2973
+ "multiple": false,
2974
+ "type": "option"
3158
2975
  }
3159
2976
  },
3160
2977
  "hasDynamicHelp": false,
3161
2978
  "hiddenAliases": [],
3162
- "id": "auth:use",
2979
+ "id": "bulk:delete",
3163
2980
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3164
2981
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3165
2982
  "pluginType": "core",
3166
2983
  "strict": true,
3167
- "enableJsonFlag": false,
2984
+ "enableJsonFlag": true,
3168
2985
  "isESM": true,
3169
2986
  "relativePath": [
3170
2987
  "dist",
3171
2988
  "commands",
3172
- "auth",
3173
- "use.js"
2989
+ "bulk",
2990
+ "delete.js"
3174
2991
  ]
3175
2992
  },
3176
- "health:check": {
2993
+ "bulk:update": {
3177
2994
  "aliases": [],
3178
2995
  "args": {},
3179
- "description": "Run a consolidated health check on a ServiceNow instance.\n\nPerforms comprehensive diagnostics including version info, cluster status, stuck job detection, semaphore counts, and operational record counts.\n\nFeatures:\n • Instance version and build information\n • Cluster node status\n • Stuck job detection with configurable threshold\n • Active semaphore count\n • Operational counts (incidents, changes, problems)\n • Color-coded status indicators\n • JSON output for CI/CD monitoring",
2996
+ "description": "Bulk update records matching an encoded query.\n\nFinds all records in a table matching the given query, then applies field updates to each one. Defaults to dry-run mode — use --confirm to execute.\n\nFeatures:\n • Safe dry-run by default (shows match count without modifying data)\n • Encoded query filtering\n • JSON field=value pairs for update data\n • Configurable record limit (default 200, max 10000)\n • Progress reporting for large operations\n • Error collection — operation continues even if individual records fail",
3180
2997
  "examples": [
3181
2998
  {
3182
- "description": "Run full health check",
3183
- "command": "<%= config.bin %> <%= command.id %> --auth dev"
2999
+ "description": "Dry run — see how many records would be updated",
3000
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --auth dev"
3184
3001
  },
3185
3002
  {
3186
- "description": "Check only version and stuck jobs",
3187
- "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
3003
+ "description": "Execute the update (requires --confirm)",
3004
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true^priority=5\" --data '{\"priority\":\"4\"}' --confirm --auth dev"
3188
3005
  },
3189
3006
  {
3190
- "description": "Health check with custom stuck job threshold",
3191
- "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
3007
+ "description": "Update with custom limit",
3008
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"state=1\" --data '{\"assignment_group\":\"group-sys-id\"}' --limit 500 --confirm --auth dev"
3192
3009
  },
3193
3010
  {
3194
- "description": "Health check as JSON",
3195
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
3011
+ "description": "Update as JSON output",
3012
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --data '{\"state\":\"6\"}' --confirm --json --auth dev"
3196
3013
  }
3197
3014
  ],
3198
3015
  "flags": {
@@ -3278,46 +3095,211 @@
3278
3095
  "allowNo": false,
3279
3096
  "type": "boolean"
3280
3097
  },
3281
- "include-version": {
3282
- "description": "Include instance version information",
3283
- "name": "include-version",
3098
+ "table": {
3099
+ "char": "t",
3100
+ "description": "Table name to update records in",
3101
+ "name": "table",
3102
+ "required": true,
3103
+ "hasDynamicHelp": false,
3104
+ "multiple": false,
3105
+ "type": "option"
3106
+ },
3107
+ "query": {
3108
+ "char": "q",
3109
+ "description": "Encoded query to match records",
3110
+ "name": "query",
3111
+ "required": true,
3112
+ "hasDynamicHelp": false,
3113
+ "multiple": false,
3114
+ "type": "option"
3115
+ },
3116
+ "data": {
3117
+ "char": "d",
3118
+ "description": "JSON object of field=value pairs to apply (e.g. '{\"priority\":\"4\",\"state\":\"2\"}')",
3119
+ "name": "data",
3120
+ "required": true,
3121
+ "hasDynamicHelp": false,
3122
+ "multiple": false,
3123
+ "type": "option"
3124
+ },
3125
+ "confirm": {
3126
+ "description": "Execute the update (without this flag, performs a dry run)",
3127
+ "name": "confirm",
3284
3128
  "required": false,
3285
- "allowNo": true,
3129
+ "allowNo": false,
3286
3130
  "type": "boolean"
3287
3131
  },
3288
- "include-cluster": {
3289
- "description": "Include cluster node status",
3290
- "name": "include-cluster",
3132
+ "limit": {
3133
+ "char": "l",
3134
+ "description": "Maximum number of records to update (default 200, max 10000)",
3135
+ "name": "limit",
3291
3136
  "required": false,
3292
- "allowNo": true,
3137
+ "default": 200,
3138
+ "hasDynamicHelp": false,
3139
+ "multiple": false,
3140
+ "type": "option"
3141
+ }
3142
+ },
3143
+ "hasDynamicHelp": false,
3144
+ "hiddenAliases": [],
3145
+ "id": "bulk:update",
3146
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3147
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
3148
+ "pluginType": "core",
3149
+ "strict": true,
3150
+ "enableJsonFlag": true,
3151
+ "isESM": true,
3152
+ "relativePath": [
3153
+ "dist",
3154
+ "commands",
3155
+ "bulk",
3156
+ "update.js"
3157
+ ]
3158
+ },
3159
+ "exec": {
3160
+ "aliases": [],
3161
+ "args": {
3162
+ "scope": {
3163
+ "description": "Scope to execute script in. Use \"global\" for global scope.",
3164
+ "name": "scope",
3165
+ "required": true
3166
+ },
3167
+ "file": {
3168
+ "description": "File to execute in scripts background. If omitted, starts REPL mode.",
3169
+ "name": "file",
3170
+ "required": false
3171
+ }
3172
+ },
3173
+ "description": "Execute JavaScript on a ServiceNow instance remotely using Scripts - Background.\n\nThis command allows you to run JavaScript either from files or interactively via REPL mode. It mimics the functionality of the Scripts - Background interface in ServiceNow, providing a way to execute scripts programmatically without manual interaction. The output is returned in real-time and can be piped to other commands or saved to files.\n\nModes:\n • File Mode: Provide a file path to execute scripts from a file\n • REPL Mode: Omit the file path to start an interactive session\n\nFeatures:\n • Execute local JavaScript files remotely\n • Interactive REPL for ad-hoc script execution\n • Script parameterization with {placeholder} replacement\n • Multi-line script support in REPL\n • Scope-aware execution (global or custom scope)\n • Real-time console output capture\n • Pipe-able output for command chaining\n • Debug logging support\n • Useful for data migration, testing, and administrative tasks\n\nScript Parameterization:\n Use {paramName} placeholders in your script files, then provide values via --params:\n • Supports any JSON-serializable values (strings, numbers, booleans)\n • Multiple parameters supported\n • All occurrences of each placeholder are replaced\n • Example: {token}, {username}, {environment}\n\nREPL Controls:\n • Press Enter to add a new line\n • Type .exec or press Ctrl+D to execute the script\n • Type .clear to clear the current input\n • Type .exit or press Ctrl+C twice to exit REPL\n\n⚠️ IMPORTANT SECURITY WARNING:\nThis command executes scripts with the same permissions and risks as using Scripts - Background directly\nin ServiceNow. Always:\n • Review scripts before execution\n • Test in non-production environments first\n • Use appropriate scoping to limit access\n • Be aware of data modification risks\n • Follow your organization's security policies\n • Never execute untrusted scripts\n\nScript Capabilities:\n Scripts run with full GlideSystem API access and can:\n • Query and modify database records\n • Create, update, and delete data\n • Execute business rules and workflows\n • Access all APIs available in Scripts - Background\n • Use gs, GlideRecord, GlideAggregate, and other server-side APIs",
3174
+ "examples": [
3175
+ {
3176
+ "description": "Start REPL in global scope",
3177
+ "command": "<%= config.bin %> <%= command.id %> global --auth dev-instance"
3178
+ },
3179
+ {
3180
+ "description": "Start REPL in custom application scope",
3181
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app --auth dev-instance"
3182
+ },
3183
+ {
3184
+ "description": "Execute a script file in global scope",
3185
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/cleanup.js --auth dev-instance"
3186
+ },
3187
+ {
3188
+ "description": "Execute a script file in a custom application scope",
3189
+ "command": "<%= config.bin %> <%= command.id %> x_my_custom_app ./scripts/app-config.js --auth dev-instance"
3190
+ },
3191
+ {
3192
+ "description": "Execute a parameterized script with single parameter",
3193
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/query-user.js --auth dev-instance --params '{\"username\":\"admin\"}'"
3194
+ },
3195
+ {
3196
+ "description": "Execute a parameterized script with multiple parameters",
3197
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/update-record.js --auth dev-instance --params '{\"table\":\"incident\",\"field\":\"priority\",\"value\":\"1\"}'"
3198
+ },
3199
+ {
3200
+ "description": "Execute and save output to a file",
3201
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/report.js --auth dev-instance > report.txt"
3202
+ },
3203
+ {
3204
+ "description": "Execute and pipe output to grep for filtering",
3205
+ "command": "<%= config.bin %> <%= command.id %> global ./scripts/list-users.js --auth dev-instance | grep \"admin\""
3206
+ },
3207
+ {
3208
+ "description": "Execute with debug logging to troubleshoot issues",
3209
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --log-level debug"
3210
+ },
3211
+ {
3212
+ "description": "Execute with parameters for template replacement",
3213
+ "command": "<%= config.bin %> <%= command.id %> global ./script.js --auth dev-instance --params '{\"token\":\"abc123\",\"env\":\"dev\"}'"
3214
+ }
3215
+ ],
3216
+ "flags": {
3217
+ "json": {
3218
+ "description": "Format output as json.",
3219
+ "helpGroup": "GLOBAL",
3220
+ "name": "json",
3221
+ "allowNo": false,
3293
3222
  "type": "boolean"
3294
3223
  },
3295
- "include-stuck-jobs": {
3296
- "description": "Include stuck job detection",
3297
- "name": "include-stuck-jobs",
3224
+ "auth": {
3225
+ "char": "a",
3226
+ "description": "Auth alias to use.",
3227
+ "name": "auth",
3298
3228
  "required": false,
3299
- "allowNo": true,
3229
+ "hasDynamicHelp": false,
3230
+ "multiple": false,
3231
+ "type": "option"
3232
+ },
3233
+ "cred-store": {
3234
+ "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
3235
+ "helpGroup": "GLOBAL",
3236
+ "name": "cred-store",
3237
+ "required": false,
3238
+ "allowNo": false,
3300
3239
  "type": "boolean"
3301
3240
  },
3302
- "include-semaphores": {
3303
- "description": "Include active semaphore count",
3304
- "name": "include-semaphores",
3241
+ "deny-execute": {
3242
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
3243
+ "helpGroup": "GLOBAL",
3244
+ "name": "deny-execute",
3305
3245
  "required": false,
3306
- "allowNo": true,
3246
+ "allowNo": false,
3307
3247
  "type": "boolean"
3308
3248
  },
3309
- "include-operational-counts": {
3310
- "description": "Include operational record counts (incidents, changes, problems)",
3311
- "name": "include-operational-counts",
3249
+ "deny-write": {
3250
+ "description": "Refuse any change to instance data for this invocation.",
3251
+ "helpGroup": "GLOBAL",
3252
+ "name": "deny-write",
3312
3253
  "required": false,
3313
- "allowNo": true,
3254
+ "allowNo": false,
3255
+ "type": "boolean"
3256
+ },
3257
+ "log-dir": {
3258
+ "description": "Directory to write log files to. Implies --log-file.",
3259
+ "helpGroup": "GLOBAL",
3260
+ "name": "log-dir",
3261
+ "required": false,
3262
+ "hasDynamicHelp": false,
3263
+ "multiple": false,
3264
+ "type": "option"
3265
+ },
3266
+ "log-file": {
3267
+ "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
3268
+ "helpGroup": "GLOBAL",
3269
+ "name": "log-file",
3270
+ "required": false,
3271
+ "allowNo": false,
3272
+ "type": "boolean"
3273
+ },
3274
+ "log-level": {
3275
+ "helpGroup": "GLOBAL",
3276
+ "name": "log-level",
3277
+ "summary": "Specify level for logging.",
3278
+ "default": "info",
3279
+ "hasDynamicHelp": false,
3280
+ "multiple": false,
3281
+ "options": [
3282
+ "debug",
3283
+ "warn",
3284
+ "error",
3285
+ "info",
3286
+ "trace"
3287
+ ],
3288
+ "type": "option"
3289
+ },
3290
+ "read-only": {
3291
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
3292
+ "helpGroup": "GLOBAL",
3293
+ "name": "read-only",
3294
+ "required": false,
3295
+ "allowNo": false,
3314
3296
  "type": "boolean"
3315
3297
  },
3316
- "stuck-job-threshold": {
3317
- "description": "Minutes threshold for a job to be considered stuck",
3318
- "name": "stuck-job-threshold",
3298
+ "params": {
3299
+ "char": "p",
3300
+ "description": "JSON object of parameters to replace in script file. Use {paramName} syntax in your script.",
3301
+ "name": "params",
3319
3302
  "required": false,
3320
- "default": 30,
3321
3303
  "hasDynamicHelp": false,
3322
3304
  "multiple": false,
3323
3305
  "type": "option"
@@ -3325,18 +3307,19 @@
3325
3307
  },
3326
3308
  "hasDynamicHelp": false,
3327
3309
  "hiddenAliases": [],
3328
- "id": "health:check",
3310
+ "id": "exec",
3329
3311
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
3330
3312
  "pluginName": "@sonisoft/now-sdk-ext-cli",
3331
3313
  "pluginType": "core",
3332
3314
  "strict": true,
3333
3315
  "enableJsonFlag": true,
3316
+ "autocomplete": {},
3334
3317
  "isESM": true,
3335
3318
  "relativePath": [
3336
3319
  "dist",
3337
3320
  "commands",
3338
- "health",
3339
- "check.js"
3321
+ "exec",
3322
+ "index.js"
3340
3323
  ]
3341
3324
  },
3342
3325
  "flow:action": {
@@ -5244,45 +5227,159 @@
5244
5227
  "test.js"
5245
5228
  ]
5246
5229
  },
5247
- "policy:status": {
5230
+ "health:check": {
5248
5231
  "aliases": [],
5249
5232
  "args": {},
5250
- "description": "Show what this invocation is permitted to change on the instance, and why.\n\nChanges are permitted by default. NEX_POLICY_DENY, set in the environment, outranks every command-line flag — that is the only layer an agent driving this CLI cannot reach.",
5233
+ "description": "Run a consolidated health check on a ServiceNow instance.\n\nPerforms comprehensive diagnostics including version info, cluster status, stuck job detection, semaphore counts, and operational record counts.\n\nFeatures:\n • Instance version and build information\n • Cluster node status\n • Stuck job detection with configurable threshold\n • Active semaphore count\n • Operational counts (incidents, changes, problems)\n • Color-coded status indicators\n • JSON output for CI/CD monitoring",
5251
5234
  "examples": [
5252
- "<%= config.bin %> <%= command.id %>",
5253
- "<%= config.bin %> <%= command.id %> --read-only",
5254
- "NEX_POLICY_DENY=all <%= config.bin %> <%= command.id %>"
5235
+ {
5236
+ "description": "Run full health check",
5237
+ "command": "<%= config.bin %> <%= command.id %> --auth dev"
5238
+ },
5239
+ {
5240
+ "description": "Check only version and stuck jobs",
5241
+ "command": "<%= config.bin %> <%= command.id %> --include-version --include-stuck-jobs --no-include-cluster --no-include-semaphores --no-include-operational-counts --auth dev"
5242
+ },
5243
+ {
5244
+ "description": "Health check with custom stuck job threshold",
5245
+ "command": "<%= config.bin %> <%= command.id %> --stuck-job-threshold 60 --auth dev"
5246
+ },
5247
+ {
5248
+ "description": "Health check as JSON",
5249
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev"
5250
+ }
5255
5251
  ],
5256
5252
  "flags": {
5257
5253
  "json": {
5258
- "description": "Format output as json.",
5259
- "helpGroup": "GLOBAL",
5254
+ "char": "j",
5255
+ "description": "Output results as JSON",
5260
5256
  "name": "json",
5257
+ "required": false,
5258
+ "allowNo": false,
5259
+ "type": "boolean"
5260
+ },
5261
+ "auth": {
5262
+ "char": "a",
5263
+ "description": "Auth alias to use.",
5264
+ "name": "auth",
5265
+ "required": false,
5266
+ "hasDynamicHelp": false,
5267
+ "multiple": false,
5268
+ "type": "option"
5269
+ },
5270
+ "cred-store": {
5271
+ "description": "Read credentials from @sonisoft/sn-credstore instead of the OS keyring. Use this in headless sessions (SSH, systemd, CI, agents) where the keyring cannot be unlocked.",
5272
+ "helpGroup": "GLOBAL",
5273
+ "name": "cred-store",
5274
+ "required": false,
5261
5275
  "allowNo": false,
5262
5276
  "type": "boolean"
5263
5277
  },
5264
5278
  "deny-execute": {
5265
- "description": "Evaluate as if --deny-execute were passed.",
5279
+ "description": "Refuse background scripts, flow runs and ATF runs for this invocation.",
5280
+ "helpGroup": "GLOBAL",
5266
5281
  "name": "deny-execute",
5282
+ "required": false,
5267
5283
  "allowNo": false,
5268
5284
  "type": "boolean"
5269
5285
  },
5270
5286
  "deny-write": {
5271
- "description": "Evaluate as if --deny-write were passed.",
5287
+ "description": "Refuse any change to instance data for this invocation.",
5288
+ "helpGroup": "GLOBAL",
5272
5289
  "name": "deny-write",
5290
+ "required": false,
5291
+ "allowNo": false,
5292
+ "type": "boolean"
5293
+ },
5294
+ "log-dir": {
5295
+ "description": "Directory to write log files to. Implies --log-file.",
5296
+ "helpGroup": "GLOBAL",
5297
+ "name": "log-dir",
5298
+ "required": false,
5299
+ "hasDynamicHelp": false,
5300
+ "multiple": false,
5301
+ "type": "option"
5302
+ },
5303
+ "log-file": {
5304
+ "description": "Write logs to a file. Defaults to $XDG_STATE_HOME/now-sdk-ext/logs (~/.local/state/now-sdk-ext/logs). Off by default; without this, nex logs warnings and errors to stderr only.",
5305
+ "helpGroup": "GLOBAL",
5306
+ "name": "log-file",
5307
+ "required": false,
5273
5308
  "allowNo": false,
5274
5309
  "type": "boolean"
5275
5310
  },
5311
+ "log-level": {
5312
+ "helpGroup": "GLOBAL",
5313
+ "name": "log-level",
5314
+ "summary": "Specify level for logging.",
5315
+ "default": "info",
5316
+ "hasDynamicHelp": false,
5317
+ "multiple": false,
5318
+ "options": [
5319
+ "debug",
5320
+ "warn",
5321
+ "error",
5322
+ "info",
5323
+ "trace"
5324
+ ],
5325
+ "type": "option"
5326
+ },
5276
5327
  "read-only": {
5277
- "description": "Evaluate as if --read-only were passed.",
5328
+ "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
5329
+ "helpGroup": "GLOBAL",
5278
5330
  "name": "read-only",
5331
+ "required": false,
5279
5332
  "allowNo": false,
5280
5333
  "type": "boolean"
5334
+ },
5335
+ "include-version": {
5336
+ "description": "Include instance version information",
5337
+ "name": "include-version",
5338
+ "required": false,
5339
+ "allowNo": true,
5340
+ "type": "boolean"
5341
+ },
5342
+ "include-cluster": {
5343
+ "description": "Include cluster node status",
5344
+ "name": "include-cluster",
5345
+ "required": false,
5346
+ "allowNo": true,
5347
+ "type": "boolean"
5348
+ },
5349
+ "include-stuck-jobs": {
5350
+ "description": "Include stuck job detection",
5351
+ "name": "include-stuck-jobs",
5352
+ "required": false,
5353
+ "allowNo": true,
5354
+ "type": "boolean"
5355
+ },
5356
+ "include-semaphores": {
5357
+ "description": "Include active semaphore count",
5358
+ "name": "include-semaphores",
5359
+ "required": false,
5360
+ "allowNo": true,
5361
+ "type": "boolean"
5362
+ },
5363
+ "include-operational-counts": {
5364
+ "description": "Include operational record counts (incidents, changes, problems)",
5365
+ "name": "include-operational-counts",
5366
+ "required": false,
5367
+ "allowNo": true,
5368
+ "type": "boolean"
5369
+ },
5370
+ "stuck-job-threshold": {
5371
+ "description": "Minutes threshold for a job to be considered stuck",
5372
+ "name": "stuck-job-threshold",
5373
+ "required": false,
5374
+ "default": 30,
5375
+ "hasDynamicHelp": false,
5376
+ "multiple": false,
5377
+ "type": "option"
5281
5378
  }
5282
5379
  },
5283
5380
  "hasDynamicHelp": false,
5284
5381
  "hiddenAliases": [],
5285
- "id": "policy:status",
5382
+ "id": "health:check",
5286
5383
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5287
5384
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5288
5385
  "pluginType": "core",
@@ -5292,8 +5389,8 @@
5292
5389
  "relativePath": [
5293
5390
  "dist",
5294
5391
  "commands",
5295
- "policy",
5296
- "status.js"
5392
+ "health",
5393
+ "check.js"
5297
5394
  ]
5298
5395
  },
5299
5396
  "log": {
@@ -5468,18 +5565,70 @@
5468
5565
  "index.js"
5469
5566
  ]
5470
5567
  },
5471
- "schema:field": {
5568
+ "policy:status": {
5472
5569
  "aliases": [],
5473
5570
  "args": {},
5474
- "description": "Get detailed information about a specific field on a ServiceNow table.\n\nThis command retrieves comprehensive details about a single field, including its type, constraints, choices, and other metadata. Useful for understanding field definitions during development.",
5571
+ "description": "Show what this invocation is permitted to change on the instance, and why.\n\nChanges are permitted by default. NEX_POLICY_DENY, set in the environment, outranks every command-line flag — that is the only layer an agent driving this CLI cannot reach.",
5572
+ "examples": [
5573
+ "<%= config.bin %> <%= command.id %>",
5574
+ "<%= config.bin %> <%= command.id %> --read-only",
5575
+ "NEX_POLICY_DENY=all <%= config.bin %> <%= command.id %>"
5576
+ ],
5577
+ "flags": {
5578
+ "json": {
5579
+ "description": "Format output as json.",
5580
+ "helpGroup": "GLOBAL",
5581
+ "name": "json",
5582
+ "allowNo": false,
5583
+ "type": "boolean"
5584
+ },
5585
+ "deny-execute": {
5586
+ "description": "Evaluate as if --deny-execute were passed.",
5587
+ "name": "deny-execute",
5588
+ "allowNo": false,
5589
+ "type": "boolean"
5590
+ },
5591
+ "deny-write": {
5592
+ "description": "Evaluate as if --deny-write were passed.",
5593
+ "name": "deny-write",
5594
+ "allowNo": false,
5595
+ "type": "boolean"
5596
+ },
5597
+ "read-only": {
5598
+ "description": "Evaluate as if --read-only were passed.",
5599
+ "name": "read-only",
5600
+ "allowNo": false,
5601
+ "type": "boolean"
5602
+ }
5603
+ },
5604
+ "hasDynamicHelp": false,
5605
+ "hiddenAliases": [],
5606
+ "id": "policy:status",
5607
+ "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5608
+ "pluginName": "@sonisoft/now-sdk-ext-cli",
5609
+ "pluginType": "core",
5610
+ "strict": true,
5611
+ "enableJsonFlag": true,
5612
+ "isESM": true,
5613
+ "relativePath": [
5614
+ "dist",
5615
+ "commands",
5616
+ "policy",
5617
+ "status.js"
5618
+ ]
5619
+ },
5620
+ "query:app": {
5621
+ "aliases": [],
5622
+ "args": {},
5623
+ "description": "Search for applications by name across scoped apps and plugins.\n\nSearches the sys_scope table for applications matching the provided search term.\n\nFeatures:\n • Search by name (case-insensitive contains)\n • Filter active/inactive applications\n • Configurable result limit\n • JSON output for scripting",
5475
5624
  "examples": [
5476
5625
  {
5477
- "description": "Explain the state field on incident table",
5478
- "command": "<%= config.bin %> <%= command.id %> --table incident --field state --auth dev"
5626
+ "description": "Search for ITSM applications",
5627
+ "command": "<%= config.bin %> <%= command.id %> --search \"ITSM\" --auth dev"
5479
5628
  },
5480
5629
  {
5481
- "description": "Explain the priority field on incident table with JSON output",
5482
- "command": "<%= config.bin %> <%= command.id %> --table incident --field priority --json --auth dev"
5630
+ "description": "Search active apps only",
5631
+ "command": "<%= config.bin %> <%= command.id %> --search \"HR\" --active --auth dev"
5483
5632
  }
5484
5633
  ],
5485
5634
  "flags": {
@@ -5565,20 +5714,29 @@
5565
5714
  "allowNo": false,
5566
5715
  "type": "boolean"
5567
5716
  },
5568
- "table": {
5569
- "char": "t",
5570
- "description": "ServiceNow table name",
5571
- "name": "table",
5717
+ "search": {
5718
+ "char": "s",
5719
+ "description": "Application name search term",
5720
+ "name": "search",
5572
5721
  "required": true,
5573
5722
  "hasDynamicHelp": false,
5574
5723
  "multiple": false,
5575
5724
  "type": "option"
5576
5725
  },
5577
- "field": {
5578
- "char": "f",
5579
- "description": "Field name to explain",
5580
- "name": "field",
5581
- "required": true,
5726
+ "active": {
5727
+ "char": "a",
5728
+ "description": "Only show active applications",
5729
+ "name": "active",
5730
+ "required": false,
5731
+ "allowNo": false,
5732
+ "type": "boolean"
5733
+ },
5734
+ "limit": {
5735
+ "char": "l",
5736
+ "description": "Maximum number of results to return",
5737
+ "name": "limit",
5738
+ "required": false,
5739
+ "default": 20,
5582
5740
  "hasDynamicHelp": false,
5583
5741
  "multiple": false,
5584
5742
  "type": "option"
@@ -5586,7 +5744,7 @@
5586
5744
  },
5587
5745
  "hasDynamicHelp": false,
5588
5746
  "hiddenAliases": [],
5589
- "id": "schema:field",
5747
+ "id": "query:app",
5590
5748
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5591
5749
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5592
5750
  "pluginType": "core",
@@ -5596,22 +5754,26 @@
5596
5754
  "relativePath": [
5597
5755
  "dist",
5598
5756
  "commands",
5599
- "schema",
5600
- "field.js"
5757
+ "query",
5758
+ "app.js"
5601
5759
  ]
5602
5760
  },
5603
- "schema": {
5761
+ "query:columns": {
5604
5762
  "aliases": [],
5605
5763
  "args": {},
5606
- "description": "Discover and inspect a ServiceNow table schema including fields, types, and relationships.\n\nThis command retrieves the full schema definition for a ServiceNow table, including all fields, their types, constraints, and optionally choices, relationships, UI policies, and business rules.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Optionally include field choices\n • Optionally include table relationships\n • Optionally include UI policies\n • Optionally include business rules\n • JSON output for CI/CD integration",
5764
+ "description": "List and search columns (fields) on a ServiceNow table.\n\nRetrieves all field definitions for a table from the sys_dictionary, with optional name/label filtering.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Search/filter fields by name or label\n • JSON output for scripting",
5607
5765
  "examples": [
5608
5766
  {
5609
- "description": "Discover incident table schema",
5767
+ "description": "List all columns on the incident table",
5610
5768
  "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
5611
5769
  },
5612
5770
  {
5613
- "description": "Include choices and relationships",
5614
- "command": "<%= config.bin %> <%= command.id %> --table incident --include-choices --include-relationships --auth dev"
5771
+ "description": "Search for date-related columns",
5772
+ "command": "<%= config.bin %> <%= command.id %> --table incident --search \"date\" --auth dev"
5773
+ },
5774
+ {
5775
+ "description": "List columns as JSON",
5776
+ "command": "<%= config.bin %> <%= command.id %> --table incident --json --auth dev"
5615
5777
  }
5616
5778
  ],
5617
5779
  "flags": {
@@ -5699,45 +5861,26 @@
5699
5861
  },
5700
5862
  "table": {
5701
5863
  "char": "t",
5702
- "description": "ServiceNow table name to discover schema for",
5864
+ "description": "ServiceNow table name to list columns for",
5703
5865
  "name": "table",
5704
5866
  "required": true,
5705
5867
  "hasDynamicHelp": false,
5706
5868
  "multiple": false,
5707
5869
  "type": "option"
5708
5870
  },
5709
- "include-choices": {
5710
- "description": "Include field choices in the schema output",
5711
- "name": "include-choices",
5712
- "required": false,
5713
- "allowNo": false,
5714
- "type": "boolean"
5715
- },
5716
- "include-relationships": {
5717
- "description": "Include table relationships in the schema output",
5718
- "name": "include-relationships",
5719
- "required": false,
5720
- "allowNo": false,
5721
- "type": "boolean"
5722
- },
5723
- "include-ui-policies": {
5724
- "description": "Include UI policies in the schema output",
5725
- "name": "include-ui-policies",
5726
- "required": false,
5727
- "allowNo": false,
5728
- "type": "boolean"
5729
- },
5730
- "include-business-rules": {
5731
- "description": "Include business rules in the schema output",
5732
- "name": "include-business-rules",
5871
+ "search": {
5872
+ "char": "s",
5873
+ "description": "Filter columns by name or label (case-insensitive)",
5874
+ "name": "search",
5733
5875
  "required": false,
5734
- "allowNo": false,
5735
- "type": "boolean"
5876
+ "hasDynamicHelp": false,
5877
+ "multiple": false,
5878
+ "type": "option"
5736
5879
  }
5737
5880
  },
5738
5881
  "hasDynamicHelp": false,
5739
5882
  "hiddenAliases": [],
5740
- "id": "schema",
5883
+ "id": "query:columns",
5741
5884
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5742
5885
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5743
5886
  "pluginType": "core",
@@ -5747,22 +5890,26 @@
5747
5890
  "relativePath": [
5748
5891
  "dist",
5749
5892
  "commands",
5750
- "schema",
5751
- "index.js"
5893
+ "query",
5894
+ "columns.js"
5752
5895
  ]
5753
5896
  },
5754
- "schema:validate-catalog": {
5897
+ "query": {
5755
5898
  "aliases": [],
5756
5899
  "args": {},
5757
- "description": "Validate a ServiceNow catalog item configuration for common issues.\n\nThis command checks a catalog item configuration and reports any validation issues, warnings, or errors found. Useful for ensuring catalog items are properly configured before deployment.",
5900
+ "description": "Query any ServiceNow table using the Table API.\n\nRetrieve records from any table with support for encoded queries, field selection, display values, and configurable limits.\n\nFeatures:\n • Query any table with encoded query strings\n • Select specific fields to return\n • Toggle display values vs. internal values\n • Configurable record limit\n • JSON output for scripting and CI/CD",
5758
5901
  "examples": [
5759
5902
  {
5760
- "description": "Validate a catalog item by sys_id",
5761
- "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --auth dev"
5903
+ "description": "Query active incidents",
5904
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --limit 10 --auth dev"
5762
5905
  },
5763
5906
  {
5764
- "description": "Validate a catalog item with JSON output",
5765
- "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --json --auth dev"
5907
+ "description": "Query with specific fields and display values",
5908
+ "command": "<%= config.bin %> <%= command.id %> --table incident --query \"priority=1\" --fields \"number,short_description,state\" --display-value --auth dev"
5909
+ },
5910
+ {
5911
+ "description": "Query as JSON output",
5912
+ "command": "<%= config.bin %> <%= command.id %> --table sys_user --query \"active=true\" --limit 5 --json --auth dev"
5766
5913
  }
5767
5914
  ],
5768
5915
  "flags": {
@@ -5848,19 +5995,56 @@
5848
5995
  "allowNo": false,
5849
5996
  "type": "boolean"
5850
5997
  },
5851
- "sys-id": {
5852
- "char": "s",
5853
- "description": "Catalog item sys_id to validate",
5854
- "name": "sys-id",
5998
+ "table": {
5999
+ "char": "t",
6000
+ "description": "ServiceNow table name to query",
6001
+ "name": "table",
5855
6002
  "required": true,
5856
6003
  "hasDynamicHelp": false,
5857
6004
  "multiple": false,
5858
6005
  "type": "option"
6006
+ },
6007
+ "query": {
6008
+ "char": "q",
6009
+ "description": "ServiceNow encoded query string",
6010
+ "name": "query",
6011
+ "required": false,
6012
+ "default": "",
6013
+ "hasDynamicHelp": false,
6014
+ "multiple": false,
6015
+ "type": "option"
6016
+ },
6017
+ "fields": {
6018
+ "char": "f",
6019
+ "description": "Comma-separated list of fields to return",
6020
+ "name": "fields",
6021
+ "required": false,
6022
+ "hasDynamicHelp": false,
6023
+ "multiple": false,
6024
+ "type": "option"
6025
+ },
6026
+ "display-value": {
6027
+ "char": "d",
6028
+ "description": "Return display values instead of internal values",
6029
+ "name": "display-value",
6030
+ "required": false,
6031
+ "allowNo": false,
6032
+ "type": "boolean"
6033
+ },
6034
+ "limit": {
6035
+ "char": "l",
6036
+ "description": "Maximum number of records to return",
6037
+ "name": "limit",
6038
+ "required": false,
6039
+ "default": 20,
6040
+ "hasDynamicHelp": false,
6041
+ "multiple": false,
6042
+ "type": "option"
5859
6043
  }
5860
6044
  },
5861
6045
  "hasDynamicHelp": false,
5862
6046
  "hiddenAliases": [],
5863
- "id": "schema:validate-catalog",
6047
+ "id": "query",
5864
6048
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
5865
6049
  "pluginName": "@sonisoft/now-sdk-ext-cli",
5866
6050
  "pluginType": "core",
@@ -5870,22 +6054,26 @@
5870
6054
  "relativePath": [
5871
6055
  "dist",
5872
6056
  "commands",
5873
- "schema",
5874
- "validate-catalog.js"
6057
+ "query",
6058
+ "index.js"
5875
6059
  ]
5876
6060
  },
5877
- "query:app": {
6061
+ "query:syslog": {
5878
6062
  "aliases": [],
5879
6063
  "args": {},
5880
- "description": "Search for applications by name across scoped apps and plugins.\n\nSearches the sys_scope table for applications matching the provided search term.\n\nFeatures:\n • Search by name (case-insensitive contains)\n • Filter active/inactive applications\n • Configurable result limit\n • JSON output for scripting",
6064
+ "description": "Query ServiceNow system logs (one-shot, non-tailing).\n\nRetrieves syslog records with optional encoded query filtering and configurable limits. For real-time log tailing, use the \"log tail\" command instead.\n\nFeatures:\n • Query syslog with encoded query strings\n • Configurable record limit\n • Formatted table output with timestamps, levels, and sources\n • JSON output for scripting",
5881
6065
  "examples": [
5882
6066
  {
5883
- "description": "Search for ITSM applications",
5884
- "command": "<%= config.bin %> <%= command.id %> --search \"ITSM\" --auth dev"
6067
+ "description": "Query recent error logs",
6068
+ "command": "<%= config.bin %> <%= command.id %> --query \"level=2\" --limit 20 --auth dev"
5885
6069
  },
5886
6070
  {
5887
- "description": "Search active apps only",
5888
- "command": "<%= config.bin %> <%= command.id %> --search \"HR\" --active --auth dev"
6071
+ "description": "Query all recent syslog entries",
6072
+ "command": "<%= config.bin %> <%= command.id %> --limit 50 --auth dev"
6073
+ },
6074
+ {
6075
+ "description": "Query syslog as JSON",
6076
+ "command": "<%= config.bin %> <%= command.id %> --query \"sourceLIKEincident\" --json --auth dev"
5889
6077
  }
5890
6078
  ],
5891
6079
  "flags": {
@@ -5971,29 +6159,21 @@
5971
6159
  "allowNo": false,
5972
6160
  "type": "boolean"
5973
6161
  },
5974
- "search": {
5975
- "char": "s",
5976
- "description": "Application name search term",
5977
- "name": "search",
5978
- "required": true,
6162
+ "query": {
6163
+ "char": "q",
6164
+ "description": "ServiceNow encoded query string for filtering syslog records",
6165
+ "name": "query",
6166
+ "required": false,
5979
6167
  "hasDynamicHelp": false,
5980
6168
  "multiple": false,
5981
6169
  "type": "option"
5982
6170
  },
5983
- "active": {
5984
- "char": "a",
5985
- "description": "Only show active applications",
5986
- "name": "active",
5987
- "required": false,
5988
- "allowNo": false,
5989
- "type": "boolean"
5990
- },
5991
6171
  "limit": {
5992
6172
  "char": "l",
5993
- "description": "Maximum number of results to return",
6173
+ "description": "Maximum number of syslog records to return",
5994
6174
  "name": "limit",
5995
6175
  "required": false,
5996
- "default": 20,
6176
+ "default": 100,
5997
6177
  "hasDynamicHelp": false,
5998
6178
  "multiple": false,
5999
6179
  "type": "option"
@@ -6001,7 +6181,7 @@
6001
6181
  },
6002
6182
  "hasDynamicHelp": false,
6003
6183
  "hiddenAliases": [],
6004
- "id": "query:app",
6184
+ "id": "query:syslog",
6005
6185
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
6006
6186
  "pluginName": "@sonisoft/now-sdk-ext-cli",
6007
6187
  "pluginType": "core",
@@ -6012,25 +6192,21 @@
6012
6192
  "dist",
6013
6193
  "commands",
6014
6194
  "query",
6015
- "app.js"
6195
+ "syslog.js"
6016
6196
  ]
6017
6197
  },
6018
- "query:columns": {
6198
+ "schema:field": {
6019
6199
  "aliases": [],
6020
6200
  "args": {},
6021
- "description": "List and search columns (fields) on a ServiceNow table.\n\nRetrieves all field definitions for a table from the sys_dictionary, with optional name/label filtering.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Search/filter fields by name or label\n • JSON output for scripting",
6201
+ "description": "Get detailed information about a specific field on a ServiceNow table.\n\nThis command retrieves comprehensive details about a single field, including its type, constraints, choices, and other metadata. Useful for understanding field definitions during development.",
6022
6202
  "examples": [
6023
6203
  {
6024
- "description": "List all columns on the incident table",
6025
- "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
6026
- },
6027
- {
6028
- "description": "Search for date-related columns",
6029
- "command": "<%= config.bin %> <%= command.id %> --table incident --search \"date\" --auth dev"
6204
+ "description": "Explain the state field on incident table",
6205
+ "command": "<%= config.bin %> <%= command.id %> --table incident --field state --auth dev"
6030
6206
  },
6031
6207
  {
6032
- "description": "List columns as JSON",
6033
- "command": "<%= config.bin %> <%= command.id %> --table incident --json --auth dev"
6208
+ "description": "Explain the priority field on incident table with JSON output",
6209
+ "command": "<%= config.bin %> <%= command.id %> --table incident --field priority --json --auth dev"
6034
6210
  }
6035
6211
  ],
6036
6212
  "flags": {
@@ -6118,18 +6294,18 @@
6118
6294
  },
6119
6295
  "table": {
6120
6296
  "char": "t",
6121
- "description": "ServiceNow table name to list columns for",
6297
+ "description": "ServiceNow table name",
6122
6298
  "name": "table",
6123
6299
  "required": true,
6124
6300
  "hasDynamicHelp": false,
6125
6301
  "multiple": false,
6126
6302
  "type": "option"
6127
6303
  },
6128
- "search": {
6129
- "char": "s",
6130
- "description": "Filter columns by name or label (case-insensitive)",
6131
- "name": "search",
6132
- "required": false,
6304
+ "field": {
6305
+ "char": "f",
6306
+ "description": "Field name to explain",
6307
+ "name": "field",
6308
+ "required": true,
6133
6309
  "hasDynamicHelp": false,
6134
6310
  "multiple": false,
6135
6311
  "type": "option"
@@ -6137,7 +6313,7 @@
6137
6313
  },
6138
6314
  "hasDynamicHelp": false,
6139
6315
  "hiddenAliases": [],
6140
- "id": "query:columns",
6316
+ "id": "schema:field",
6141
6317
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
6142
6318
  "pluginName": "@sonisoft/now-sdk-ext-cli",
6143
6319
  "pluginType": "core",
@@ -6147,26 +6323,22 @@
6147
6323
  "relativePath": [
6148
6324
  "dist",
6149
6325
  "commands",
6150
- "query",
6151
- "columns.js"
6326
+ "schema",
6327
+ "field.js"
6152
6328
  ]
6153
6329
  },
6154
- "query": {
6330
+ "schema": {
6155
6331
  "aliases": [],
6156
6332
  "args": {},
6157
- "description": "Query any ServiceNow table using the Table API.\n\nRetrieve records from any table with support for encoded queries, field selection, display values, and configurable limits.\n\nFeatures:\n • Query any table with encoded query strings\n • Select specific fields to return\n • Toggle display values vs. internal values\n • Configurable record limit\n • JSON output for scripting and CI/CD",
6333
+ "description": "Discover and inspect a ServiceNow table schema including fields, types, and relationships.\n\nThis command retrieves the full schema definition for a ServiceNow table, including all fields, their types, constraints, and optionally choices, relationships, UI policies, and business rules.\n\nFeatures:\n • List all fields with types, lengths, and constraints\n • Optionally include field choices\n • Optionally include table relationships\n • Optionally include UI policies\n • Optionally include business rules\n • JSON output for CI/CD integration",
6158
6334
  "examples": [
6159
6335
  {
6160
- "description": "Query active incidents",
6161
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"active=true\" --limit 10 --auth dev"
6162
- },
6163
- {
6164
- "description": "Query with specific fields and display values",
6165
- "command": "<%= config.bin %> <%= command.id %> --table incident --query \"priority=1\" --fields \"number,short_description,state\" --display-value --auth dev"
6336
+ "description": "Discover incident table schema",
6337
+ "command": "<%= config.bin %> <%= command.id %> --table incident --auth dev"
6166
6338
  },
6167
6339
  {
6168
- "description": "Query as JSON output",
6169
- "command": "<%= config.bin %> <%= command.id %> --table sys_user --query \"active=true\" --limit 5 --json --auth dev"
6340
+ "description": "Include choices and relationships",
6341
+ "command": "<%= config.bin %> <%= command.id %> --table incident --include-choices --include-relationships --auth dev"
6170
6342
  }
6171
6343
  ],
6172
6344
  "flags": {
@@ -6254,54 +6426,45 @@
6254
6426
  },
6255
6427
  "table": {
6256
6428
  "char": "t",
6257
- "description": "ServiceNow table name to query",
6429
+ "description": "ServiceNow table name to discover schema for",
6258
6430
  "name": "table",
6259
6431
  "required": true,
6260
6432
  "hasDynamicHelp": false,
6261
6433
  "multiple": false,
6262
6434
  "type": "option"
6263
6435
  },
6264
- "query": {
6265
- "char": "q",
6266
- "description": "ServiceNow encoded query string",
6267
- "name": "query",
6436
+ "include-choices": {
6437
+ "description": "Include field choices in the schema output",
6438
+ "name": "include-choices",
6268
6439
  "required": false,
6269
- "default": "",
6270
- "hasDynamicHelp": false,
6271
- "multiple": false,
6272
- "type": "option"
6440
+ "allowNo": false,
6441
+ "type": "boolean"
6273
6442
  },
6274
- "fields": {
6275
- "char": "f",
6276
- "description": "Comma-separated list of fields to return",
6277
- "name": "fields",
6443
+ "include-relationships": {
6444
+ "description": "Include table relationships in the schema output",
6445
+ "name": "include-relationships",
6278
6446
  "required": false,
6279
- "hasDynamicHelp": false,
6280
- "multiple": false,
6281
- "type": "option"
6447
+ "allowNo": false,
6448
+ "type": "boolean"
6282
6449
  },
6283
- "display-value": {
6284
- "char": "d",
6285
- "description": "Return display values instead of internal values",
6286
- "name": "display-value",
6450
+ "include-ui-policies": {
6451
+ "description": "Include UI policies in the schema output",
6452
+ "name": "include-ui-policies",
6287
6453
  "required": false,
6288
6454
  "allowNo": false,
6289
6455
  "type": "boolean"
6290
6456
  },
6291
- "limit": {
6292
- "char": "l",
6293
- "description": "Maximum number of records to return",
6294
- "name": "limit",
6295
- "required": false,
6296
- "default": 20,
6297
- "hasDynamicHelp": false,
6298
- "multiple": false,
6299
- "type": "option"
6457
+ "include-business-rules": {
6458
+ "description": "Include business rules in the schema output",
6459
+ "name": "include-business-rules",
6460
+ "required": false,
6461
+ "allowNo": false,
6462
+ "type": "boolean"
6300
6463
  }
6301
6464
  },
6302
6465
  "hasDynamicHelp": false,
6303
6466
  "hiddenAliases": [],
6304
- "id": "query",
6467
+ "id": "schema",
6305
6468
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
6306
6469
  "pluginName": "@sonisoft/now-sdk-ext-cli",
6307
6470
  "pluginType": "core",
@@ -6311,26 +6474,22 @@
6311
6474
  "relativePath": [
6312
6475
  "dist",
6313
6476
  "commands",
6314
- "query",
6477
+ "schema",
6315
6478
  "index.js"
6316
6479
  ]
6317
6480
  },
6318
- "query:syslog": {
6481
+ "schema:validate-catalog": {
6319
6482
  "aliases": [],
6320
6483
  "args": {},
6321
- "description": "Query ServiceNow system logs (one-shot, non-tailing).\n\nRetrieves syslog records with optional encoded query filtering and configurable limits. For real-time log tailing, use the \"log tail\" command instead.\n\nFeatures:\n • Query syslog with encoded query strings\n • Configurable record limit\n • Formatted table output with timestamps, levels, and sources\n • JSON output for scripting",
6484
+ "description": "Validate a ServiceNow catalog item configuration for common issues.\n\nThis command checks a catalog item configuration and reports any validation issues, warnings, or errors found. Useful for ensuring catalog items are properly configured before deployment.",
6322
6485
  "examples": [
6323
6486
  {
6324
- "description": "Query recent error logs",
6325
- "command": "<%= config.bin %> <%= command.id %> --query \"level=2\" --limit 20 --auth dev"
6326
- },
6327
- {
6328
- "description": "Query all recent syslog entries",
6329
- "command": "<%= config.bin %> <%= command.id %> --limit 50 --auth dev"
6487
+ "description": "Validate a catalog item by sys_id",
6488
+ "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --auth dev"
6330
6489
  },
6331
6490
  {
6332
- "description": "Query syslog as JSON",
6333
- "command": "<%= config.bin %> <%= command.id %> --query \"sourceLIKEincident\" --json --auth dev"
6491
+ "description": "Validate a catalog item with JSON output",
6492
+ "command": "<%= config.bin %> <%= command.id %> --sys-id a1b2c3d4e5f6 --json --auth dev"
6334
6493
  }
6335
6494
  ],
6336
6495
  "flags": {
@@ -6416,21 +6575,11 @@
6416
6575
  "allowNo": false,
6417
6576
  "type": "boolean"
6418
6577
  },
6419
- "query": {
6420
- "char": "q",
6421
- "description": "ServiceNow encoded query string for filtering syslog records",
6422
- "name": "query",
6423
- "required": false,
6424
- "hasDynamicHelp": false,
6425
- "multiple": false,
6426
- "type": "option"
6427
- },
6428
- "limit": {
6429
- "char": "l",
6430
- "description": "Maximum number of syslog records to return",
6431
- "name": "limit",
6432
- "required": false,
6433
- "default": 100,
6578
+ "sys-id": {
6579
+ "char": "s",
6580
+ "description": "Catalog item sys_id to validate",
6581
+ "name": "sys-id",
6582
+ "required": true,
6434
6583
  "hasDynamicHelp": false,
6435
6584
  "multiple": false,
6436
6585
  "type": "option"
@@ -6438,7 +6587,7 @@
6438
6587
  },
6439
6588
  "hasDynamicHelp": false,
6440
6589
  "hiddenAliases": [],
6441
- "id": "query:syslog",
6590
+ "id": "schema:validate-catalog",
6442
6591
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
6443
6592
  "pluginName": "@sonisoft/now-sdk-ext-cli",
6444
6593
  "pluginType": "core",
@@ -6448,8 +6597,8 @@
6448
6597
  "relativePath": [
6449
6598
  "dist",
6450
6599
  "commands",
6451
- "query",
6452
- "syslog.js"
6600
+ "schema",
6601
+ "validate-catalog.js"
6453
6602
  ]
6454
6603
  },
6455
6604
  "scope": {
@@ -8281,13 +8430,19 @@
8281
8430
  "validate.js"
8282
8431
  ]
8283
8432
  },
8284
- "transaction:kill": {
8433
+ "task:approve": {
8285
8434
  "aliases": [],
8286
8435
  "args": {},
8287
- "description": "Submit a request to terminate one active transaction. Platform acceptance does not mean immediate removal.\n\nOnly pass an identifier you deliberately selected from `nex transaction list`. Killing another user's transaction aborts their work.",
8436
+ "description": "Approve a ServiceNow change request.\n\nThis command approves a change request identified by its number. You can optionally provide approval comments.\n\nFeatures:\n - Approve change requests\n - Optionally add approval comments\n - Auto-resolves change request number to sys_id",
8288
8437
  "examples": [
8289
- "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --auth dev",
8290
- "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --json --auth dev"
8438
+ {
8439
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --auth dev",
8440
+ "description": "Approve a change request"
8441
+ },
8442
+ {
8443
+ "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 -c \"Looks good, approved\" --auth dev",
8444
+ "description": "Approve a change request with comments"
8445
+ }
8291
8446
  ],
8292
8447
  "flags": {
8293
8448
  "json": {
@@ -8371,16 +8526,19 @@
8371
8526
  "allowNo": false,
8372
8527
  "type": "boolean"
8373
8528
  },
8374
- "confirm": {
8375
- "description": "Confirm submission of the kill request.",
8376
- "name": "confirm",
8377
- "allowNo": false,
8378
- "type": "boolean"
8529
+ "comments": {
8530
+ "char": "c",
8531
+ "description": "Approval comments",
8532
+ "name": "comments",
8533
+ "required": false,
8534
+ "hasDynamicHelp": false,
8535
+ "multiple": false,
8536
+ "type": "option"
8379
8537
  },
8380
- "transaction-id": {
8381
- "char": "t",
8382
- "description": "Exact 32-character hexadecimal sys_id from `nex transaction list`.",
8383
- "name": "transaction-id",
8538
+ "number": {
8539
+ "char": "n",
8540
+ "description": "Change request number (e.g., CHG0010001)",
8541
+ "name": "number",
8384
8542
  "required": true,
8385
8543
  "hasDynamicHelp": false,
8386
8544
  "multiple": false,
@@ -8389,7 +8547,7 @@
8389
8547
  },
8390
8548
  "hasDynamicHelp": false,
8391
8549
  "hiddenAliases": [],
8392
- "id": "transaction:kill",
8550
+ "id": "task:approve",
8393
8551
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8394
8552
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8395
8553
  "pluginType": "core",
@@ -8399,19 +8557,27 @@
8399
8557
  "relativePath": [
8400
8558
  "dist",
8401
8559
  "commands",
8402
- "transaction",
8403
- "kill.js"
8560
+ "task",
8561
+ "approve.js"
8404
8562
  ]
8405
8563
  },
8406
- "transaction:list": {
8564
+ "task:assign": {
8407
8565
  "aliases": [],
8408
8566
  "args": {},
8409
- "description": "List active transactions from all responding ServiceNow cluster nodes.",
8567
+ "description": "Assign a ServiceNow task to a user or group.\n\nThis command assigns a task record identified by its number to a specified user and/or group. You can assign to a user, a group, or both simultaneously.\n\nFeatures:\n - Assign tasks to individual users\n - Assign tasks to assignment groups\n - Assign to both user and group at once\n - Supports any task-based table\n - Auto-resolves task number to sys_id",
8410
8568
  "examples": [
8411
- "<%= config.bin %> <%= command.id %> --auth dev",
8412
- "<%= config.bin %> <%= command.id %> --json --auth dev",
8413
- "<%= config.bin %> <%= command.id %> --query \"user=admin\" --limit 50 --auth dev",
8414
- "<%= config.bin %> <%= command.id %> --timeout-ms 120000 --poll-interval-ms 2000 --auth dev"
8569
+ {
8570
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --user admin --auth dev",
8571
+ "description": "Assign an incident to a user"
8572
+ },
8573
+ {
8574
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -u admin -g \"Service Desk\" --auth dev",
8575
+ "description": "Assign an incident to a user and group"
8576
+ },
8577
+ {
8578
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --user admin --auth dev",
8579
+ "description": "Assign a change request to a user"
8580
+ }
8415
8581
  ],
8416
8582
  "flags": {
8417
8583
  "json": {
@@ -8495,32 +8661,38 @@
8495
8661
  "allowNo": false,
8496
8662
  "type": "boolean"
8497
8663
  },
8498
- "limit": {
8499
- "char": "l",
8500
- "description": "Maximum transactions to return. Core default: 1000.",
8501
- "name": "limit",
8664
+ "group": {
8665
+ "char": "g",
8666
+ "description": "Assignment group",
8667
+ "name": "group",
8668
+ "required": false,
8502
8669
  "hasDynamicHelp": false,
8503
8670
  "multiple": false,
8504
8671
  "type": "option"
8505
8672
  },
8506
- "poll-interval-ms": {
8507
- "description": "Interval between collection status polls. Core default: 1000.",
8508
- "name": "poll-interval-ms",
8673
+ "number": {
8674
+ "char": "n",
8675
+ "description": "Task number (e.g., INC0010001)",
8676
+ "name": "number",
8677
+ "required": true,
8509
8678
  "hasDynamicHelp": false,
8510
8679
  "multiple": false,
8511
8680
  "type": "option"
8512
8681
  },
8513
- "query": {
8514
- "char": "q",
8515
- "description": "Encoded query used to filter transactions. Core default: none.",
8516
- "name": "query",
8682
+ "table": {
8683
+ "description": "ServiceNow table name",
8684
+ "name": "table",
8685
+ "required": false,
8686
+ "default": "task",
8517
8687
  "hasDynamicHelp": false,
8518
8688
  "multiple": false,
8519
8689
  "type": "option"
8520
8690
  },
8521
- "timeout-ms": {
8522
- "description": "Collection timeout in milliseconds. Core default: 60000.",
8523
- "name": "timeout-ms",
8691
+ "user": {
8692
+ "char": "u",
8693
+ "description": "User to assign the task to",
8694
+ "name": "user",
8695
+ "required": true,
8524
8696
  "hasDynamicHelp": false,
8525
8697
  "multiple": false,
8526
8698
  "type": "option"
@@ -8528,7 +8700,7 @@
8528
8700
  },
8529
8701
  "hasDynamicHelp": false,
8530
8702
  "hiddenAliases": [],
8531
- "id": "transaction:list",
8703
+ "id": "task:assign",
8532
8704
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8533
8705
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8534
8706
  "pluginType": "core",
@@ -8538,22 +8710,22 @@
8538
8710
  "relativePath": [
8539
8711
  "dist",
8540
8712
  "commands",
8541
- "transaction",
8542
- "list.js"
8713
+ "task",
8714
+ "assign.js"
8543
8715
  ]
8544
8716
  },
8545
- "workflow:create": {
8717
+ "task:close": {
8546
8718
  "aliases": [],
8547
8719
  "args": {},
8548
- "description": "Create a complete workflow from a JSON specification file.",
8720
+ "description": "Close a ServiceNow incident.\n\nThis command closes an incident identified by its number, setting the close notes and optionally a close code. The incident must be in a state that allows closure.\n\nFeatures:\n - Close incidents with close notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
8549
8721
  "examples": [
8550
8722
  {
8551
- "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
8552
- "description": "Create a workflow from a JSON spec file"
8723
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue confirmed resolved by user\" --auth dev",
8724
+ "description": "Close an incident with close notes"
8553
8725
  },
8554
8726
  {
8555
- "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
8556
- "description": "Create a workflow and output result as JSON"
8727
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Closed\" --close-code \"Solved (Permanently)\" --auth dev",
8728
+ "description": "Close with a specific close code"
8557
8729
  }
8558
8730
  ],
8559
8731
  "flags": {
@@ -8638,10 +8810,26 @@
8638
8810
  "allowNo": false,
8639
8811
  "type": "boolean"
8640
8812
  },
8641
- "spec": {
8642
- "char": "s",
8643
- "description": "Path to workflow JSON specification file",
8644
- "name": "spec",
8813
+ "close-code": {
8814
+ "description": "Close code for the closure",
8815
+ "name": "close-code",
8816
+ "required": false,
8817
+ "hasDynamicHelp": false,
8818
+ "multiple": false,
8819
+ "type": "option"
8820
+ },
8821
+ "notes": {
8822
+ "description": "Close notes",
8823
+ "name": "notes",
8824
+ "required": true,
8825
+ "hasDynamicHelp": false,
8826
+ "multiple": false,
8827
+ "type": "option"
8828
+ },
8829
+ "number": {
8830
+ "char": "n",
8831
+ "description": "Incident number (e.g., INC0010001)",
8832
+ "name": "number",
8645
8833
  "required": true,
8646
8834
  "hasDynamicHelp": false,
8647
8835
  "multiple": false,
@@ -8650,7 +8838,7 @@
8650
8838
  },
8651
8839
  "hasDynamicHelp": false,
8652
8840
  "hiddenAliases": [],
8653
- "id": "workflow:create",
8841
+ "id": "task:close",
8654
8842
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8655
8843
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8656
8844
  "pluginType": "core",
@@ -8660,22 +8848,26 @@
8660
8848
  "relativePath": [
8661
8849
  "dist",
8662
8850
  "commands",
8663
- "workflow",
8664
- "create.js"
8851
+ "task",
8852
+ "close.js"
8665
8853
  ]
8666
8854
  },
8667
- "workflow:publish": {
8855
+ "task:comment": {
8668
8856
  "aliases": [],
8669
8857
  "args": {},
8670
- "description": "Publish a workflow version.",
8858
+ "description": "Add a comment or work note to a ServiceNow task.\n\nThis command adds a comment or work note to a task record identified by its number. By default, comments are added as customer-visible comments. Use the --work-note flag to add an internal work note instead.\n\nFeatures:\n - Add customer-visible comments to any task\n - Add internal work notes visible only to fulfiller teams\n - Supports any task-based table (incident, change_request, etc.)\n - Auto-resolves task number to sys_id",
8671
8859
  "examples": [
8672
8860
  {
8673
- "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
8674
- "description": "Publish a workflow version"
8861
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --comment \"Investigating the issue\" --auth dev",
8862
+ "description": "Add a comment to an incident"
8675
8863
  },
8676
8864
  {
8677
- "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
8678
- "description": "Publish a workflow version and output as JSON"
8865
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -c \"Internal update\" --work-note --auth dev",
8866
+ "description": "Add a work note to an incident"
8867
+ },
8868
+ {
8869
+ "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --comment \"Approved\" --auth dev",
8870
+ "description": "Add a comment to a change request"
8679
8871
  }
8680
8872
  ],
8681
8873
  "flags": {
@@ -8760,28 +8952,44 @@
8760
8952
  "allowNo": false,
8761
8953
  "type": "boolean"
8762
8954
  },
8763
- "start-activity": {
8764
- "char": "s",
8765
- "description": "Sys ID of the start activity",
8766
- "name": "start-activity",
8955
+ "comment": {
8956
+ "char": "c",
8957
+ "description": "Comment text to add",
8958
+ "name": "comment",
8767
8959
  "required": true,
8768
8960
  "hasDynamicHelp": false,
8769
8961
  "multiple": false,
8770
8962
  "type": "option"
8771
8963
  },
8772
- "version-id": {
8773
- "char": "v",
8774
- "description": "Sys ID of the workflow version to publish",
8775
- "name": "version-id",
8964
+ "number": {
8965
+ "char": "n",
8966
+ "description": "Task number (e.g., INC0010001)",
8967
+ "name": "number",
8776
8968
  "required": true,
8777
8969
  "hasDynamicHelp": false,
8778
8970
  "multiple": false,
8779
8971
  "type": "option"
8972
+ },
8973
+ "table": {
8974
+ "description": "ServiceNow table name",
8975
+ "name": "table",
8976
+ "required": false,
8977
+ "default": "task",
8978
+ "hasDynamicHelp": false,
8979
+ "multiple": false,
8980
+ "type": "option"
8981
+ },
8982
+ "work-note": {
8983
+ "description": "Add as work note instead of comment",
8984
+ "name": "work-note",
8985
+ "required": false,
8986
+ "allowNo": false,
8987
+ "type": "boolean"
8780
8988
  }
8781
8989
  },
8782
8990
  "hasDynamicHelp": false,
8783
8991
  "hiddenAliases": [],
8784
- "id": "workflow:publish",
8992
+ "id": "task:comment",
8785
8993
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8786
8994
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8787
8995
  "pluginType": "core",
@@ -8791,22 +8999,26 @@
8791
8999
  "relativePath": [
8792
9000
  "dist",
8793
9001
  "commands",
8794
- "workflow",
8795
- "publish.js"
9002
+ "task",
9003
+ "comment.js"
8796
9004
  ]
8797
9005
  },
8798
- "update-set:clone": {
9006
+ "task:find": {
8799
9007
  "aliases": [],
8800
9008
  "args": {},
8801
- "description": "Clone an update set and its records.",
9009
+ "description": "Find a ServiceNow task by its number.\n\nThis command looks up a task record by its number in the specified table. Returns the full task details including sys_id, description, state, and assignment information.\n\nFeatures:\n - Look up any task by number\n - Supports any task-based table\n - JSON output for scripting and automation",
8802
9010
  "examples": [
8803
9011
  {
8804
- "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --auth dev-instance",
8805
- "description": "Clone an update set"
9012
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --auth dev",
9013
+ "description": "Find an incident by number"
9014
+ },
9015
+ {
9016
+ "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 --table change_request --auth dev",
9017
+ "description": "Find a change request by number"
8806
9018
  },
8807
9019
  {
8808
- "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --json --auth dev-instance",
8809
- "description": "Clone with JSON output"
9020
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --json --auth dev",
9021
+ "description": "Find an incident and output as JSON"
8810
9022
  }
8811
9023
  ],
8812
9024
  "flags": {
@@ -8891,20 +9103,20 @@
8891
9103
  "allowNo": false,
8892
9104
  "type": "boolean"
8893
9105
  },
8894
- "name": {
9106
+ "number": {
8895
9107
  "char": "n",
8896
- "description": "Name for the cloned update set",
8897
- "name": "name",
9108
+ "description": "Task number (e.g., INC0010001, CHG0010001)",
9109
+ "name": "number",
8898
9110
  "required": true,
8899
9111
  "hasDynamicHelp": false,
8900
9112
  "multiple": false,
8901
9113
  "type": "option"
8902
9114
  },
8903
- "source": {
8904
- "char": "s",
8905
- "description": "Source update set sys_id",
8906
- "name": "source",
8907
- "required": true,
9115
+ "table": {
9116
+ "description": "ServiceNow table name",
9117
+ "name": "table",
9118
+ "required": false,
9119
+ "default": "task",
8908
9120
  "hasDynamicHelp": false,
8909
9121
  "multiple": false,
8910
9122
  "type": "option"
@@ -8912,7 +9124,7 @@
8912
9124
  },
8913
9125
  "hasDynamicHelp": false,
8914
9126
  "hiddenAliases": [],
8915
- "id": "update-set:clone",
9127
+ "id": "task:find",
8916
9128
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
8917
9129
  "pluginName": "@sonisoft/now-sdk-ext-cli",
8918
9130
  "pluginType": "core",
@@ -8922,26 +9134,22 @@
8922
9134
  "relativePath": [
8923
9135
  "dist",
8924
9136
  "commands",
8925
- "update-set",
8926
- "clone.js"
9137
+ "task",
9138
+ "find.js"
8927
9139
  ]
8928
9140
  },
8929
- "update-set:create": {
9141
+ "task:resolve": {
8930
9142
  "aliases": [],
8931
9143
  "args": {},
8932
- "description": "Create a new update set.",
9144
+ "description": "Resolve a ServiceNow incident with resolution notes.\n\nThis command resolves an incident identified by its number, setting the resolution notes and optionally a close code. The incident must be in a state that allows resolution.\n\nFeatures:\n - Resolve incidents with resolution notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
8933
9145
  "examples": [
8934
9146
  {
8935
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --auth dev-instance",
8936
- "description": "Create a new update set with a name"
8937
- },
8938
- {
8939
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --description \"Update set for feature X\" --auth dev-instance",
8940
- "description": "Create with name and description"
9147
+ "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue resolved by restarting the service\" --auth dev",
9148
+ "description": "Resolve an incident with resolution notes"
8941
9149
  },
8942
9150
  {
8943
- "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --application x_my_app --auth dev-instance",
8944
- "description": "Create within a specific application scope"
9151
+ "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Fixed\" --close-code \"Solved (Permanently)\" --auth dev",
9152
+ "description": "Resolve with a specific close code"
8945
9153
  }
8946
9154
  ],
8947
9155
  "flags": {
@@ -9026,27 +9234,26 @@
9026
9234
  "allowNo": false,
9027
9235
  "type": "boolean"
9028
9236
  },
9029
- "application": {
9030
- "description": "Application scope for the new update set",
9031
- "name": "application",
9237
+ "close-code": {
9238
+ "description": "Close code for the resolution",
9239
+ "name": "close-code",
9032
9240
  "required": false,
9033
9241
  "hasDynamicHelp": false,
9034
9242
  "multiple": false,
9035
9243
  "type": "option"
9036
9244
  },
9037
- "description": {
9038
- "char": "d",
9039
- "description": "Description for the new update set",
9040
- "name": "description",
9041
- "required": false,
9245
+ "notes": {
9246
+ "description": "Resolution notes",
9247
+ "name": "notes",
9248
+ "required": true,
9042
9249
  "hasDynamicHelp": false,
9043
9250
  "multiple": false,
9044
9251
  "type": "option"
9045
9252
  },
9046
- "name": {
9253
+ "number": {
9047
9254
  "char": "n",
9048
- "description": "Name for the new update set",
9049
- "name": "name",
9255
+ "description": "Incident number (e.g., INC0010001)",
9256
+ "name": "number",
9050
9257
  "required": true,
9051
9258
  "hasDynamicHelp": false,
9052
9259
  "multiple": false,
@@ -9055,7 +9262,7 @@
9055
9262
  },
9056
9263
  "hasDynamicHelp": false,
9057
9264
  "hiddenAliases": [],
9058
- "id": "update-set:create",
9265
+ "id": "task:resolve",
9059
9266
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9060
9267
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9061
9268
  "pluginType": "core",
@@ -9065,27 +9272,17 @@
9065
9272
  "relativePath": [
9066
9273
  "dist",
9067
9274
  "commands",
9068
- "update-set",
9069
- "create.js"
9275
+ "task",
9276
+ "resolve.js"
9070
9277
  ]
9071
9278
  },
9072
- "update-set:current": {
9279
+ "transaction:kill": {
9073
9280
  "aliases": [],
9074
9281
  "args": {},
9075
- "description": "Get or set the current update set.",
9282
+ "description": "Submit a request to terminate one active transaction. Platform acceptance does not mean immediate removal.\n\nOnly pass an identifier you deliberately selected from `nex transaction list`. Killing another user's transaction aborts their work.",
9076
9283
  "examples": [
9077
- {
9078
- "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9079
- "description": "Get the current update set"
9080
- },
9081
- {
9082
- "command": "<%= config.bin %> <%= command.id %> --set us-001 --auth dev-instance",
9083
- "description": "Set the current update set by sys_id"
9084
- },
9085
- {
9086
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9087
- "description": "Get the current update set as JSON"
9088
- }
9284
+ "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --auth dev",
9285
+ "<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --json --auth dev"
9089
9286
  ],
9090
9287
  "flags": {
9091
9288
  "json": {
@@ -9169,11 +9366,17 @@
9169
9366
  "allowNo": false,
9170
9367
  "type": "boolean"
9171
9368
  },
9172
- "set": {
9173
- "char": "s",
9174
- "description": "sys_id of update set to make current",
9175
- "name": "set",
9176
- "required": false,
9369
+ "confirm": {
9370
+ "description": "Confirm submission of the kill request.",
9371
+ "name": "confirm",
9372
+ "allowNo": false,
9373
+ "type": "boolean"
9374
+ },
9375
+ "transaction-id": {
9376
+ "char": "t",
9377
+ "description": "Exact 32-character hexadecimal sys_id from `nex transaction list`.",
9378
+ "name": "transaction-id",
9379
+ "required": true,
9177
9380
  "hasDynamicHelp": false,
9178
9381
  "multiple": false,
9179
9382
  "type": "option"
@@ -9181,7 +9384,7 @@
9181
9384
  },
9182
9385
  "hasDynamicHelp": false,
9183
9386
  "hiddenAliases": [],
9184
- "id": "update-set:current",
9387
+ "id": "transaction:kill",
9185
9388
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9186
9389
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9187
9390
  "pluginType": "core",
@@ -9191,27 +9394,19 @@
9191
9394
  "relativePath": [
9192
9395
  "dist",
9193
9396
  "commands",
9194
- "update-set",
9195
- "current.js"
9397
+ "transaction",
9398
+ "kill.js"
9196
9399
  ]
9197
9400
  },
9198
- "update-set": {
9401
+ "transaction:list": {
9199
9402
  "aliases": [],
9200
9403
  "args": {},
9201
- "description": "List update sets on a ServiceNow instance.",
9404
+ "description": "List active transactions from all responding ServiceNow cluster nodes.",
9202
9405
  "examples": [
9203
- {
9204
- "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9205
- "description": "List update sets with default limit"
9206
- },
9207
- {
9208
- "command": "<%= config.bin %> <%= command.id %> --query \"state=in progress\" --limit 50 --auth dev-instance",
9209
- "description": "List update sets with a custom query filter"
9210
- },
9211
- {
9212
- "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9213
- "description": "List update sets with JSON output"
9214
- }
9406
+ "<%= config.bin %> <%= command.id %> --auth dev",
9407
+ "<%= config.bin %> <%= command.id %> --json --auth dev",
9408
+ "<%= config.bin %> <%= command.id %> --query \"user=admin\" --limit 50 --auth dev",
9409
+ "<%= config.bin %> <%= command.id %> --timeout-ms 120000 --poll-interval-ms 2000 --auth dev"
9215
9410
  ],
9216
9411
  "flags": {
9217
9412
  "json": {
@@ -9296,19 +9491,31 @@
9296
9491
  "type": "boolean"
9297
9492
  },
9298
9493
  "limit": {
9299
- "description": "Maximum number of update sets to return",
9494
+ "char": "l",
9495
+ "description": "Maximum transactions to return. Core default: 1000.",
9300
9496
  "name": "limit",
9301
- "required": false,
9302
- "default": 20,
9497
+ "hasDynamicHelp": false,
9498
+ "multiple": false,
9499
+ "type": "option"
9500
+ },
9501
+ "poll-interval-ms": {
9502
+ "description": "Interval between collection status polls. Core default: 1000.",
9503
+ "name": "poll-interval-ms",
9303
9504
  "hasDynamicHelp": false,
9304
9505
  "multiple": false,
9305
9506
  "type": "option"
9306
9507
  },
9307
9508
  "query": {
9308
9509
  "char": "q",
9309
- "description": "Encoded query filter",
9510
+ "description": "Encoded query used to filter transactions. Core default: none.",
9310
9511
  "name": "query",
9311
- "required": false,
9512
+ "hasDynamicHelp": false,
9513
+ "multiple": false,
9514
+ "type": "option"
9515
+ },
9516
+ "timeout-ms": {
9517
+ "description": "Collection timeout in milliseconds. Core default: 60000.",
9518
+ "name": "timeout-ms",
9312
9519
  "hasDynamicHelp": false,
9313
9520
  "multiple": false,
9314
9521
  "type": "option"
@@ -9316,7 +9523,7 @@
9316
9523
  },
9317
9524
  "hasDynamicHelp": false,
9318
9525
  "hiddenAliases": [],
9319
- "id": "update-set",
9526
+ "id": "transaction:list",
9320
9527
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9321
9528
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9322
9529
  "pluginType": "core",
@@ -9326,22 +9533,22 @@
9326
9533
  "relativePath": [
9327
9534
  "dist",
9328
9535
  "commands",
9329
- "update-set",
9330
- "index.js"
9536
+ "transaction",
9537
+ "list.js"
9331
9538
  ]
9332
9539
  },
9333
- "update-set:inspect": {
9540
+ "update-set:clone": {
9334
9541
  "aliases": [],
9335
9542
  "args": {},
9336
- "description": "Inspect the components of an update set.",
9543
+ "description": "Clone an update set and its records.",
9337
9544
  "examples": [
9338
9545
  {
9339
- "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --auth dev-instance",
9340
- "description": "Inspect an update set by sys_id"
9546
+ "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --auth dev-instance",
9547
+ "description": "Clone an update set"
9341
9548
  },
9342
9549
  {
9343
- "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --json --auth dev-instance",
9344
- "description": "Inspect with JSON output"
9550
+ "command": "<%= config.bin %> <%= command.id %> --source us-001 --name \"Cloned Set\" --json --auth dev-instance",
9551
+ "description": "Clone with JSON output"
9345
9552
  }
9346
9553
  ],
9347
9554
  "flags": {
@@ -9426,10 +9633,19 @@
9426
9633
  "allowNo": false,
9427
9634
  "type": "boolean"
9428
9635
  },
9429
- "sys-id": {
9636
+ "name": {
9637
+ "char": "n",
9638
+ "description": "Name for the cloned update set",
9639
+ "name": "name",
9640
+ "required": true,
9641
+ "hasDynamicHelp": false,
9642
+ "multiple": false,
9643
+ "type": "option"
9644
+ },
9645
+ "source": {
9430
9646
  "char": "s",
9431
- "description": "sys_id of the update set to inspect",
9432
- "name": "sys-id",
9647
+ "description": "Source update set sys_id",
9648
+ "name": "source",
9433
9649
  "required": true,
9434
9650
  "hasDynamicHelp": false,
9435
9651
  "multiple": false,
@@ -9438,7 +9654,7 @@
9438
9654
  },
9439
9655
  "hasDynamicHelp": false,
9440
9656
  "hiddenAliases": [],
9441
- "id": "update-set:inspect",
9657
+ "id": "update-set:clone",
9442
9658
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9443
9659
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9444
9660
  "pluginType": "core",
@@ -9449,25 +9665,25 @@
9449
9665
  "dist",
9450
9666
  "commands",
9451
9667
  "update-set",
9452
- "inspect.js"
9668
+ "clone.js"
9453
9669
  ]
9454
9670
  },
9455
- "update-set:move": {
9671
+ "update-set:create": {
9456
9672
  "aliases": [],
9457
9673
  "args": {},
9458
- "description": "Move records between update sets.",
9674
+ "description": "Create a new update set.",
9459
9675
  "examples": [
9460
9676
  {
9461
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --auth dev-instance",
9462
- "description": "Move all records from one update set to another"
9677
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --auth dev-instance",
9678
+ "description": "Create a new update set with a name"
9463
9679
  },
9464
9680
  {
9465
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --records \"rec-001,rec-002,rec-003\" --auth dev-instance",
9466
- "description": "Move specific records to a target update set"
9681
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --description \"Update set for feature X\" --auth dev-instance",
9682
+ "description": "Create with name and description"
9467
9683
  },
9468
9684
  {
9469
- "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --json --auth dev-instance",
9470
- "description": "Move records with JSON output"
9685
+ "command": "<%= config.bin %> <%= command.id %> --name \"My Feature Set\" --application x_my_app --auth dev-instance",
9686
+ "description": "Create within a specific application scope"
9471
9687
  }
9472
9688
  ],
9473
9689
  "flags": {
@@ -9552,25 +9768,27 @@
9552
9768
  "allowNo": false,
9553
9769
  "type": "boolean"
9554
9770
  },
9555
- "records": {
9556
- "description": "Comma-separated sys_ids of records to move",
9557
- "name": "records",
9771
+ "application": {
9772
+ "description": "Application scope for the new update set",
9773
+ "name": "application",
9558
9774
  "required": false,
9559
9775
  "hasDynamicHelp": false,
9560
9776
  "multiple": false,
9561
9777
  "type": "option"
9562
9778
  },
9563
- "source": {
9564
- "description": "Source update set sys_id",
9565
- "name": "source",
9779
+ "description": {
9780
+ "char": "d",
9781
+ "description": "Description for the new update set",
9782
+ "name": "description",
9566
9783
  "required": false,
9567
9784
  "hasDynamicHelp": false,
9568
9785
  "multiple": false,
9569
9786
  "type": "option"
9570
9787
  },
9571
- "target": {
9572
- "description": "Target update set sys_id",
9573
- "name": "target",
9788
+ "name": {
9789
+ "char": "n",
9790
+ "description": "Name for the new update set",
9791
+ "name": "name",
9574
9792
  "required": true,
9575
9793
  "hasDynamicHelp": false,
9576
9794
  "multiple": false,
@@ -9579,7 +9797,7 @@
9579
9797
  },
9580
9798
  "hasDynamicHelp": false,
9581
9799
  "hiddenAliases": [],
9582
- "id": "update-set:move",
9800
+ "id": "update-set:create",
9583
9801
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9584
9802
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9585
9803
  "pluginType": "core",
@@ -9590,21 +9808,25 @@
9590
9808
  "dist",
9591
9809
  "commands",
9592
9810
  "update-set",
9593
- "move.js"
9811
+ "create.js"
9594
9812
  ]
9595
9813
  },
9596
- "task:approve": {
9814
+ "update-set:current": {
9597
9815
  "aliases": [],
9598
9816
  "args": {},
9599
- "description": "Approve a ServiceNow change request.\n\nThis command approves a change request identified by its number. You can optionally provide approval comments.\n\nFeatures:\n - Approve change requests\n - Optionally add approval comments\n - Auto-resolves change request number to sys_id",
9817
+ "description": "Get or set the current update set.",
9600
9818
  "examples": [
9601
9819
  {
9602
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --auth dev",
9603
- "description": "Approve a change request"
9820
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9821
+ "description": "Get the current update set"
9604
9822
  },
9605
9823
  {
9606
- "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 -c \"Looks good, approved\" --auth dev",
9607
- "description": "Approve a change request with comments"
9824
+ "command": "<%= config.bin %> <%= command.id %> --set us-001 --auth dev-instance",
9825
+ "description": "Set the current update set by sys_id"
9826
+ },
9827
+ {
9828
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9829
+ "description": "Get the current update set as JSON"
9608
9830
  }
9609
9831
  ],
9610
9832
  "flags": {
@@ -9684,25 +9906,16 @@
9684
9906
  "read-only": {
9685
9907
  "description": "Refuse every change to the instance — equivalent to --deny-write --deny-execute. Reads are unaffected.",
9686
9908
  "helpGroup": "GLOBAL",
9687
- "name": "read-only",
9688
- "required": false,
9689
- "allowNo": false,
9690
- "type": "boolean"
9691
- },
9692
- "comments": {
9693
- "char": "c",
9694
- "description": "Approval comments",
9695
- "name": "comments",
9909
+ "name": "read-only",
9696
9910
  "required": false,
9697
- "hasDynamicHelp": false,
9698
- "multiple": false,
9699
- "type": "option"
9911
+ "allowNo": false,
9912
+ "type": "boolean"
9700
9913
  },
9701
- "number": {
9702
- "char": "n",
9703
- "description": "Change request number (e.g., CHG0010001)",
9704
- "name": "number",
9705
- "required": true,
9914
+ "set": {
9915
+ "char": "s",
9916
+ "description": "sys_id of update set to make current",
9917
+ "name": "set",
9918
+ "required": false,
9706
9919
  "hasDynamicHelp": false,
9707
9920
  "multiple": false,
9708
9921
  "type": "option"
@@ -9710,7 +9923,7 @@
9710
9923
  },
9711
9924
  "hasDynamicHelp": false,
9712
9925
  "hiddenAliases": [],
9713
- "id": "task:approve",
9926
+ "id": "update-set:current",
9714
9927
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9715
9928
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9716
9929
  "pluginType": "core",
@@ -9720,26 +9933,26 @@
9720
9933
  "relativePath": [
9721
9934
  "dist",
9722
9935
  "commands",
9723
- "task",
9724
- "approve.js"
9936
+ "update-set",
9937
+ "current.js"
9725
9938
  ]
9726
9939
  },
9727
- "task:assign": {
9940
+ "update-set": {
9728
9941
  "aliases": [],
9729
9942
  "args": {},
9730
- "description": "Assign a ServiceNow task to a user or group.\n\nThis command assigns a task record identified by its number to a specified user and/or group. You can assign to a user, a group, or both simultaneously.\n\nFeatures:\n - Assign tasks to individual users\n - Assign tasks to assignment groups\n - Assign to both user and group at once\n - Supports any task-based table\n - Auto-resolves task number to sys_id",
9943
+ "description": "List update sets on a ServiceNow instance.",
9731
9944
  "examples": [
9732
9945
  {
9733
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --user admin --auth dev",
9734
- "description": "Assign an incident to a user"
9946
+ "command": "<%= config.bin %> <%= command.id %> --auth dev-instance",
9947
+ "description": "List update sets with default limit"
9735
9948
  },
9736
9949
  {
9737
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -u admin -g \"Service Desk\" --auth dev",
9738
- "description": "Assign an incident to a user and group"
9950
+ "command": "<%= config.bin %> <%= command.id %> --query \"state=in progress\" --limit 50 --auth dev-instance",
9951
+ "description": "List update sets with a custom query filter"
9739
9952
  },
9740
9953
  {
9741
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --user admin --auth dev",
9742
- "description": "Assign a change request to a user"
9954
+ "command": "<%= config.bin %> <%= command.id %> --json --auth dev-instance",
9955
+ "description": "List update sets with JSON output"
9743
9956
  }
9744
9957
  ],
9745
9958
  "flags": {
@@ -9824,38 +10037,20 @@
9824
10037
  "allowNo": false,
9825
10038
  "type": "boolean"
9826
10039
  },
9827
- "group": {
9828
- "char": "g",
9829
- "description": "Assignment group",
9830
- "name": "group",
10040
+ "limit": {
10041
+ "description": "Maximum number of update sets to return",
10042
+ "name": "limit",
9831
10043
  "required": false,
10044
+ "default": 20,
9832
10045
  "hasDynamicHelp": false,
9833
10046
  "multiple": false,
9834
10047
  "type": "option"
9835
10048
  },
9836
- "number": {
9837
- "char": "n",
9838
- "description": "Task number (e.g., INC0010001)",
9839
- "name": "number",
9840
- "required": true,
9841
- "hasDynamicHelp": false,
9842
- "multiple": false,
9843
- "type": "option"
9844
- },
9845
- "table": {
9846
- "description": "ServiceNow table name",
9847
- "name": "table",
10049
+ "query": {
10050
+ "char": "q",
10051
+ "description": "Encoded query filter",
10052
+ "name": "query",
9848
10053
  "required": false,
9849
- "default": "task",
9850
- "hasDynamicHelp": false,
9851
- "multiple": false,
9852
- "type": "option"
9853
- },
9854
- "user": {
9855
- "char": "u",
9856
- "description": "User to assign the task to",
9857
- "name": "user",
9858
- "required": true,
9859
10054
  "hasDynamicHelp": false,
9860
10055
  "multiple": false,
9861
10056
  "type": "option"
@@ -9863,7 +10058,7 @@
9863
10058
  },
9864
10059
  "hasDynamicHelp": false,
9865
10060
  "hiddenAliases": [],
9866
- "id": "task:assign",
10061
+ "id": "update-set",
9867
10062
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
9868
10063
  "pluginName": "@sonisoft/now-sdk-ext-cli",
9869
10064
  "pluginType": "core",
@@ -9873,22 +10068,22 @@
9873
10068
  "relativePath": [
9874
10069
  "dist",
9875
10070
  "commands",
9876
- "task",
9877
- "assign.js"
10071
+ "update-set",
10072
+ "index.js"
9878
10073
  ]
9879
10074
  },
9880
- "task:close": {
10075
+ "update-set:inspect": {
9881
10076
  "aliases": [],
9882
10077
  "args": {},
9883
- "description": "Close a ServiceNow incident.\n\nThis command closes an incident identified by its number, setting the close notes and optionally a close code. The incident must be in a state that allows closure.\n\nFeatures:\n - Close incidents with close notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
10078
+ "description": "Inspect the components of an update set.",
9884
10079
  "examples": [
9885
10080
  {
9886
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue confirmed resolved by user\" --auth dev",
9887
- "description": "Close an incident with close notes"
10081
+ "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --auth dev-instance",
10082
+ "description": "Inspect an update set by sys_id"
9888
10083
  },
9889
10084
  {
9890
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Closed\" --close-code \"Solved (Permanently)\" --auth dev",
9891
- "description": "Close with a specific close code"
10085
+ "command": "<%= config.bin %> <%= command.id %> --sys-id us-001 --json --auth dev-instance",
10086
+ "description": "Inspect with JSON output"
9892
10087
  }
9893
10088
  ],
9894
10089
  "flags": {
@@ -9973,26 +10168,10 @@
9973
10168
  "allowNo": false,
9974
10169
  "type": "boolean"
9975
10170
  },
9976
- "close-code": {
9977
- "description": "Close code for the closure",
9978
- "name": "close-code",
9979
- "required": false,
9980
- "hasDynamicHelp": false,
9981
- "multiple": false,
9982
- "type": "option"
9983
- },
9984
- "notes": {
9985
- "description": "Close notes",
9986
- "name": "notes",
9987
- "required": true,
9988
- "hasDynamicHelp": false,
9989
- "multiple": false,
9990
- "type": "option"
9991
- },
9992
- "number": {
9993
- "char": "n",
9994
- "description": "Incident number (e.g., INC0010001)",
9995
- "name": "number",
10171
+ "sys-id": {
10172
+ "char": "s",
10173
+ "description": "sys_id of the update set to inspect",
10174
+ "name": "sys-id",
9996
10175
  "required": true,
9997
10176
  "hasDynamicHelp": false,
9998
10177
  "multiple": false,
@@ -10001,7 +10180,7 @@
10001
10180
  },
10002
10181
  "hasDynamicHelp": false,
10003
10182
  "hiddenAliases": [],
10004
- "id": "task:close",
10183
+ "id": "update-set:inspect",
10005
10184
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10006
10185
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10007
10186
  "pluginType": "core",
@@ -10011,26 +10190,26 @@
10011
10190
  "relativePath": [
10012
10191
  "dist",
10013
10192
  "commands",
10014
- "task",
10015
- "close.js"
10193
+ "update-set",
10194
+ "inspect.js"
10016
10195
  ]
10017
10196
  },
10018
- "task:comment": {
10197
+ "update-set:move": {
10019
10198
  "aliases": [],
10020
10199
  "args": {},
10021
- "description": "Add a comment or work note to a ServiceNow task.\n\nThis command adds a comment or work note to a task record identified by its number. By default, comments are added as customer-visible comments. Use the --work-note flag to add an internal work note instead.\n\nFeatures:\n - Add customer-visible comments to any task\n - Add internal work notes visible only to fulfiller teams\n - Supports any task-based table (incident, change_request, etc.)\n - Auto-resolves task number to sys_id",
10200
+ "description": "Move records between update sets.",
10022
10201
  "examples": [
10023
10202
  {
10024
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --comment \"Investigating the issue\" --auth dev",
10025
- "description": "Add a comment to an incident"
10203
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --auth dev-instance",
10204
+ "description": "Move all records from one update set to another"
10026
10205
  },
10027
10206
  {
10028
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 -c \"Internal update\" --work-note --auth dev",
10029
- "description": "Add a work note to an incident"
10207
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --records \"rec-001,rec-002,rec-003\" --auth dev-instance",
10208
+ "description": "Move specific records to a target update set"
10030
10209
  },
10031
10210
  {
10032
- "command": "<%= config.bin %> <%= command.id %> --number CHG0010001 --table change_request --comment \"Approved\" --auth dev",
10033
- "description": "Add a comment to a change request"
10211
+ "command": "<%= config.bin %> <%= command.id %> --target us-002 --source us-001 --json --auth dev-instance",
10212
+ "description": "Move records with JSON output"
10034
10213
  }
10035
10214
  ],
10036
10215
  "flags": {
@@ -10115,44 +10294,34 @@
10115
10294
  "allowNo": false,
10116
10295
  "type": "boolean"
10117
10296
  },
10118
- "comment": {
10119
- "char": "c",
10120
- "description": "Comment text to add",
10121
- "name": "comment",
10122
- "required": true,
10297
+ "records": {
10298
+ "description": "Comma-separated sys_ids of records to move",
10299
+ "name": "records",
10300
+ "required": false,
10123
10301
  "hasDynamicHelp": false,
10124
10302
  "multiple": false,
10125
10303
  "type": "option"
10126
10304
  },
10127
- "number": {
10128
- "char": "n",
10129
- "description": "Task number (e.g., INC0010001)",
10130
- "name": "number",
10131
- "required": true,
10305
+ "source": {
10306
+ "description": "Source update set sys_id",
10307
+ "name": "source",
10308
+ "required": false,
10132
10309
  "hasDynamicHelp": false,
10133
10310
  "multiple": false,
10134
10311
  "type": "option"
10135
10312
  },
10136
- "table": {
10137
- "description": "ServiceNow table name",
10138
- "name": "table",
10139
- "required": false,
10140
- "default": "task",
10313
+ "target": {
10314
+ "description": "Target update set sys_id",
10315
+ "name": "target",
10316
+ "required": true,
10141
10317
  "hasDynamicHelp": false,
10142
10318
  "multiple": false,
10143
10319
  "type": "option"
10144
- },
10145
- "work-note": {
10146
- "description": "Add as work note instead of comment",
10147
- "name": "work-note",
10148
- "required": false,
10149
- "allowNo": false,
10150
- "type": "boolean"
10151
10320
  }
10152
10321
  },
10153
10322
  "hasDynamicHelp": false,
10154
10323
  "hiddenAliases": [],
10155
- "id": "task:comment",
10324
+ "id": "update-set:move",
10156
10325
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10157
10326
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10158
10327
  "pluginType": "core",
@@ -10162,26 +10331,22 @@
10162
10331
  "relativePath": [
10163
10332
  "dist",
10164
10333
  "commands",
10165
- "task",
10166
- "comment.js"
10334
+ "update-set",
10335
+ "move.js"
10167
10336
  ]
10168
10337
  },
10169
- "task:find": {
10338
+ "workflow:create": {
10170
10339
  "aliases": [],
10171
10340
  "args": {},
10172
- "description": "Find a ServiceNow task by its number.\n\nThis command looks up a task record by its number in the specified table. Returns the full task details including sys_id, description, state, and assignment information.\n\nFeatures:\n - Look up any task by number\n - Supports any task-based table\n - JSON output for scripting and automation",
10341
+ "description": "Create a complete workflow from a JSON specification file.",
10173
10342
  "examples": [
10174
10343
  {
10175
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --auth dev",
10176
- "description": "Find an incident by number"
10177
- },
10178
- {
10179
- "command": "<%= config.bin %> <%= command.id %> -n CHG0010001 --table change_request --auth dev",
10180
- "description": "Find a change request by number"
10344
+ "command": "<%= config.bin %> <%= command.id %> --spec ./workflow.json --auth dev",
10345
+ "description": "Create a workflow from a JSON spec file"
10181
10346
  },
10182
10347
  {
10183
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --json --auth dev",
10184
- "description": "Find an incident and output as JSON"
10348
+ "command": "<%= config.bin %> <%= command.id %> -s ./workflow.json --json --auth dev",
10349
+ "description": "Create a workflow and output result as JSON"
10185
10350
  }
10186
10351
  ],
10187
10352
  "flags": {
@@ -10266,28 +10431,19 @@
10266
10431
  "allowNo": false,
10267
10432
  "type": "boolean"
10268
10433
  },
10269
- "number": {
10270
- "char": "n",
10271
- "description": "Task number (e.g., INC0010001, CHG0010001)",
10272
- "name": "number",
10434
+ "spec": {
10435
+ "char": "s",
10436
+ "description": "Path to workflow JSON specification file",
10437
+ "name": "spec",
10273
10438
  "required": true,
10274
10439
  "hasDynamicHelp": false,
10275
10440
  "multiple": false,
10276
10441
  "type": "option"
10277
- },
10278
- "table": {
10279
- "description": "ServiceNow table name",
10280
- "name": "table",
10281
- "required": false,
10282
- "default": "task",
10283
- "hasDynamicHelp": false,
10284
- "multiple": false,
10285
- "type": "option"
10286
10442
  }
10287
10443
  },
10288
10444
  "hasDynamicHelp": false,
10289
10445
  "hiddenAliases": [],
10290
- "id": "task:find",
10446
+ "id": "workflow:create",
10291
10447
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10292
10448
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10293
10449
  "pluginType": "core",
@@ -10297,22 +10453,22 @@
10297
10453
  "relativePath": [
10298
10454
  "dist",
10299
10455
  "commands",
10300
- "task",
10301
- "find.js"
10456
+ "workflow",
10457
+ "create.js"
10302
10458
  ]
10303
10459
  },
10304
- "task:resolve": {
10460
+ "workflow:publish": {
10305
10461
  "aliases": [],
10306
10462
  "args": {},
10307
- "description": "Resolve a ServiceNow incident with resolution notes.\n\nThis command resolves an incident identified by its number, setting the resolution notes and optionally a close code. The incident must be in a state that allows resolution.\n\nFeatures:\n - Resolve incidents with resolution notes\n - Optionally specify a close code\n - Auto-resolves incident number to sys_id",
10463
+ "description": "Publish a workflow version.",
10308
10464
  "examples": [
10309
10465
  {
10310
- "command": "<%= config.bin %> <%= command.id %> --number INC0010001 --notes \"Issue resolved by restarting the service\" --auth dev",
10311
- "description": "Resolve an incident with resolution notes"
10466
+ "command": "<%= config.bin %> <%= command.id %> --version-id wfv-001 --start-activity act-001 --auth dev",
10467
+ "description": "Publish a workflow version"
10312
10468
  },
10313
10469
  {
10314
- "command": "<%= config.bin %> <%= command.id %> -n INC0010001 --notes \"Fixed\" --close-code \"Solved (Permanently)\" --auth dev",
10315
- "description": "Resolve with a specific close code"
10470
+ "command": "<%= config.bin %> <%= command.id %> -v wfv-001 -s act-001 --json --auth dev",
10471
+ "description": "Publish a workflow version and output as JSON"
10316
10472
  }
10317
10473
  ],
10318
10474
  "flags": {
@@ -10397,26 +10553,19 @@
10397
10553
  "allowNo": false,
10398
10554
  "type": "boolean"
10399
10555
  },
10400
- "close-code": {
10401
- "description": "Close code for the resolution",
10402
- "name": "close-code",
10403
- "required": false,
10404
- "hasDynamicHelp": false,
10405
- "multiple": false,
10406
- "type": "option"
10407
- },
10408
- "notes": {
10409
- "description": "Resolution notes",
10410
- "name": "notes",
10556
+ "start-activity": {
10557
+ "char": "s",
10558
+ "description": "Sys ID of the start activity",
10559
+ "name": "start-activity",
10411
10560
  "required": true,
10412
10561
  "hasDynamicHelp": false,
10413
10562
  "multiple": false,
10414
10563
  "type": "option"
10415
10564
  },
10416
- "number": {
10417
- "char": "n",
10418
- "description": "Incident number (e.g., INC0010001)",
10419
- "name": "number",
10565
+ "version-id": {
10566
+ "char": "v",
10567
+ "description": "Sys ID of the workflow version to publish",
10568
+ "name": "version-id",
10420
10569
  "required": true,
10421
10570
  "hasDynamicHelp": false,
10422
10571
  "multiple": false,
@@ -10425,7 +10574,7 @@
10425
10574
  },
10426
10575
  "hasDynamicHelp": false,
10427
10576
  "hiddenAliases": [],
10428
- "id": "task:resolve",
10577
+ "id": "workflow:publish",
10429
10578
  "pluginAlias": "@sonisoft/now-sdk-ext-cli",
10430
10579
  "pluginName": "@sonisoft/now-sdk-ext-cli",
10431
10580
  "pluginType": "core",
@@ -10435,8 +10584,8 @@
10435
10584
  "relativePath": [
10436
10585
  "dist",
10437
10586
  "commands",
10438
- "task",
10439
- "resolve.js"
10587
+ "workflow",
10588
+ "publish.js"
10440
10589
  ]
10441
10590
  },
10442
10591
  "xml:export": {
@@ -10717,5 +10866,5 @@
10717
10866
  ]
10718
10867
  }
10719
10868
  },
10720
- "version": "5.5.0"
10869
+ "version": "5.7.0"
10721
10870
  }