CLI Reference
Last updated
This page summarizes every command accepted by Exec and the bundled REPL, with the shared parsing rules and REPL controls.
Parsing Rules
- Input is split on whitespace; command names are case-insensitive.
- Multi-token values are joined back with single spaces, so repeated spaces collapse.
- A wrong argument count returns
usage: ...; an unknown command returnsunknown: <CMD>. - List results print as numbered lines (
1) item), or(empty list).
Command Summary
| Command | Syntax | Success response |
|---|---|---|
GET |
GET <key> |
raw value, or (nil) |
SET |
SET <key> <value> [NX|XX] [seconds] [VECTOR] |
OK |
EXIST |
EXIST <key> |
(integer) 1 or (integer) 0 |
TYPE |
TYPE <key> |
json string int float bool date, or (nil) |
DEL |
DEL <key> [key2] ... |
(integer) n, or OK for a field |
INCR |
INCR <key> [delta] |
new number |
TTL |
TTL <key> |
(integer) n, or (nil) |
EXPIRE |
EXPIRE <key> <seconds> |
OK |
EXPIREAT |
EXPIREAT <key> <timestamp> |
OK |
PERSIST |
PERSIST <key> |
OK |
KEYS |
KEYS <pattern> |
key list |
FIND |
FIND <op> <value> [LIMIT <n>] |
key list |
QUERY |
QUERY <expression> [LIMIT <n>] |
key: value list |
VSEARCH |
VSEARCH <text> [MATCH <pattern>] [LIMIT <n>] |
key list |
VSIM |
VSIM <key1> <key2> |
(float) score |
VGET |
VGET <key> |
JSON array |
SELECT |
SELECT <db> |
OK |
Keys with . on GET, EXIST, TYPE, SET, INCR, and single-argument DEL address JSON fields; see JSON Documents and Writing JSON Fields.
REPL Control
cmd/test/main.go opens ./temp. quit and exit are handled by the REPL, not Exec. Empty lines are ignored. EOF, SIGINT, and SIGTERM close the store before exit.