lmcurl
lmcurl is an HTTP, LDAPv3, and LLM contract testing CLI and LMScript host built on libcurl and a pure C++17 BER/ASN.1 LDAPv3 wire engine. It runs direct CLI requests, test suites, JSONPath and XPath queries, load checks, and standard REST and CLI interfaces.
Quick reference
npm install -g @lmctl-ai/lmctl@latest
lmcurl --version
lmcurl --lmcode-schema
lmcurl --lmcode-signatures
| Interface or flag | Signature or syntax | Purpose |
|---|---|---|
| CLI host bytecode | lmcurl --lmcode prog.dslb | Execute compiled LMScript bytecode against the embedded lmcurl schema. |
| CLI schema and signatures | lmcurl --lmcode-schema [--json] | --lmcode-signatures | Print human-readable schema summary, raw schema JSON, or canonical signatures. |
| CLI LDAPv3 URL mode | lmcurl [-u dn:pw] [-X METHOD] [-d JSON] ldap://host:port/... | Run RFC 4516 search URLs or REST-mapped /ping, /bind, /whoami, /compare, /search, and /entry endpoints. |
| CLI LDAPv3 subcommands | lmcurl ldap ping|bind|whoami|search|get|add|modify|compare|del | Execute structured LDAPv3 directory operations from the command line and emit JSON. |
| context curl: Curl | curl.session(base_url) -> Session | Create an HTTP, HTTPS, or LDAPv3 session with shared headers, cookies, variables, and secrets. |
| Session / Request / Response | s.get(path).basic(user, pw).send() -> Response | Build and send requests, inspect status and headers, and evaluate JSONPath, XPath, or schema assertions. |
| Suite / Test / Report | curl.suite(name).test_request(label, req) -> Test | Define data-driven or parallel contract test suites and export console, TAP, JUnit, JSON, CSV, or HTML reports. |
| context llm: Llm | llm.openrouter(url) | llm.deepseek(url) | llm.ollama(url) | llm.mock(file) | Run cost-bounded LLM chat, streaming, sampling, model matrices, and deterministic cassette replay. |
| 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="lmcurl" install="github:lmctl-ai/lmcurl@latest";
let mock = curl.mock();
let s = curl.session(mock.url());
let r = s.get("/api/products").send();
assert_eq(r.status(), 200);
assert_eq(r.json("$.items[0].sku").exists(), true);
@"/health"
fn get_health(x: RestExchange) -> void implements RestGet {
x.json("{\"ok\":true}");
}
assert_eq(rest_cli(str_split("/health", " ")), "{\"ok\":true}");
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));
Documentation pages
- Skill — agent authoring rules, commands, safety limits, exit codes, and verification steps.
- Guide — architecture, HTTP and LDAPv3 protocol modes, LLM cost and redaction boundaries, and standard REST and CLI interfaces.
- Reference — complete CLI flags, host contexts, types and methods, standard lmcode_std_v3 interfaces, and exit codes.