lmgit
lmgit is a native lmcode host that exposes Git repositories, commits, branches, status entries, and audit reports to type-checked LMScript programs.
Quick reference
lmscript install github:lmctl-ai/lmgit@v0.2.14
lmgit --version
lmgit --lmcode-schema --json
lmgit --lmcode-signatures
lmscript examples/repo-status.lms .
| Item | Kind | Purpose |
|---|---|---|
| --lmcode FILE | CLI flag | Execute compiled lmcode bytecode (repeatable for builder invocations). |
| git.open(path) / git.clone(url, dest) | Host methods | Open a local Git working tree or clone a remote repository. |
| Repo.current_branch / is_clean / status | Host methods | Inspect active branch, clean state, and per-file index/worktree flags. |
| Repo.log / branches / tags / diff / show | Host methods | Inspect commit history, branches, tags, diffs, and revisions. |
| Repo.checkout / branch_create / commit / push / tag_create | Host methods | Mutate repository state (honoring git.dry_run(true)). |
| report.add / write_json / fail_if_any | Report context | Accumulate repository audit findings and fail with exit code 4. |
schema = load_schema(cli="lmgit" install="github:lmctl-ai/lmgit@v0.2.14");
program = _lmcode_ schema;
let repo = git.open(".");
$return.branch = repo.current_branch();
$return.clean = repo.is_clean();
end _lmcode_
result = run_lmcode(program);
require(result.ok, "git host failed");
print(json_stringify(result.result));