lmdebug

lmdebug is a Linux network, system, process, packet-capture, and detection introspection CLI and LMScript host in one self-contained executable. It emits structured JSON on the command line, exposes typed domain contexts (lmdebug, net, sys, proc, detect, shark), and enforces an audited dry-run-by-default mutation framework.

Quick reference

npm install -g @lmctl-ai/lmctl@latest
lmdebug --version
lmdebug caps
lmdebug --lmcode-schema
lmdebug --lmcode-signatures
lmdebug pcap --lmcode-signatures
Interface or flagSignature or syntaxPurpose
CLI capabilities and metadatalmdebug caps | --lmcode-schema [--json] | --lmcode-signaturesInspect platform capabilities, effective privileges, supported commands, embedded schema JSON, and canonical signatures.
CLI host bytecode and dry-runlmdebug [--dry-run] [--plan-format json|text] --lmcode prog.dslbExecute compiled LMScript bytecode or emit an lmscript.host_plan.v1 effect plan without mutating host state.
CLI network diagnosticslmdebug dns|dig|ifaddrs|link|ethtool|route|rule|neigh|counters|sockets|trace|mtr|arping|scan|pipe|ping|iperf3Query rtnetlink interfaces, routes, rules, neighbors, /proc socket tables, DNS records, TCP scans, and active probes as JSON.
CLI system, process, detectionlmdebug sys cpu|mem|disk|top|set | proc [list]|show|kill | detect scan|autoruns|hashes|quarantine|restoreSample CPU, memory, disk, and process tables, scan files with static libyara or hash databases, and plan audited mutations.
context lmdebug: Metalmdebug.caps_json() | lmdebug.apply_enabled() | lmdebug.force_enabled() | lmdebug.changes_remaining()Query host capability JSON, mutation apply/force state, and remaining change budget inside _lmcode_ scripts.
context net: Netnet.dns_lookup(host) | net.interfaces() | net.links() | net.routes() | net.sockets(proto, listen) | net.scan(host, ports)Perform DNS resolution, rtnetlink device and routing queries, socket ownership attribution, TCP port scans, and active probes.
context sys: Sys / proc: Procsys.cpu() | sys.mem() | sys.disk() | sys.top() | sys.set(k, v) | proc.list() | proc.show(pid) | proc.kill(pid, sig)Inspect kernel performance counters and /proc process descriptors, or generate dry-run sysctl and pidfd signal plans.
context detect: Detectdetect.scan(path) | detect.autoruns() | detect.hash_import(path) | detect.hashes_scan(path) | detect.quarantine(path)Run embedded YARA scans, enumerate Linux persistence locations, query LMHASH01 stores, and plan file quarantine or restore actions.
context shark: Sharklmdebug pcap --lmcode prog.dslb (shark.interfaces(), packet builders, dissectors, flows, display/cBPF filters)Synthesize, read, filter, dissect, and export pcap/pcapng traces or enumerate libpcap capture interfaces.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ cli="lmdebug" install="github:lmctl-ai/lmdebug@latest";
let ifs = net.interfaces();
assert(ifs.len() > 0);
let s = net.socket_summary("tcp");

@"/sockets/listening"
fn get_listening(x: RestExchange) -> void implements RestGet {
  let sum = net.socket_summary("tcp");
  x.json("{\"listening\":" + str(sum.listening()) + "}");
}

rest_config("session", "global");
let out = rest_cli(str_split("/sockets/listening", " "));
lmcode_return_put("listening_tcp", s.listening());
lmcode_return_put("rest_out", out);
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));

Documentation pages

Source repository and releases