lmauth reference

CLI subcommands, flags, lmcode host functions, and exit codes for lmauth.

CLI subcommands and flags

Command or flagDescription
lmauth --versionPrint the release version string (for example lmauth 0.1.15).
lmauth --lmcode-schema [--json]Print the embedded lmcode host schema JSON (with or without --json).
lmauth --lmcode-signaturesPrint canonical host function signatures.
lmauth --lmcode FILEExecute a compiled lmcode bytecode program (honors LMCODE_INVOCATION_FILE).
lmauth plan --owner OWNER --repos REPOSPrint the guided fine-grained GitHub token recipe for OWNER and comma-separated REPOS.
lmauth present --owner OWNER --repos REPOS ...Present the guided recipe, collect the token, verify identity, and store it in lmconn.
lmauth publish --package DIR|FILE.tgz --credential lmauth:NAME ...Pack and publish npm packages through the stored npm login; every npm approval link goes on a page you click. See the guide.
--login --expect-user NPMUSER(publish) Sign in through npm's web login when there is no working token; refuse any account other than NPMUSER.
--trust-repo OWNER/REPO --trust-file WORKFLOW.yml(publish) Also set the package's npm trusted publisher to that GitHub workflow.
--access public, --tag TAG(publish) npm access and dist-tag for the publish.
lmauth npm-release --repo OWNER/REPO --name NAME --target OS-CPU=ASSET ...Build npm packages from the binaries of a GitHub release (checked against SHA256SUMS), publish them and set their trusted publishers.
LMBRIDGE_APPKEYEnvironment variable for the approval page bridge: the appkey field of ~/.config/lmctl/appkey.json.
--lmconn-node ABSAbsolute path to the Node.js executable used to run the lmconn broker.
--lmconn-entry ABSAbsolute path to lmconn's bin/lmconn.js entry script.
--lmconn-db ABSAbsolute path to the private SQLite credentials database managed by lmconn.
--lmconn-key-file ABSOptional absolute path to lmconn's instance key file in a separate private directory.
--terminalCollect the token from a controlling terminal prompt instead of a local browser page.
--mock-api URLPoint identity and repository verification at a loopback lmmock server for offline testing.

Domain host functions

SignatureReturn typeDescription
fn auth_plan(owner: string, repos: string)stringGenerate an authorization recipe for the specified GitHub owner and repository list.
fn auth_recipe(string)JsonRecipe function declared in the released host schema; takes a string and returns Json.
fn auth_present(recipe: string)stringPresent the authorization recipe to the human operator and return a session handle.
fn auth_collect(session: string)stringCollect the entered token from the session as an opaque credential reference.
fn auth_verify(credential: string)JsonVerify the credential's identity and public repository metadata without exposing the secret.
fn auth_store(credential: string)JsonWrite the credential into the encrypted lmconn store and return a nonsecret handle receipt.
fn lmcode_return_set(value: Json)voidStandard catalog function (one of several overloads) that sets the result payload in the terminal return frame.

Exit codes

CodeMeaning
0Recipe planning, dry execution, or credential verification and storage succeeded.
2Invalid CLI arguments, retired --first/--last flags, or malformed LMCODE_INVOCATION_FILE manifest.
3Bytecode load failure, schema mismatch, or runtime execution error.
4Application or security policy failure (for example missing TTY under --terminal or Windows private_store_acl_not_implemented).