Skip to content

Repository files navigation

JSN — ServiceNow CLI

A command-line interface for ServiceNow. Type jsn and start working — no web UI needed.

Works standalone or with AI agents (Claude Code, OpenCode, Hermes, Cursor, Copilot).

Install

npm install -g @jacebenson/jsn

Node.js 18+. macOS, Linux, Windows.

The install also copies an AI agent skill file to ~/.agents/skills/servicenow/SKILL.md.

Quick Start

jsn setup                                    # Interactive first-time setup
jsn auth login https://dev12345.service-now.com
jsn incidents list --query "priority=1"      # Critical incidents

What It Does

jsn talks to the ServiceNow REST API. Read, create, update, delete — tickets, users, groups, records on any table. Inspect flows and business rules. Export update sets. Run background scripts.

Everything outputs JSON when piped, styled tables in a terminal.

# Core ticket work
jsn incidents list --query "active=true^priority=1"
jsn incidents INC0010001
jsn incidents create --description "Server down" --priority 1

# Admin tasks
jsn flows list                                # Interactive picker with pagination
jsn flows show "Assign Task"                  # Full flow detail
jsn rules list --query "collection=incident"
jsn updatesets set "My Feature"

# Generic table access
jsn records list --table incident --limit 50 --json | jq '.[].number'
jsn records create --table incident --data '{"short_description":"test"}'

# Script execution
jsn eval "gs.info('Hello World')"

Commands

Run jsn for the full grouped list. Commands are organized by ServiceNow domain:

Coreincidents, changes, requests, tasks, tickets

Automationflows, actions, rules, scrapi, updatesets, eval, rest

Accessacls, roles, scopes, properties, privileges

User Experienceforms, lists, clientscripts, uipolicies, uiactions

Datarecords, tables, columns, includes, import, logs, users, groups

Every command supports --json, --query, and --help.

Profiles

Switch between instances without re-authenticating.

jsn auth login https://dev12345.service-now.com
jsn profiles list
jsn profiles use dev12345
jsn profiles show

Output Formats

Flag When to use
(default) Terminal — styled tables
--json Pipelines, scripts
--markdown Documentation
--quiet / -q Data only, no envelope

Authentication

OAuth 2.0 with PKCE. Credentials in ~/.config/servicenow/credentials/.

jsn auth login https://dev12345.service-now.com

For CI/CD, set environment variables:

export SERVICENOW_INSTANCE_URL="https://dev12345.service-now.com"
export SERVICENOW_OAUTH_TOKEN="***"
jsn incidents list

AI Agents

jsn ships with a skill file that tells AI agents how to use it. Installed automatically to ~/.agents/skills/servicenow/SKILL.md.

jsn skill show                  # View the skill
jsn skill install               # Install to Hermes
jsn skill install --target all  # All supported agents

Development

git clone https://github.com/jacebenson/jsn.git
cd jsn
npm install
npm test

Releases: npm run release -- patch (or minor, major). Tags, pushes, and publishes to npm via GitHub Actions.

License

MIT

About

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages