lmok

lmok embeds tree-sitter 0.27.1 (12 languages), SQLite FTS5 code indexing, JSON and lmcode lint packs, SARIF output, and a REST server in one static CLI.

Quick reference

lmscript install github:lmctl-ai/lmok@latest
lmok --version
lmok --lmcode-schema --json
lmok --lmcode-signatures
lmok parse examples/data/sample.json
lmok lint rules/c-tier1.json examples/data/sample.c
ItemKindPurpose
parse / query [--pattern]CLI verbsPrint concrete syntax trees or match S-expression and code-shaped patterns.
lint / check / ciCLI verbsRun 18 JSON rule packs, compiled @NODE_KIND lmcode rules, or project CI gates.
facts / index / symbols / refs / findCLI verbsExtract definitions/references and query the SQLite + FTS5 trigram code database.
metrics / dup / outlineCLI verbsMeasure function counts and nesting, find duplicate tokens, or rank symbol outlines.
serve / remoteCLI verbsServe all analysis commands over a caching local REST API and remote client.
ts.parse* / query* / reparse* / report* and RuleHost APIIncremental tree-sitter parsing, querying, findings sink, and @NODE_KIND SAM rules.
p = _lmcode_ cli="lmok" install="github:lmctl-ai/lmok@latest";
let tree = ts.parse("{\"name\": \"lmok\", \"tags\": [\"tree-sitter\", \"json\"]}");
println(tree.sexp());
println("has_error -> " + str(tree.has_error()));
println("nodes -> " + str(tree.node_count()));
end _lmcode_
r = run_lmcode(p);
assert(r.ok);

Documentation pages

Source repository and releases