lmauth authoring skill

lmauth is a guided, LLM-drivable authorization helper that collects operator tokens through a local browser page or hidden terminal prompt and stores them write-only in the lmconn credential broker without exposing secrets to the caller.

Purpose

Use lmauth to guide an operator through fine-grained token creation, verify the authenticated GitHub identity and public repository metadata, and persist the token into an encrypted lmconn database while returning only a random handle and nonsecret receipt to the agent.

When to use it

Use lmauth when an automated workflow or LLM agent needs a human operator to provision a scoped credential without the raw secret ever entering stdout, stderr, logs, or agent context. Use lmconn directly when invoking downstream HTTP APIs with an already stored credential handle.

Install

Install the pinned release binary with lmscript install and verify the executable version and embedded schema.

lmscript install github:lmctl-ai/lmauth@v0.1.15
lmauth --version
lmauth --lmcode-schema --json
lmauth --lmcode-signatures

Releases are published for Linux x64 and arm64, macOS x64 and arm64, and Windows x64 through a sealed qualification pipeline.

Commands

Run plan to print the guided fine-grained GitHub token recipe, or run present to collect the token from the operator and store it in lmconn.

lmauth plan --owner lmctl-ai --repos lmoffice
lmauth present --owner lmctl-ai --repos lmoffice \
  --lmconn-node /usr/bin/node \
  --lmconn-entry /opt/lmconn/bin/lmconn.js \
  --lmconn-db /var/lib/private-store/credentials.db

You can also drive the flow from an LMScript _lmcode_ program compiled against the host schema:

program = _lmcode_ cli="lmauth" install="github:lmctl-ai/lmauth@v0.1.15";
let recipe = auth_plan("lmctl-ai", "lmpdf");
let session = auth_present(recipe);
let credential = auth_collect(session);
let verification = auth_verify(credential);
$return = auth_store(credential);
end _lmcode_
r = run_lmcode(program);
print(json_stringify(r));

Inputs and outputs

The plan and present commands accept --owner and --repos flags naming the target GitHub organization or user and comma-separated repository names. The present command additionally requires absolute paths for --lmconn-node, --lmconn-entry, and --lmconn-db, plus optional --lmconn-key-file and --terminal flags.

Stdout emits a nonsecret recipe summary or a JSON receipt containing a random handle, verified identity login, and human-attested grant summary. Bytecode invocations conclude with an LMCODE_RETURN_BEGIN and LMCODE_RETURN_END frame.

Safety rules

The secret token is entered only into the local operator browser page or hidden TTY prompt and piped directly to the lmconn broker over stdin. Calling lmconn cred get with --reveal on a stored lmauth handle is refused by credential policy.

Repository scope and permission grants are human-attested: lmauth verifies the GitHub account identity and public repository existence, but a read probe does not prove effective write permissions. Keep the operator browser outside agent screenshot or CDP debugging access. On Windows, credential storage deliberately fails closed with private_store_acl_not_implemented.

Worked examples

Preview a token plan for a repository release workflow and then run a dry bytecode check using an invocation manifest:

lmauth plan --owner lmctl-ai --repos lmoffice
lmauth --lmcode tests/flow.lmcodeb

When LMCODE_INVOCATION_FILE specifies dry: true, lmauth validates the bytecode and returns a dry-no-auth terminal envelope without opening a local operator page or prompting on the terminal.

Errors and exit codes

lmauth exits with code 0 when planning, dry verification, or credential storage succeeds. Code 2 indicates CLI usage errors, retired builder flags (--first or --last), or a malformed LMCODE_INVOCATION_FILE manifest. Code 3 indicates bytecode load or runtime execution failure. Code 4 indicates an application or policy failure such as non-TTY terminal denial or Windows fail-closed storage.

How to verify

Verify the binary version, embedded lmcode schema, canonical signatures, and dry plan output without making live identity-provider writes.

lmauth --version
lmauth --lmcode-schema --json
lmauth --lmcode-signatures
lmauth plan --owner lmctl-ai --repos lmoffice