Skip to content

witherford/Network_KB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

188 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Knowledge Base

A self-hosted, single-repo network reference for CLI command lookups, cheat sheets, and a toolkit of network utilities.

Everything is static HTML + ES modules. Edits you make in the admin UI commit back to the hosting repo via the GitHub Contents API, so the next page load in any browser sees them.

Features

  • Commands — 6,600+ CLI commands across 19 platforms: Linux, Cisco IOS, Cisco IOS-XE Switch, NetScaler, NetScaler SDX, Cisco Catalyst 9800 WLC, Cisco IOS-XE Router, Wireshark, Palo Alto PAN-OS, OpenSSL, Cisco Nexus, Proxmox VE, Aruba AOS-CX, Cisco ASA, Aruba Mobility Controller, Windows, VMware ESXi, AWS CLI, and Aruba AP / Instant. Search, filter by platform or command type, favourites, recents, copy, and bulk CSV import/export.
  • Toolkit — Subnet calculator (IPv4 + IPv6, supernet split), ping script builder (PowerShell / cmd / bash), DNS resolve script builder, AI-powered regex builder, scientific calculator, cheat sheets (TCP/UDP ports, IP protocols, multicast, IPv4/IPv6 specials, public allocations, admin distances, acronyms), world clock.
  • Settings — Password-encrypted admin settings holding the GitHub PAT and a rotating ring of AI API keys (used by the regex builder).

Repo layout

index.html              app shell
css/                    main / components / themes
js/
  app.js                bootstrap + router
  state.js              central store + event bus
  prefs.js              per-viewer prefs (localStorage)
  utils.js              helpers (esc, hlText, copy, toast, debounce)
  dataloader.js         manifest + JSON fetchers
  crypto.js             PBKDF2 + AES-GCM (planned)
  api/                  github, ai, keyring (planned)
  auth/                 edit-mode + bootstrap wizard (planned)
  pages/                commands, toolkit, settings
  toolkit/              subnet, ping, dns, regex, calculator, cheatsheets, worldclock
  components/           modal, command-list, bulk-toolbar, csv
data/
  manifest.json         cache-bust timestamps
  commands.json         command database
  cheatsheets/*.json    static cheat sheets
  settings.enc.json     encrypted admin settings
scripts/
  migrate-v12.mjs       one-shot v12 → commands.json migration

Running locally

Module scripts require HTTP, not file://. Any static server works:

npx http-server . -p 5500 -c-1 --silent
# or
python -m http.server 5500

Open http://localhost:5500. The command database loads from data/commands.json; per-viewer prefs (theme, font size, favourites, recent, collapsed sections, clock zones) live in localStorage under nkb.prefs.v1.

Deploying

  1. Push the repo to GitHub.
  2. In Settings → Pages, set source to main / root.
  3. Wait for the first Pages build; the site is live at https://<owner>.github.io/<repo>/.
  4. On first load the bootstrap wizard walks you through setting the admin password, the GitHub PAT, and the first AI key. It commits data/settings.enc.json and empty data stubs to the repo.

Admin edit flow

  1. Click Edit in the header → enter admin password.
  2. The app decrypts data/settings.enc.json and activates edit UI across pages.
  3. Make changes; each page shows a pending-changes banner.
  4. Click Save. The app uses the decrypted PAT to commit the updated JSON via the GitHub Contents API with one descriptive commit per save (for multi-file changes, via the Git Data API for atomicity).
  5. Click Lock (or wait for the 30-minute session timeout) to clear the key from memory.

The PAT needs contents:write on this repo only — a fine-grained token scoped to the repo is ideal.

CSV import / export (commands)

Format

Header row (exact):

platform_key,platform_label,section,command,description,type

Example valid rows:

platform_key,platform_label,section,command,description,type
netscaler,NetScaler,System & Status,show ns info,Display system info,show
netscaler,NetScaler,System & Status,show ns runningconfig,Print running config,show
cisco_ios,Cisco IOS,Routing,show ip route,Print IPv4 routing table,show
cisco_ios,Cisco IOS,Interfaces,interface GigabitEthernet0/1,Enter interface config,config

Field rules

Field Required Notes
platform_key yes Stable key (netscaler, cisco_ios, asa, ...)
platform_label yes Display name. New if platform key doesn't exist
section yes Created if it doesn't exist
command yes CLI command text
description no Free text; embed commas by quoting the field
type yes One of show / config / troubleshooting

Common mistakes

# MISSING HEADER ROW — first row interpreted as data
netscaler,NetScaler,System & Status,show ns info,Display system info,show

# WRONG COLUMN ORDER — "show" and "System & Status" swapped
netscaler,NetScaler,show,show ns info,Display system info,System & Status

# UNQUOTED COMMA IN DESCRIPTION — splits into 7 fields
netscaler,NetScaler,System & Status,show ns info,Display system info, CPU and memory,show

# INVALID TYPE — must be show / config / troubleshooting
netscaler,NetScaler,System & Status,show ns info,Display system info,display

The import preview modal shows:

  • To add: new rows the importer will insert
  • Duplicates: exact matches on platform_key + section + command (skipped)
  • Errors: rows failing validation, with line numbers

Round-trip is safe — exported CSV re-imports cleanly with 100% duplicate skip.

Migration from v12

node scripts/migrate-v12.mjs ../network_kb_v12.html data/commands.json

The script sandboxes an eval of the RAW literal, converts the legacy 3-tuple command arrays to {cmd, desc, type, flagged} objects, and writes a v2 shape.

Keyboard shortcuts

  • / — focus the command search box
  • Esc — close modal / clear search
  • Ctrl/Cmd + K — open quick nav (planned)

Privacy

  • No analytics, no third-party scripts, no cookies.
  • AI API keys live in data/settings.enc.json encrypted with PBKDF2-SHA256 (600k iter) + AES-GCM. Plaintext is only ever in memory during an edit session. Keys never appear in the DOM or network traffic for unauthenticated viewers.
  • Personal prefs (theme, favourites, clock zones) are in localStorage; they never commit to the repo.

License

MIT.

About

Network knowledge base app that is designed to update it's database using AI tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors