AI Agent Support
Use AI coding assistants like Cursor, GitHub Copilot, and Windsurf with sn-scriptsync for automated ServiceNow development.
Last updated: January 24, 2026
Last updated: January 24, 2026
Version 4.0 of sn-scriptsync brings native AI coding assistant support. Changes made by AI tools are automatically detected and synced to your ServiceNow instance.
sn-scriptsync works with any tool that modifies files on disk:
syncDelay setting controls sync frequency (default: 30 seconds, set to 0 to disable)Manual saves (Ctrl+S / Cmd+S) always sync immediately, bypassing the queue.
A tree view panel shows files waiting to sync:
When you start sn-scriptsync, an agentinstructions.md file is automatically copied to your workspace root. Rename it based on your AI tool:
.cursorrulesCLAUDE.md.github/copilot-instructions.md.windsurfrulesThis file contains guidelines for AI agents to work effectively with sn-scriptsync, including file structure patterns, Agent API documentation, and ServiceNow best practices. You can expand it with your own project-specific instructions.
AI agents can create new ServiceNow artifacts by creating files in the correct folder structure:
{instance}/{scope}/{table}/{name}.{field}.{extension}
For example, to create a new Script Include:
myinstance/global/sys_script_include/MyNewUtils.script.js
The extension will automatically detect the new file, create the record in ServiceNow, and update _map.json with the new sys_id.
For advanced integrations, sn-scriptsync exposes a file-based API. AI agents can interact programmatically via an event-driven folder queue — no npm packages, no HTTP servers, just JSON files.
agent/requests/ as req_<id>.jsonagent/responses/ as res_<id>.json| Command | Description |
|---|---|
check_connection | Verify server and browser connection |
get_sync_status | Get current sync queue status |
sync_now | Immediately sync all pending files |
query_records | Query any ServiceNow table with encoded queries |
create_artifact | Create new records (Script Includes, Business Rules, etc.) |
update_record | Update an existing record |
update_record_batch | Update multiple records at once |
open_in_browser | Open artifacts in ServiceNow |
take_screenshot | Capture ServiceNow pages |
upload_attachment | Attach files to records |
switch_context | Switch update sets, application scope, or domain |
{
"id": "check_1",
"command": "check_connection"
}
See the sn-scriptsync GitHub repository for full Agent API documentation.
Comprehensive security measures protect your workspace and ServiceNow instance:
agent/ folders are excluded from ServiceNow sync and git tracking