KosmoKrator

itsm

ServiceNow CLI for Shell Scripts

Use the ServiceNow CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.

10 functions 7 read 3 write Username and password auth

ServiceNow CLI for Shell Scripts

Call integration functions from shell scripts with stable JSON input and output.

Use shell scripts for small local automations that need one or more integration calls. The ServiceNow CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.

Command Shape

# ServiceNow CLI for Shell Scripts
kosmokrator integrations:configure servicenow --set username="$SERVICENOW_USERNAME" --set password="$SERVICENOW_PASSWORD" --set instance="$SERVICENOW_INSTANCE" --enable --read allow --write ask --json
kosmo integrations:call servicenow.servicenow_list_incidents '{"query":"example_query","limit":1}' --json

Discovery Before Execution

Agents and scripts can inspect ServiceNow docs and schemas before choosing a function.

kosmo integrations:docs servicenow --json
kosmo integrations:docs servicenow.servicenow_list_incidents --json
kosmo integrations:schema servicenow.servicenow_list_incidents --json
kosmo integrations:search "ServiceNow" --json
kosmo integrations:list --json

Useful ServiceNow CLI Functions

FunctionTypeParametersDescription
servicenow.servicenow_list_incidents Read query, limit List incidents from the ServiceNow incident table. Supports filtering via an encoded query string (sysparm_query) and a configurable result limit.
servicenow.servicenow_get_incident Read id Retrieve a single ServiceNow incident by its sys_id. Returns the full incident record.
servicenow.servicenow_create_incident Write short_description, description, priority Create a new ServiceNow incident. Provide a short description, an optional full description, and a priority level.
servicenow.servicenow_update_incident Write id, fields Update an existing ServiceNow incident. Provide the incident sys_id and the fields to update.
servicenow.servicenow_list_tasks Read query, limit List tasks from the ServiceNow task table. Supports filtering via an encoded query string and a configurable result limit.
servicenow.servicenow_get_task Read id Retrieve a single ServiceNow task by its sys_id. Returns the full task record.
servicenow.servicenow_create_task Write short_description, description, assigned_to, priority Create a new ServiceNow task. Provide a short description and optional additional fields.
servicenow.servicenow_list_users Read query, limit List users from the ServiceNow sys_user table. Supports filtering via an encoded query string and a configurable result limit.
servicenow.servicenow_get_user Read id Retrieve a single ServiceNow user by their sys_id. Returns the full user record.
servicenow.servicenow_get_current_user Read none Get the profile of the currently authenticated ServiceNow user. Useful for verifying credentials and retrieving the logged-in user's details.

Automation Notes

Related ServiceNow CLI Pages