lmgit reference
CLI flags, Git and Repo methods, domain types, standard REST and CLI interfaces, and exit codes for lmgit.
CLI flags and environment
| Flag or variable | Description |
|---|---|
| --version | Print the exact lmgit build version. |
| --lmcode-schema [--json] | Print the embedded schema/lmgit.dsl.json bytes. |
| --lmcode-signatures | Print sorted SDK and domain registry signatures. |
| --lmcode FILE | Execute a compiled DSLB v6 bytecode file (repeatable for builder invocations). |
| LMGIT_GIT | Environment variable selecting a specific git executable (requires Git >= 2.20). |
| LMCODE_INVOCATION_FILE | Optional version-1 JSON invocation descriptor requiring boolean dry. |
Git context and Repo methods (lmgit)
| Signature | Return type | Description |
|---|---|---|
| Git.dry_run(enabled: bool) / Git.is_dry_run() | Git / bool | Set or query operation-level dry-run mode on the git context. |
| Git.version() | string | Return the version string reported by the underlying Git executable. |
| Git.open(path: string) | Repo | Open an existing local Git repository at path. |
| Git.clone(url: string, dest: string) | Repo | Clone a repository from url into dest and return its Repo handle. |
| Repo.path() / Repo.current_branch() / Repo.is_clean() | string / string / bool | Repository root path, active branch name, and clean working-tree/index status. |
| Repo.status() | StatusList | List modified, staged, or untracked working-tree and index entries. |
| Repo.branches() | BranchList | List local branches and identify the current checked-out branch. |
| Repo.log(limit: int) | CommitList | Return up to limit commits from HEAD in reverse chronological order. |
| Repo.tags() / Repo.remote_names() | Strings | List repository tag names or configured remote names. |
| Repo.remote_url(name: string) / Repo.config(key: string) | string | Read the URL of remote name or the value of a Git configuration key. |
| Repo.diff(staged: bool) / Repo.show(rev: string) | string | Return the unified diff (unstaged or staged) or inspect object rev. |
| Repo.checkout(ref: string) / Repo.branch_create(name: string) | string | Check out ref or create a new branch (honors git.dry_run). |
| Repo.commit(message: string) / Repo.push(remote: string, ref: string) / Repo.tag_create(name: string, message: string) | string | Create a commit, push ref to remote, or create an annotated tag (honors git.dry_run). |
Domain element types and Report context
| Type | Methods |
|---|---|
| StatusEntry / StatusList | StatusEntry: path() -> string, index_status() -> string, work_status() -> string; StatusList: len() -> int, at(int) -> StatusEntry. |
| Branch / BranchList | Branch: name() -> string, is_current() -> bool; BranchList: len() -> int, at(int) -> Branch. |
| Commit / CommitList | Commit: hash() -> string, subject() -> string, author() -> string, date() -> string; CommitList: len() -> int, at(int) -> Commit. |
| Strings | len() -> int, at(int) -> string. |
| Report (context report) | add(code: string, target: string, message: string) -> void, len() -> int, write_text(path: string) -> void, write_json(path: string) -> void, fail_if_any() -> void. |
Standard REST and CLI interfaces (lmcode_std_v3)
| Interface or function | Signature | Role |
|---|---|---|
| RestGet..RestOptions, RestHandler | (exchange: RestExchange) -> void | Interfaces for @"/path" HTTP route handlers. |
| CliCommand, CliOption | (exchange: RestExchange) -> void | Interfaces for @"cmd" subcommands and @"--opt" options via rest_cli. |
| rest_config, rest_route, rest_serve, rest_stop, rest_cli | rest_config(string, string) -> void; rest_route(string, string, string) -> void; rest_serve() -> void; rest_stop() -> void; rest_cli(StrList) -> string | Configure and execute in-memory CLI commands or HTTP endpoints inside _lmcode_. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Execution or introspection succeeded. |
| 2 | CLI flag usage error or malformed LMCODE_INVOCATION_FILE metadata. |
| 3 | Bytecode load failure, schema mismatch, or runtime Git subprocess error. |
| 4 | Application failure, including report.fail_if_any() with non-empty findings or unreadable bytecode files. |