lmvalkey
lmvalkey is a single-executable Valkey key-value server combining the native RESP protocol engine, an integrated HTTP REST API, and an embedded LMScript bytecode host. It serves unified in-memory data over RESP and JSON REST endpoints while running pipelined _lmcode_ batches and standard lmcode_std_v3 routes.
Quick reference
npm install -g @lmctl-ai/lmctl@latest
lmvalkey --version
lmvalkey --lmcode-schema --json
lmvalkey --lmcode-signatures
| Interface or flag | Signature or syntax | Purpose |
|---|---|---|
| Server RESP + REST | lmvalkey --port 6379 --rest-port 8080 [--daemonize yes] | Start the unified Valkey RESP server and zero-auth HTTP JSON REST listener. |
| CLI host bytecode | lmvalkey --lmcode prog.dslb | Execute compiled LMScript bytecode against a live Valkey server or the built-in in-memory store. |
| CLI schema and signatures | lmvalkey --lmcode-schema [--json] | --lmcode-signatures | Print embedded schema JSON bytes or all 245 canonical signatures (19 host + 226 standard library). |
| HTTP REST endpoints | GET /ping | GET /get/<k> | POST /set/<k> | GET /keys[/<pat>] | POST /cmd | Read, write, query, or run arbitrary Valkey commands over HTTP returning {"ok":true,"result":...}. |
| context valkey: Valkey | valkey.set(k, v) -> bool | valkey.get(k) -> string | valkey.del(k) -> int | valkey.exists(k) -> bool | Execute typed key-value operations from _lmcode_ blocks against VALKEY_HOST:VALKEY_PORT or fallback memory. |
| Valkey.cmd | valkey.cmd(c) | valkey.cmd(c, a1) | valkey.cmd(c, a1, a2) -> string | Run arbitrary Valkey commands (such as PING, INCR, HGETALL, INFO) with up to two arguments. |
| Batch pipeline | let b = valkey.batch(); b.set(k, v).get(k).exec() -> string | Queue multiple commands and execute them in a single pipelined RESP round-trip returning a JSON array string. |
| 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="lmvalkey" install="github:lmctl-ai/lmvalkey@latest";
assert_eq(valkey.set("user:100", "Alice"), true);
assert_eq(valkey.get("user:100"), "Alice");
let b = valkey.batch();
b.set("item:1", "Apples").set("item:2", "Oranges").get("item:1").get("item:2");
assert_eq(b.exec(), "[\"OK\",\"OK\",\"Apples\",\"Oranges\"]");
@"/kv/:key"
fn get_kv(x: RestExchange) -> void implements RestGet {
x.json("{\"key\":\"" + x.param("key") + "\",\"val\":\"" + valkey.get(x.param("key")) + "\"}");
}
assert_eq(rest_cli(str_split("/kv/user:100", " ")), "{\"key\":\"user:100\",\"val\":\"Alice\"}");
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));
Documentation pages
- Skill — agent authoring rules, server and host commands, REST/RESP security rules, exit codes, and verification steps.
- Guide — dual-protocol RESP and REST architecture, pipelined Batch execution, in-memory fallback, and standard REST and CLI interfaces.
- Reference — complete CLI flags, HTTP REST endpoints, Valkey and Batch host methods, standard lmcode_std_v3 interfaces, and exit codes.