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
| Item | Kind | Purpose |
|---|---|---|
| --lmcode FILE [PATH ...] | CLI mode | Run compiled cleanup rules in dry-run mode by default. |
| --exec [--trash DIR] | CLI flags | Delete matched paths or move them into DIR with manifest.jsonl. |
| --trash DIR --restore | CLI flags | Restore trashed entries in reverse order from DIR/manifest.jsonl. |
| --serve [--allow-exec] | Server mode | Start the REST server for scan caching, view filtering, and guarded deletes. |
| Ignore, Filter, Report | SAM interfaces | @ignore pruning, @select deletion predicates, and @report audit callbacks over File. |
| File.rsize(), File.rmodified(), File.git_status() | Host methods | Deterministic 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));