A comprehensive Go SDK and interactive CLI for ServiceNow
Empowering developers with elegant APIs and terminal-based exploration

ServiceNow Toolkit is a modern, feature-rich Go SDK and CLI tool that transforms how you interact with ServiceNow. Whether you're building integrations, automating workflows, or exploring data, ServiceNow Toolkit provides the tools you need with an emphasis on developer experience and productivity.

- π― Developer-First Design - Intuitive APIs that feel natural to Go developers
- π₯οΈ Interactive Terminal UI - Beautiful TUI for exploring ServiceNow data directly from your terminal
- π Multi-Auth Support - API Key, Basic Auth, OAuth 2.0 - all authentication methods supported
- β‘ High Performance - Built-in rate limiting, retry logic, and batch operations
- π οΈ Production Ready - Context support, error handling, and enterprise-grade reliability
- π Rich Analytics - Comprehensive aggregation and statistical operations
- π¨ Extensible - Clean architecture that's easy to extend and customize
π Quick Start
Installation
# Install the CLI
go install github.com/Krive/ServiceNow-Toolkit/cmd/servicenowtoolkit@latest
# Create a shorter alias (optional)
alias snt=servicenowtoolkit
# Or use as a library in your Go project
go get github.com/Krive/ServiceNow-Toolkit
Environment Variables
Create a .env file in the project root:
SERVICENOW_INSTANCE_URL=https://yourinstance.service-now.com
SERVICENOW_USERNAME=yourusername
SERVICENOW_PASSWORD=yourpassword
SERVICENOW_API_KEY=your_api_key
SERVICENOW_CLIENT_ID=your_client_id
SERVICENOW_CLIENT_SECRET=your_client_secret
30-Second Demo
package main
import (
"fmt"
"log"
"github.com/Krive/ServiceNow-Toolkit/pkg/servicenow"
"github.com/Krive/ServiceNow-Toolkit/pkg/servicenow/query"
)
func main() {
// Connect to ServiceNow
client, err := servicenow.NewClientAPIKey(
"https://yourinstance.service-now.com",
"your-api-key",
)
if err != nil {
log.Fatal(err)
}
// Query high-priority incidents
incidents, err := client.Table("incident").
Where("priority", query.OpEquals, "1").
Where("state", query.OpEquals, "1").
OrderByDesc("sys_created_on").
Limit(10).
Execute()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Found %d critical incidents\n", len(incidents))
for _, incident := range incidents {
fmt.Printf("β’ %s: %s\n",
incident["number"],
incident["short_description"])
}
}
Interactive Explorer
Launch the beautiful terminal UI to explore your ServiceNow instance:
# Launch interactive explorer
servicenowtoolkit explorer --api-key "your-key" --instance "https://your-instance.service-now.com"
# Or use demo mode to see the interface
servicenowtoolkit explorer --demo
π― Core Features
π Complete Table Operations
- Full CRUD operations with intuitive APIs
- Advanced query builder with complex conditions
- Bulk operations for high-performance data processing
- Custom field support for extended ServiceNow configurations
π₯ Identity & Access Management
- User, role, and group management
- Access control validation and reporting
- Session management and authentication tracking
- Comprehensive permission analysis
ποΈ CMDB Integration
- Configuration item management
- Relationship mapping and dependency tracking
- Class hierarchy exploration
- Automated discovery data handling
π Analytics & Aggregation
- Statistical operations (count, sum, avg, std dev)
- Multi-dimensional grouping and analysis
- Custom metrics and KPI calculations
- Real-time data insights
π Service Catalog Management
- Catalog browsing and item discovery
- Variable validation and price estimation
- Cart management and order processing
- Request tracking and workflow monitoring
π Enterprise Authentication
- API Key authentication (recommended)
- Basic username/password authentication
- OAuth 2.0 client credentials flow
- OAuth authorization code with refresh tokens
- Intelligent rate limiting with burst capacity
- Exponential backoff retry mechanisms
- Context-aware timeouts and cancellation
- Connection pooling and keep-alive
π₯οΈ Interactive Terminal UI
ServiceNow Toolkit includes a stunning terminal user interface that brings ServiceNow exploration to your command line:
TUI Features:
- Table Browser - Interactive data exploration with filtering
- Identity Browser - User, role, and group management interface
- CMDB Explorer - Configuration item relationship mapping
- Global Search - Cross-table search capabilities
- Real-time Updates - Live data refresh and monitoring
- Keyboard Navigation - Vim-like shortcuts for power users
π Documentation
π Getting Started
π API Reference
π οΈ Advanced Topics
π§ Examples
Explore real-world usage patterns:
# View all available examples
ls examples/
# Key examples to get started:
examples/
βββ basic_auth/ # Basic authentication setup
βββ api_key/ # API key authentication
βββ oauth_refresh/ # OAuth with refresh tokens
βββ table_operations/ # CRUD operations
βββ advanced_queries/ # Complex query patterns
βββ batch/ # Bulk operations
βββ aggregate/ # Statistical analysis
βββ catalog/ # Service catalog integration
βββ attachments/ # File upload/download
π CLI Commands
ServiceNow Toolkit provides a comprehensive command-line interface:
# Table operations
servicenowtoolkit table incident list --limit 10
servicenowtoolkit table incident get INC0000123
servicenowtoolkit table incident create --data '{"short_description":"Test incident"}'
# Identity management
servicenowtoolkit identity users list --active
servicenowtoolkit identity roles list --elevated
servicenowtoolkit identity groups list --type "itil"
# CMDB operations
servicenowtoolkit cmdb list --class "cmdb_ci_server"
servicenowtoolkit cmdb relationships --ci "server123"
# Batch operations
servicenowtoolkit batch create incident --file incidents.json
servicenowtoolkit batch update incident --file updates.json
# Service catalog
servicenowtoolkit catalog items list --category "hardware"
servicenowtoolkit catalog order --item "laptop_request" --quantity 1
# Analytics and aggregation
servicenowtoolkit aggregate incident --group-by state --count
servicenowtoolkit aggregate incident --metrics "avg:priority,sum:impact"
# Interactive explorer
servicenowtoolkit explorer --demo # Demo mode
servicenowtoolkit explorer --api-key "your-key" # Live connection
π‘οΈ Security & Best Practices
ServiceNow Toolkit is built with security and enterprise needs in mind:
Authentication Priority
- API Key (recommended) - Secure, rotatable, scoped access
- Basic Auth - Simple username/password for development
- OAuth Client Credentials - Service-to-service authentication
- OAuth Authorization Code - User-delegated access
Security Features
- Secure credential storage and management
- Automatic token refresh and rotation
- Rate limiting to prevent abuse
- Context-aware timeout handling
- Comprehensive audit logging
π Roadmap
Exciting features coming soon:
- π Real-time Data Streaming - Live updates and change notifications
- π§ͺ Advanced Testing Tools - ServiceNow instance testing and validation
- π± REST API Gateway - Transform ServiceNow Toolkit into a microservice
- π Plugin Architecture - Extensible modules for custom functionality
- π Advanced Analytics - Machine learning insights and predictions
- π Multi-Instance Management - Manage multiple ServiceNow environments
View our complete roadmap for more details.
π License
π Acknowledgments
ServiceNow Toolkit is built with excellent open-source libraries: