donny

TypeScript ⭐ 2 · Updated May 19, 2026

Experimental: TypeScript library and CLI for MikroTik The Dude network monitoring database (dude.db)

donny

TypeScript library and CLI for reading and writing MikroTik The Dude network monitoring databases (dude.db).

Install

bun add @tikoci/donny

Or use the CLI directly:

bunx @tikoci/donny --help

CLI

donny                                     interactive wizard
donny <db>                                interactive wizard for an existing DB
donny setup                               interactive wizard (explicit)
donny info <db>                           show database statistics
donny list devices <db>                   list all devices
donny list probes <db>                    list probe templates
donny export <db> [options]               export devices
  --format csv|json                       output format (default: json)
  --include-credentials                   include username/password in output
donny add device <db> [options]           add a device with ping probe
  --name <name>                           device name (required)
  --address <ip|hostname>                 IP address or FQDN (required)
  --username <user>                       RouterOS username
  --password <pass>                       RouterOS password
  --routeros                              flag device as RouterOS
  --snmp                                  enable SNMP monitoring
donny normalize <input> <output.db>       export to relational SQLite
  --overwrite                             replace existing destination
  --skip-timeseries                       skip chart_* / outages copy
donny denormalize <input.db> <output.db>  rebuild dude.db from normalized
  --overwrite                             replace existing destination
  --skip-timeseries                       skip chart_* / outages copy

See docs/normalized-schema.md for the normalized schema reference, sample SQL queries, and round-trip fidelity guarantees.

Library

import { DudeDB } from "@tikoci/donny";

// Read devices
const db = DudeDB.open("dude.db", { readonly: true });
const devices = db.devices();
console.log(devices);
db.close();

// Add a device
const db2 = DudeDB.open("dude.db");
const ids = db2.addDevice({
  name: "core-router",
  address: "192.168.88.1",
  username: "admin",
  routerOS: true,
});
console.log(`Added device id=${ids.deviceId}`);
db2.close();
Low-level Nova codec
import { decodeBlob, encodeDevice, ipv4FromU32, TAG } from "@tikoci/donny";

// Decode a raw blob from the objects table
const msg = decodeBlob(rawBytes);
if (msg) {
  const ipArr = getU32Array(msg, TAG.DEVICE_IP);
  console.log(ipArr ? ipv4FromU32(ipArr[0]) : "DNS mode");
}

// Encode a device blob
const blob = encodeDevice({ id: 99, name: "edge-01", address: "10.0.0.1" });

Requirements

Validation

bun run check
bun test test/unit/
DONNY_QUICKCHR=1 bun run test:integration:quickchr

The quickchr integration test boots a disposable x86 RouterOS CHR with the Dude package and validates selected Nova mappings against RouterOS itself. It is opt-in because it requires QEMU/quickchr and is slower than the unit suite.

Contributing

See CONTRIBUTING.md for Windows-first setup instructions covering PowerShell 7, Bun, VS Code, GitHub Copilot, GitHub Copilot CLI, and the repo's TypeScript and RouterOS LSP setup.

For Windows contributors, the repo also includes:

  • scripts\setup-windows.cmd — bootstrap the local toolchain
  • scripts\doctor-windows.cmd — verify the current shell environment
  • scripts\routeroslsp-launcher.cjs — bridge the installed RouterOS VS Code extension into Copilot CLI LSP
  • .vscode\tasks.json — VS Code tasks for check/test/bootstrap workflows

License

MIT