lmclean

lmclean is a native lmcode host for scriptable file search and cleanup with dry-run defaults, reversible trash manifests, Git status checks, and a REST server.

Quick reference

lmscript install github:lmctl-ai/lmclean@v0.1.20
lmclean --version
lmclean --lmcode-schema --json
lmclean --lmcode-signatures
lmscript examples/clean-regen-dirs.lms /path/to/projects
ItemKindPurpose
--lmcode FILE [PATH ...]CLI modeRun compiled cleanup rules in dry-run mode by default.
--exec [--trash DIR]CLI flagsDelete matched paths or move them into DIR with manifest.jsonl.
--trash DIR --restoreCLI flagsRestore trashed entries in reverse order from DIR/manifest.jsonl.
--serve [--allow-exec]Server modeStart the REST server for scan caching, view filtering, and guarded deletes.
Ignore, Filter, ReportSAM interfaces@ignore pruning, @select deletion predicates, and @report audit callbacks over File.
File.rsize(), File.rmodified(), File.git_status()Host methodsDeterministic recursive byte size, subtree mtime, and Git clean/pushed status.
program = _lmcode_ cli="lmclean" install="github:lmctl-ai/lmclean@latest";
@ignore
fn skip_git(f: File) -> bool implements Ignore {
  return f.is_dir() && f.name() == ".git";
}
@select
fn stale_tmp(f: File) -> bool implements Filter {
  return f.is_file() && f.extension() == "tmp" && (now() - f.modified() > 7 * 86400);
}
end _lmcode_
r = run_lmcode(program);
print(json_stringify(r));

Documentation pages

Source repository and releases