lmgh reference

CLI flags, Gh and Report context methods, domain object methods, and exit codes for lmgh.

CLI flags and environment

Flag or variableDescription
--versionPrint the lmgh build version and exit 0.
--lmcode-schema [--json]Print the embedded schema/lmgh.dsl.json bytes.
--lmcode-signaturesPrint sorted canonical host and standard library signatures.
--lmcode FILEExecute a compiled DSLB v6 bytecode file (repeatable for builder parts).
LMGH_GHEnvironment variable selecting a specific gh executable (requires gh >= 2.45.0, < 3.0.0).
LMCODE_INVOCATION_FILEOptional absolute path to a v1 JSON invocation manifest with boolean dry.

Gh context methods and top-level functions

SignatureReturn typeDescription
Gh.dry_run(enabled: bool) / Gh.is_dry_run()self / boolEnable or inspect operation-level dry-run mode for write methods.
Gh.repo_view(owner: string, repo: string)RepoFetch repository metadata, counts, flags, and topics.
Gh.file_text(owner: string, repo: string, path: string)stringFetch UTF-8 text of a file from the repository.
Gh.issue_list(owner: string, repo: string, state: string, limit: int) / Gh.issue_view(owner: string, repo: string, num: int)IssueList / IssueList or view issues in a repository.
Gh.pr_list(owner: string, repo: string, state: string, limit: int) / Gh.pr_view(owner: string, repo: string, num: int)PrList / PrList or view pull requests in a repository.
Gh.pr_triage(owner: string, repo: string, num: int)TriageAggregate CI check counts, review counts, mergeability, and readiness for a PR.
Gh.release_list(owner: string, repo: string, limit: int)ReleaseListList recent releases for a repository.
Gh.run_list(owner: string, repo: string, limit: int) / Gh.run_failed_log(owner: string, repo: string, id: int)RunList / stringList workflow runs or fetch the failed-job log text for a run ID.
Gh.search_repos(q: string, limit: int) / search_issues(q: string, limit: int) / search_prs(q: string, limit: int)RepoList / IssueList / PrListSearch repositories, issues, or pull requests across GitHub.
Gh.issue_create(owner: string, repo: string, title: string, body: string) / issue_close(owner: string, repo: string, num: int, reason: string)Issue / stringCreate or close an issue (honors dry_run).
Gh.pr_comment(owner: string, repo: string, num: int, body: string) / label_add(owner: string, repo: string, num: int, label: string) / pr_merge(owner: string, repo: string, num: int, method: string)stringComment on, label, or merge an issue or pull request (honors dry_run).
Gh.release_create(owner: string, repo: string, tag: string, title: string, notes: string, draft: bool, prerelease: bool)stringCreate a GitHub release (honors dry_run).
Gh.pr_prepare(owner: string, repo: string, title: string, body: string, base: string, head: string, draft: bool) / Gh.pr_submit(owner: string, repo: string, path: string)string / PrWrite a reviewable PR TOML file and submit it after human verification.
Gh.pr_review_prepare(owner: string, repo: string, num: int, event: string, body: string) / Gh.pr_review_submit(owner: string, repo: string, num: int, path: string)string / ReviewWrite a PR review verdict TOML file and submit it after human verification.
fn pr_create_toml(toml: string)JsonValidate and create a pull request from an inline [pr] TOML table.

Domain types and Report context

TypeMethods
Repo / RepoListname(), full_name(), description(), url(), default_branch(), license(), homepage(), pushed_at(), stars(), forks(), open_issues(), is_archived(), is_private(), topics(); RepoList: len(), at(int).
Issue / IssueListnumber(), title(), state(), author(), url(), repo(), created_at(), body(), comments(), labels(); IssueList: len(), at(int).
Pr / PrListnumber(), title(), state(), author(), url(), base(), head(), created_at(), updated_at(), mergeable(), is_draft(), labels(); PrList: len(), at(int).
Triagenumber(), title(), state(), author(), url(), mergeable(), summary(), checks_total(), checks_passed(), checks_failing(), approved(), changes_requested(), review_decision(), ok().
Release / ReleaseListtag(), name(), url(), published_at(), is_draft(), is_prerelease(); ReleaseList: len(), at(int).
Run / RunListid(), name(), display_title(), status(), conclusion(), url(), branch(), event(), created_at(), updated_at(); RunList: len(), at(int), failing().
Review / StringsReview: id(), url(), state(), summary(), confirmed(); Strings: len(), at(int).
Report (context report)add(code: string, target: string, message: string), len(), write_text(path: string), write_json(path: string), fail_if_any().

Exit codes

CodeMeaning
0Execution or introspection succeeded.
2CLI usage error, retired --first/--last flag, or malformed LMCODE_INVOCATION_FILE metadata.
3Bytecode load failure, schema mismatch, or gh/API runtime failure.
4Application failure (APP_FAIL), including report.fail_if_any() on non-empty findings or unreadable inputs.