ServiceNow-Toolkit

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: Apache-2.0

README ΒΆ

ServiceNow Toolkit πŸš€

A comprehensive Go SDK and interactive CLI for ServiceNow

Empowering developers with elegant APIs and terminal-based exploration

Go Version ServiceNow


🌟 What is ServiceNow Toolkit?

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.

✨ Why ServiceNow Toolkit?
  • 🎯 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

# 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
⚑ Performance & Reliability
  • 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
  1. API Key (recommended) - Secure, rotatable, scoped access
  2. Basic Auth - Simple username/password for development
  3. OAuth Client Credentials - Service-to-service authentication
  4. 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:


⭐ Star this project if you find it useful!

πŸ› Found an issue? Report it here

πŸ’¬ Questions? Start a discussion


Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL