Jace's ServiceNow CLI (jsn)
Explore and manage ServiceNow instances. Interactive paginated pickers with server-side search on all list commands.
Discovery
jsn --help # All commands grouped by domain
jsn <command> --help # Flags, subcommands, and examples
Interactive Picker
All list subcommands use a paginated interactive picker in TTY mode:
- Arrow through items (10 per page)
- Type to search (server-side LIKE query)
- Scroll past last loaded item to load next page
- Enter to select, Esc to cancel
- Falls back to table output with
--json
Agent Rules
- Output modes —
--json when parsing data; text when presenting to humans
- Use sys_id for updates — All update/delete operations require sys_id
- Check auth first — Run
jsn auth status before operations
- NEVER logout — Only run
jsn auth logout if the user explicitly asks
- Use
--profile <name> to target a specific instance, or jsn auth switch <name> to change the default
- Before using
eval or rest — Ask: "Is there a more specific jsn command?" Prefer specific over generic over escape hatch over eval.
- CONFIRM before destructive operations — Show what will be created/updated/deleted and ask for approval.
Command Hierarchy
Pick the most specific tool for the job. Never default to eval — it's the last resort:
- Specific commands —
jsn flows, jsn rules, jsn catalogitems, etc.
jsn records --table <name> — generic CRUD on any table
jsn docs search <query> — offline ServiceNow documentation search (no instance needed)
jsn rest — raw Table API escape hatch
jsn eval — ⚠️ LAST RESORT ONLY
- Ask the human — if none of the above work
Key Commands
| Domain |
Commands |
| Core |
incidents, changes, requests, tasks |
| Catalog |
catalogitems list/show/create — items with variables and flow info |
| Automation |
flows, actions, rules, workflows, triggers, scheduledjobs |
| Access |
acls, b4rules, roles, groups, users |
| UX |
forms (section/element layout), lists, clientscripts, uipolicies |
| Data |
tables, columns, includes, logs, properties, records |
| Config |
setup, auth, updatesets, scopes |
| Docs |
docs sync, docs status, docs search, docs serve |
| Developer |
eval, rest, skill, version |
jsn rest examples
# Query any table by name
jsn rest --table incident --query "active=true" --limit 5 --json
# GET a single record
jsn rest --table incident --sys-id abc123... --json
# Raw endpoint access
jsn rest "/api/now/table/incident?sysparm_limit=3" --json
jsn docs — offline documentation search
No ServiceNow instance required. Searches the full ServiceNow docs locally with FTS5 + semantic hybrid search.
# First run: download docs and build the index (~45k files, ~3-5 min)
jsn docs sync
# Check state
jsn docs status
# Search (keyword + semantic hybrid)
jsn docs search "GlideRecord query" --limit 5 --json
# Filter by bundle
jsn docs search "REST API" --bundle it-service-management --json
# Start the web UI
jsn docs serve
# Share on your network
jsn docs serve --expose
Re-running jsn docs sync does a smart incremental refresh — pulls latest docs and only rebuilds changed files (seconds, not minutes).
Troubleshooting Field Behavior
Check order (priority):
- Before-query business rules —
sys_script with when=before, action=queryjsn b4rules list --query "collection=sys_user"
- ACLs —
jsn acls list --query "name=incident"
- Dictionary overrides —
jsn records list --table sys_dictionary --query "name=incident^element=caller_id"
- Client scripts / UI policies — form-level field behavior
Configuration
~/.config/servicenow/
├── config.json # Profiles and settings
└── credentials.json # Auth tokens (fallback)
1---2name: servicenow3description: Interact with ServiceNow instances via the jsn CLI. Use when working with ServiceNow development, administration, or data exploration. Handles tables, records, business rules, flows, script includes, ACLs, update sets, and more. Triggered by ServiceNow URLs (service-now.com, servicenow.com) or when the user mentions ServiceNow, jsn, servicenow, or related terms like tables, records, business rules, flows, script includes, ACLs, update sets, or encoded queries.4license: MIT5---67# Jace's ServiceNow CLI (jsn)89Explore and manage ServiceNow instances. Interactive paginated pickers with server-side search on all list commands.1011## Discovery1213```bash14jsn --help # All commands grouped by domain15jsn <command> --help # Flags, subcommands, and examples16```1718## Interactive Picker1920All `list` subcommands use a paginated interactive picker in TTY mode:21- Arrow through items (10 per page)22- Type to search (server-side LIKE query)23- Scroll past last loaded item to load next page24- Enter to select, Esc to cancel25- Falls back to table output with `--json`2627## Agent Rules28291. **Output modes** — `--json` when parsing data; text when presenting to humans302. **Use sys_id for updates** — All update/delete operations require sys_id313. **Check auth first** — Run `jsn auth status` before operations324. **NEVER logout** — Only run `jsn auth logout` if the user explicitly asks335. **Use `--profile <name>`** to target a specific instance, or `jsn auth switch <name>` to change the default346. **Before using `eval` or `rest`** — Ask: *"Is there a more specific jsn command?"* Prefer specific over generic over escape hatch over eval.357. **CONFIRM before destructive operations** — Show what will be created/updated/deleted and ask for approval.3637## Command Hierarchy3839Pick the most specific tool for the job. **Never default to eval** — it's the last resort:40411. **Specific commands** — `jsn flows`, `jsn rules`, `jsn catalogitems`, etc.422. **`jsn records --table <name>`** — generic CRUD on any table433. **`jsn docs search <query>`** — offline ServiceNow documentation search (no instance needed)444. **`jsn rest`** — raw Table API escape hatch455. **`jsn eval`** — ⚠️ **LAST RESORT ONLY**466. **Ask the human** — if none of the above work4748## Key Commands4950| Domain | Commands |51|--------|---------|52| **Core** | `incidents`, `changes`, `requests`, `tasks` |53| **Catalog** | `catalogitems list/show/create` — items with variables and flow info |54| **Automation** | `flows`, `actions`, `rules`, `workflows`, `triggers`, `scheduledjobs` |55| **Access** | `acls`, `b4rules`, `roles`, `groups`, `users` |56| **UX** | `forms` (section/element layout), `lists`, `clientscripts`, `uipolicies` |57| **Data** | `tables`, `columns`, `includes`, `logs`, `properties`, `records` |58| **Config** | `setup`, `auth`, `updatesets`, `scopes` |59| **Docs** | `docs sync`, `docs status`, `docs search`, `docs serve` |60| **Developer** | `eval`, `rest`, `skill`, `version` |6162### `jsn rest` examples6364```bash65# Query any table by name66jsn rest --table incident --query "active=true" --limit 5 --json6768# GET a single record69jsn rest --table incident --sys-id abc123... --json7071# Raw endpoint access72jsn rest "/api/now/table/incident?sysparm_limit=3" --json73```7475### `jsn docs` — offline documentation search7677No ServiceNow instance required. Searches the full ServiceNow docs locally with FTS5 + semantic hybrid search.7879```bash80# First run: download docs and build the index (~45k files, ~3-5 min)81jsn docs sync8283# Check state84jsn docs status8586# Search (keyword + semantic hybrid)87jsn docs search "GlideRecord query" --limit 5 --json8889# Filter by bundle90jsn docs search "REST API" --bundle it-service-management --json9192# Start the web UI93jsn docs serve9495# Share on your network96jsn docs serve --expose97```9899**Re-running `jsn docs sync`** does a smart incremental refresh — pulls latest docs and only rebuilds changed files (seconds, not minutes).100101## Troubleshooting Field Behavior102103Check order (priority):1041051. **Before-query business rules** — `sys_script` with `when=before`, `action=query`106 ```bash107 jsn b4rules list --query "collection=sys_user"108 ```1092. **ACLs** — `jsn acls list --query "name=incident"`1103. **Dictionary overrides** — `jsn records list --table sys_dictionary --query "name=incident^element=caller_id"`1114. **Client scripts** / **UI policies** — form-level field behavior112113## Configuration114115```116~/.config/servicenow/117├── config.json # Profiles and settings118└── credentials.json # Auth tokens (fallback)119```