This document summarizes the command framework and the currently implemented Redis-compatible commands.
Command implementation lives in nimbis/src/cmd/.
Core types in nimbis/src/cmd/mod.rs:
CmdMeta { name, arity }CmdContext { client_id }Cmdtrait (meta,do_cmd,execute)ParsedCmdCmdTable
Cmd::execute performs arity validation first, then calls do_cmd.
Nimbis follows Redis-style arity conventions:
arity > 0: exact number of tokens required (including command name)arity < 0: minimum number of tokens required (including command name)- validation uses
args.len() + 1
Examples:
GET key=> arity2PING [message]=> arity-1EXISTS key [key ...]=> arity-2
Source of truth: nimbis/src/cmd/table.rs.
PING(-1)HELLO(-1) — supports protocol2and3DEL(-2)EXISTS(-2)EXPIRE(3)TTL(2)INCR(2)DECR(2)FLUSHDB(1)
SET(3)GET(2)APPEND(3)
HSET(-4)HDEL(-3)HGET(3)HLEN(2)HMGET(-3)HGETALL(2)
LPUSH(-3)RPUSH(-3)LPOP(-2)RPOP(-2)LLEN(2)LRANGE(4)
SADD(-3)SMEMBERS(2)SISMEMBER(3)SREM(-3)SCARD(2)
ZADD(-4)ZRANGE(-4) — by rank range (start stop [WITHSCORES])ZSCORE(3)ZREM(-3)ZCARD(2)
CONFIG(-3)CONFIG GET <pattern>CONFIG SET <field> <value>
CLIENT(-2)CLIENT IDCLIENT SETNAME <name>CLIENT GETNAMECLIENT LIST
The full redis-benchmark profile in xtask/src/redis_benchmark.rs should
cover this implemented command table. FLUSHDB is the exception: it is used for
benchmark setup and cleanup, not throughput comparison.
The comparison redis-benchmark profile is intentionally smaller so CI can
compare PR and main branch performance across a stable command subset. It must
still contain only commands listed in this document.
- Add
cmd_xxx.rsundernimbis/src/cmd/. - Implement
Cmdfor the command struct. - Export the module in
nimbis/src/cmd/mod.rs. - Register it in
nimbis/src/cmd/table.rs. - Update this document,
docs/redis-benchmark.md, and the benchmark profiles inxtask/src/redis_benchmark.rstogether.
Nimbis is Redis-compatible for the implemented subset, but does not yet implement full Redis semantics.
SETcurrently documents/implements the basicSET key valueform only (noNX|XX|EX|PX|KEEPTTL|GEToptions).ZRANGEsupportsstart stop [WITHSCORES]rank mode only; flags such asBYSCORE,BYLEX,REV, andLIMITare not part of this interface.CONFIGis limited toGETandSETsubcommands.CLIENTis limited toID,SETNAME,GETNAME, andLIST.- Multi-key string helpers like
MGET/MSET, transactions (MULTI/EXEC), pub/sub, scripting, streams, cluster commands, and ACL are not documented as implemented in this command table.
When adding new commands or options, update nimbis/src/cmd/table.rs, this
document, and the benchmark documentation/profile lists together.