npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cisco-yang

v1.2.1

Published

CLI and SDK for IOS-XE devices via RESTCONF

Readme

Cisco YANG Library & CLI

npm version CI License: MIT Node.js Version Skills Buy Me a Coffee

A JavaScript library and CLI to interact with Cisco IOS-XE devices via RESTCONF (HTTP/JSON). Dynamically discovers YANG models and RPC operations on the device — works with any IOS-XE platform (CUBE, ISR, Cat8k, CSR).

Focused on voice gateway troubleshooting: dial-peers, SIP configuration, voice registrations, and device health checks.

RESTCONF information can be found at: Cisco IOS-XE Programmability Configuration Guide.

Installation

npm install cisco-yang

Global CLI install

npm install -g cisco-yang

Or run without installing:

npx cisco-yang --help

AI Agent Skills

npx skills add sieteunoseis/cisco-yang

Requirements

If you are using self-signed certificates on IOS-XE devices you may need to disable TLS verification, or use the --insecure CLI flag.

RESTCONF must be enabled on the device:

conf t
restconf
ip http secure-server

Quick Start

# Configure a device
cisco-yang config add myrouter --host 10.0.0.1 --username admin --password secret --insecure

# Test the connection
cisco-yang config test

# Run the health check
cisco-yang doctor

# Get hostname
cisco-yang get "Cisco-IOS-XE-native:native/hostname"

# Get interfaces (flattened table)
cisco-yang get "Cisco-IOS-XE-native:native/interface/GigabitEthernet"

# List all YANG models
cisco-yang models --filter voice

# List available RPC operations
cisco-yang operations

Configuration

cisco-yang config add <name> --host <host> --username <user> --password <pass> [--insecure]
cisco-yang config use <name>       # switch active device
cisco-yang config list             # list all devices
cisco-yang config show             # show active device (masks passwords)
cisco-yang config remove <name>    # remove a device
cisco-yang config test             # test RESTCONF connectivity

Auth precedence: CLI flags > env vars (CISCO_YANG_HOST, CISCO_YANG_USERNAME, CISCO_YANG_PASSWORD) > config file.

Config stored at ~/.cisco-yang/config.json. Supports ss-cli <ss:ID:field> placeholders.

CLI Commands

| Command | Description | | ------------------ | ------------------------------------------------------ | | get <path> | GET a YANG resource at the given RESTCONF path | | set <path> | PATCH (or PUT with --method put) data at a YANG path | | delete <path> | DELETE a YANG resource | | rpc <operation> | Invoke a RESTCONF RPC operation | | models | List YANG models available on the device | | operations | List available RESTCONF RPC operations | | describe <model> | Show the structure of a YANG model | | voice <shortcut> | Voice troubleshooting shortcuts | | doctor | Check RESTCONF connectivity and device health | | config | Manage device configurations |

Voice Shortcuts

Convenience commands for common voice troubleshooting queries:

cisco-yang voice dial-peers       # Dial-peer configuration
cisco-yang voice sip              # Voice service / SIP configuration
cisco-yang voice sip-ua           # SIP user-agent configuration
cisco-yang voice interfaces       # Interface configuration (check voice bindings)

Global Flags

| Flag | Description | | --------------------------------- | -------------------------------------- | | --format table\|json\|toon\|csv | Output format (default: table) | | --insecure | Skip TLS certificate verification | | --clean | Remove empty/null values from results | | --read-only | Restrict to read-only operations | | --no-audit | Disable audit logging for this command | | --debug | Enable debug logging |

Library API

const YangService = require("cisco-yang");
const service = new YangService("10.10.20.48", "admin", "password", {
  insecure: true,
});

// RESTCONF operations
await service.get("Cisco-IOS-XE-native:native/hostname");
await service.get("Cisco-IOS-XE-native:native/interface/GigabitEthernet");
await service.set(
  "Cisco-IOS-XE-native:native/interface/Loopback=99",
  data,
  "put",
);
await service.delete("Cisco-IOS-XE-native:native/interface/Loopback=99");

// Discovery
await service.getModels("voice");
await service.getOperations();
await service.describeModel("Cisco-IOS-XE-voice");

// RPC
await service.rpc("cisco-ia:sync-from");
await service.rpc("Cisco-IOS-XE-rpc:reload", { input: {} });

// Connection test
await service.testConnection();

Error Classes

const {
  YangError,
  YangAuthError,
  YangNotFoundError,
  YangConnectionError,
  YangRequestError,
} = require("cisco-yang");

try {
  await service.get("invalid/path");
} catch (err) {
  if (err instanceof YangNotFoundError) {
    console.log("Path not found on device");
  } else if (err instanceof YangAuthError) {
    console.log("Check credentials");
  }
}

Platform Compatibility

| Platform | Config (YANG) | Voice Config | Voice Oper (live calls) | | ------------------ | :-----------: | :-------------------------: | :---------------------: | | ISR4k (physical) | ✓ | partial | ✓ | | Cat8kv (virtual) | ✓ | ✓ (17.12+ with DNA license) | ✗ | | CSR1000v (virtual) | ✓ | partial | ✗ |

Note: The Cisco-IOS-XE-voice-oper YANG model (active call monitoring, call history, DSP stats, SCCP CCM groups, DSP farm profiles) is only available on physical ISR4k platforms. Virtual platforms expose the config models but not operational voice data.

Voice Config coverage: Controllers, voice-ports, and ccm-manager are available via YANG. Some voice features (voice-service voip, MGCP config) are not yet fully modeled in YANG even on IOS-XE 17.12. The uck9 license is required for voice YANG models on ISR platforms — on 17.x this requires Smart Licensing.

Giving Back

If you found this helpful, consider:

"Buy Me A Coffee"

License

MIT