lmldap
lmldap is a single-executable OpenLDAP (slapd + LMDB) server with zero-config startup, an integrated HTTP/JSON REST server, and an embedded LMScript host. It serves native RFC 4511 LDAPv3 and HTTP REST against a unified directory while exposing context ldap: Ldap and standard REST and CLI interfaces.
Quick reference
npm install -g @lmctl-ai/lmctl@latest
lmldap --version
lmldap --lmcode-schema
lmldap --lmcode-signatures
| Interface or flag | Signature or syntax | Purpose |
|---|---|---|
| CLI zero-config server | lmldap --port 3389 --rest-port 8080 --base-dn dc=example,dc=com --admin-pw secret | Auto-provision embedded schemas, LMDB storage, base DN entry, native LDAPv3 listener, and HTTP REST bridge. |
| CLI host bytecode | lmldap --lmcode prog.dslb | Execute compiled LMScript bytecode against a live LDAP server or the built-in in-memory directory store. |
| CLI schema and signatures | lmldap --lmcode-schema [--json] | --lmcode-signatures | Print the embedded schema JSON or all 244 canonical host and lmcode_std_v3 signatures. |
| REST HTTP bridge | GET /health | /ping | /search | GET/PUT/POST/DELETE /entry/<dn> | POST /bind | Read, write, search, delete, and authenticate directory entries over HTTP JSON synchronized with native LDAPv3. |
| context ldap: Ldap | ldap.add(dn, json) | ldap.get(dn) | ldap.search(base, filter) | ldap.modify(dn, json) | ldap.del(dn) | Create, fetch, query, update, and delete LDAP entries as JSON strings inside _lmcode_ programs. |
| Ldap existence and auth | ldap.exists(dn) -> bool | ldap.bind(dn, pw) -> bool | Check whether a Distinguished Name exists or verify simple bind credentials. |
| Batch pipeline | ldap.batch().add(dn, json).get(dn).search(base, filter).exec() -> string | Queue multiple directory operations and execute them sequentially into a single JSON array response. |
| Standard REST and CLI | RestGet..RestOptions, RestHandler, CliCommand, CliOption | Expose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli. |
p = _lmcode_ cli="lmldap" install="github:lmctl-ai/lmldap@latest";
let ok = ldap.add("cn=Alice,dc=example,dc=com", "{\"objectClass\":[\"top\",\"person\",\"inetOrgPerson\"],\"cn\":\"Alice\",\"sn\":\"Smith\",\"mail\":\"alice@example.com\"}");
assert_eq(ok, true);
assert_eq(ldap.exists("cn=Alice,dc=example,dc=com"), true);
@"/directory/:cn"
fn get_user(x: RestExchange) -> void implements RestGet {
x.json(ldap.get("cn=" + x.param("cn") + ",dc=example,dc=com"));
}
rest_config("session", "global");
let out = rest_cli(str_split("/directory/Alice", " "));
assert_eq(str_contains(out, "alice@example.com"), true);
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));
Documentation pages
- Skill — agent authoring rules, zero-config server and _lmcode_ commands, safety rules, exit codes, and verification steps.
- Guide — dual-protocol OpenLDAP + LMDB architecture, REST-to-BER translation, live vs fallback _lmcode_ execution, and standard REST and CLI interfaces.
- Reference — complete server flags, REST API endpoints, Ldap and Batch methods, standard lmcode_std_v3 interfaces, and exit codes.