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 variableDescription
--versionPrint the exact lmgit build version.
--lmcode-schema [--json]Print the embedded schema/lmgit.dsl.json bytes.
--lmcode-signaturesPrint sorted SDK and domain registry signatures.
--lmcode FILEExecute a compiled DSLB v6 bytecode file (repeatable for builder invocations).
LMGIT_GITEnvironment variable selecting a specific git executable (requires Git >= 2.20).
LMCODE_INVOCATION_FILEOptional version-1 JSON invocation descriptor requiring boolean dry.

Git context and Repo methods (lmgit)

SignatureReturn typeDescription
Git.dry_run(enabled: bool) / Git.is_dry_run()Git / boolSet or query operation-level dry-run mode on the git context.
Git.version()stringReturn the version string reported by the underlying Git executable.
Git.open(path: string)RepoOpen an existing local Git repository at path.
Git.clone(url: string, dest: string)RepoClone a repository from url into dest and return its Repo handle.
Repo.path() / Repo.current_branch() / Repo.is_clean()string / string / boolRepository root path, active branch name, and clean working-tree/index status.
Repo.status()StatusListList modified, staged, or untracked working-tree and index entries.
Repo.branches()BranchListList local branches and identify the current checked-out branch.
Repo.log(limit: int)CommitListReturn up to limit commits from HEAD in reverse chronological order.
Repo.tags() / Repo.remote_names()StringsList repository tag names or configured remote names.
Repo.remote_url(name: string) / Repo.config(key: string)stringRead the URL of remote name or the value of a Git configuration key.
Repo.diff(staged: bool) / Repo.show(rev: string)stringReturn the unified diff (unstaged or staged) or inspect object rev.
Repo.checkout(ref: string) / Repo.branch_create(name: string)stringCheck 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)stringCreate a commit, push ref to remote, or create an annotated tag (honors git.dry_run).

Domain element types and Report context

TypeMethods
StatusEntry / StatusListStatusEntry: path() -> string, index_status() -> string, work_status() -> string; StatusList: len() -> int, at(int) -> StatusEntry.
Branch / BranchListBranch: name() -> string, is_current() -> bool; BranchList: len() -> int, at(int) -> Branch.
Commit / CommitListCommit: hash() -> string, subject() -> string, author() -> string, date() -> string; CommitList: len() -> int, at(int) -> Commit.
Stringslen() -> 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 functionSignatureRole
RestGet..RestOptions, RestHandler(exchange: RestExchange) -> voidInterfaces for @"/path" HTTP route handlers.
CliCommand, CliOption(exchange: RestExchange) -> voidInterfaces for @"cmd" subcommands and @"--opt" options via rest_cli.
rest_config, rest_route, rest_serve, rest_stop, rest_clirest_config(string, string) -> void; rest_route(string, string, string) -> void; rest_serve() -> void; rest_stop() -> void; rest_cli(StrList) -> stringConfigure and execute in-memory CLI commands or HTTP endpoints inside _lmcode_.

Exit codes

CodeMeaning
0Execution or introspection succeeded.
2CLI flag usage error or malformed LMCODE_INVOCATION_FILE metadata.
3Bytecode load failure, schema mismatch, or runtime Git subprocess error.
4Application failure, including report.fail_if_any() with non-empty findings or unreadable bytecode files.