sn

sn is a command-line tool for ServiceNow. Look up incidents, create change requests,
upload attachments, move update sets, and run tests from your terminal.
It connects to your instance through ServiceNow's APIs and runs as a single binary,
with nothing to install on the instance. Use it for a quick lookup, as part of a shell
script or CI pipeline, or with an AI coding agent. JSON is the default output; add
--output table when you'd rather read columns in the terminal.
Quickstart
To install with Homebrew on macOS or Linux, run the following command:
brew install tehubersheezy/sn/sn
For Windows, shell installers, and pre-built binaries, see the
setup guide.
For OAuth or SSO, we recommend creating an Application Registry entry and using its
client ID.
To connect to your instance, use the sn init command. It asks
for the instance URL and credentials, checks the connection, and saves a profile for future
commands:
sn init
To check the connection, use the sn ping command:
sn ping
Try a few reads. To list up to five active incidents, use the
sn table list command:
sn table list incident --query 'active=true' --setlimit 5
To read one incident, including its catalog variables and work notes, use the
sn get command:
sn get NUMBER
Replace NUMBER with an incident number from your instance, such as INC0010001.
To see which incident fields you can write, use the
sn schema columns command:
sn schema columns incident --writable
To create an incident, use the
sn table create command:
sn table create incident --field short_description='Disk full on prod-db-01'
To watch for changes, use the sn watch command. Press
Control+C to stop:
sn watch incident --query 'active=true'
What it can do
The usage guide has examples for each command, and the
command reference lists every argument and flag.