lmvalkey reference

Complete command-line flag reference, integrated HTTP REST endpoints, host schema types and methods, standard lmcode_std_v3 REST and CLI interfaces, and exit codes for lmvalkey v0.1.0.

Server and host CLI flags

Flag or environment variableArguments / defaultDescription
--version / -vnonePrint the lmvalkey server version string (lmvalkey v=0.1.0) and exit 0.
--port<port> (default 6379)TCP port for native Valkey/Redis RESP connections (also auto-detects incoming HTTP REST requests).
--rest-port<port>Dedicated TCP port for the integrated zero-auth HTTP JSON REST server (for example, 8080).
--bind<addr> (default 127.0.0.1)Bind RESP and REST listeners to the specified network interface addresses.
--daemonizeyes | no (default no)Run the lmvalkey server as a background daemon process.
--requirepass<password>Require AUTH password on native RESP connections (HTTP REST endpoints remain unauthenticated).
--lmcode<file.dslb>Load and execute a compiled LMScript bytecode file against the embedded lmvalkey schema.
--lmcode-schema[--json]Print the exact embedded lmvalkey schema JSON bytes to stdout and exit 0.
--lmcode-signaturesnonePrint all 245 canonical context, function, and method signatures (19 host + 226 standard library).
VALKEY_HOST / REDIS_HOST127.0.0.1Target host IPv4 address used by _lmcode_ ValkeyClient connections before falling back to in-memory mode.
VALKEY_PORT / REDIS_PORT6379Target TCP port used by _lmcode_ ValkeyClient connections.

Integrated HTTP REST endpoints

HTTP methodPath patternRequest bodyResponse envelope
GET/none{"ok":true,"result":...} server health and status summary.
GET/pingnone{"ok":true,"result":"PONG"}.
GET/get/<key>none{"ok":true,"result":"<value>"} (or null if key does not exist).
POST/set/<key>raw value bytes{"ok":true,"result":"OK"} after storing the request body under <key>.
POST/set/<key>/<val>none{"ok":true,"result":"OK"} after storing <val> under <key>.
GET/keysnone{"ok":true,"result":["k1","k2",...]} listing all keys (KEYS *).
GET/keys/<pattern>none{"ok":true,"result":[...]} listing keys matching the glob pattern (such as user:*).
PUT/keys/<key>raw value bytes{"ok":true,"result":"OK"} RESTful key upsert from request body.
DELETE/keys/<key>none{"ok":true,"result":1} (number of deleted keys).
POST/cmd["CMD","arg1",...] or {"command":"CMD","args":[...]}{"ok":true,"result":...} executing any Valkey command against the unified datastore.

Host schema types, methods, and functions

Type / contextMethod signatureDescription
context valkey: Valkeyvalkey.set(string, string) -> boolExecute SET key value and return true when the server replies OK.
Valkeyvalkey.get(string) -> stringExecute GET key and return the stored string value (or "" when absent).
Valkeyvalkey.del(string) -> intExecute DEL key and return the integer count of removed keys.
Valkeyvalkey.exists(string) -> boolExecute EXISTS key and return true when the key is present.
Valkeyvalkey.cmd(string) -> string | valkey.cmd(string, string) -> string | valkey.cmd(string, string, string) -> stringExecute an arbitrary 1-, 2-, or 3-token Valkey command and return the reply string (or JSON array string for multi-bulk replies).
Valkeyvalkey.batch() -> BatchCreate a new pipelined command batch associated with the current ValkeyClient.
Batchb.set(string, string) -> Batch | b.get(string) -> Batch | b.del(string) -> BatchAppend a SET, GET, or DEL command to the batch pipeline and return the Batch receiver.
Batchb.cmd(string) -> Batch | b.cmd(string, string) -> Batch | b.cmd(string, string, string) -> BatchAppend an arbitrary 1-, 2-, or 3-token command to the batch pipeline and return the Batch receiver.
Batchb.len() -> int | b.clear() -> voidReturn the number of queued commands in the batch or clear all queued commands.
Batchb.exec() -> stringSend all queued commands in a single pipelined round-trip and return a JSON array string of reply strings.
function printprint(string) -> voidWrite a string followed by a newline to stdout.

Standard lmcode_std_v3 REST and CLI interfaces

Interface or functionSignature / annotationDescription
RestGet .. RestOptions@"/path/:param" fn h(x: RestExchange) -> void implements RestGetBind an HTTP GET, POST, PUT, DELETE, PATCH, HEAD, or OPTIONS route handler.
RestHandler@"/path" fn h(x: RestExchange) -> void implements RestHandlerBind a method-agnostic HTTP route handler.
CliCommand@"cmd" fn h(x: RestExchange) -> void implements CliCommandBind a named CLI subcommand dispatched by rest_cli.
CliOption@"--flag" fn h(x: RestExchange) -> void implements CliOptionBind a CLI option flag (--flag=val or --flag val) evaluated before the command handler.
rest_configrest_config(key: string, value: string) -> voidConfigure server or CLI settings such as host, port, and session (ephemeral or global).
rest_routerest_route(method: string, path: string, handler: string) -> voidDynamically register an HTTP method and route pattern to a handler function name.
rest_serve / rest_stoprest_serve() -> void | rest_stop() -> voidStart or stop the embedded standard HTTP server loop.
rest_clirest_cli(args: StrList) -> stringDispatch CLI options, commands, or path requests in-process without opening a socket.
RestExchangex.method() | x.path() | x.body() | x.param(string) | x.query(string) | x.header(string) -> stringRead request method, path, body, :param segment, query parameter, or header.
RestExchangex.has_query(string) | x.has_header(string) -> boolCheck whether a query parameter or request header is present.
RestExchangex.status(int) | x.set_header(string, string) | x.send(string) | x.json(string) -> voidSet response status code and headers, and emit plain text or application/json bodies.
RestExchangex.get(string) -> string | x.set(string, string) -> void | x.increment(string) -> intRead, write, or atomically increment session state keys across global or ephemeral exchanges.

Exit codes

Exit codePhase / modeMeaning
0SuccessServer exited cleanly, or _lmcode_ bytecode / schema / signature command completed and all assertions passed.
2CLI usage (phase "cli")Missing --lmcode <file> argument or invalid host CLI invocation (code CLI_USAGE).
3Load / run error (phase "load" or "run")Bytecode file missing or corrupt, schema hash mismatch, RESP command error reply, or failed runtime assertion.