redis

redis connects to Redis, inspects keys and values, performs focused key changes, exports data, runs native Redis commands and creates binary-safe backups.

DatabaseVersion 1.1.3Stable
lil-terminal

Overview

Use redis to inspect keyspaces, preview and search values, make focused edits, run native Redis commands and create binary-safe logical backups from PHP.

Keys instead of tables

Redis is not a relational table store. It is a server-side keyspace whose keys can hold strings, hashes, lists, sets, sorted sets, streams and other structures, often with expiration. That is why the same compact verbs map to keys and values rather than rows and columns; inspect the key type before changing data and use native Redis commands after : for specialized operations.

Syntax

lil-terminal
redis [options] · redis : <command>

Reference

redis

show the current Redis connection

redis -c <host> [user] [database] [-p <port>] [-n] [-m [name]]

connect; password is requested separately unless -n is used

-use <database>

select another numeric database

-l

show databases reported by Redis INFO keyspace

-t [mask]

list keys; * and ? are Redis glob wildcards

-s <key>

show key type, TTL and memory information

-n <key> [items]

preview a key value

-f <mask> [text] [keys]

find matching keys, or search text across their names and values

-o <key> [file] [-f]

export one key as JSON

-w <key> : <value>

set one string value

-d <key>

delete one key

-m [name]

save the current connection in .lil.key; default name is the Redis database number

-M <name>

remove a saved connection

-k [name]

list saved connections or inspect one without showing its password

-K <name>

connect using a saved connection

-e

disconnect and clear connection data

redis : <command>

execute a native Redis command

redis dump [file.json] [-f]

create a binary-safe logical dump

redis load <file.json>

restore a lil Redis dump

Inspection

-t lists keys by Redis glob mask. -f <mask> [text] [keys] uses the same mask and, when text is supplied, searches both key names and compact value previews; the optional final number limits candidate keys scanned.

Editing

-w stores one string value and -d removes one key. Use native commands after : for hashes, lists, sets, streams, transactions and other Redis-specific structures.

Dump and restore

dump stores Redis DUMP payloads as base64 with TTL metadata in a JSON container, so binary values remain safe. load restores that lil dump with RESTORE.

Connection

-c accepts host, optional ACL user and database number. The password is requested separately unless -n explicitly selects a passwordless server.

Safety

Key scans are capped to keep the browser terminal responsive. Native Redis commands keep their normal server-side semantics.

Previews are bounded for responsiveness. Single-key export refuses values above 100000 items and dump refuses databases above 100000 keys instead of silently truncating them.

Saved connections

Without -m, connection data remains scoped to the current PHP session. -m [name] explicitly stores the current profile in the protected .lil.key file (0600), -K <name> reconnects from it, -k lists or inspects profiles without exposing a stored password, and -M <name> removes one. kill removes .lil.key together with the other core state. Treat the file as sensitive because an opted-in profile can contain database credentials.

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Inspect keys and a value

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install redis
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install redis -m
Exact public version

Install exactly this published version.

install redis -v 1.1.3
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade redis
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install redis -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Inspect keys and a value
redis -use 0 | redis -t "product:*" | redis -n product:1001
Database  0

product:1001
product:1002
product:1003

Key    product:1001
Type   string
TTL    -1
Value  City shoe
Redis · localhost
redis -c localhost
Status    connected
Server    Redis 8
Host      localhost:6379
Database  0
Redis · -l
redis -l
0  4 keys
1  0 keys
Redis · -s
redis -s product:1001
Key   product:1001
Type  string
TTL   -1
Redis · -f
redis -f "product:*" "shoe"
product:1001  string  City shoe
product:1002  string  Trail shoe
Redis · json
redis -o product:1001 product-1001.json
Saved  product-1001.json
Redis · -w
redis -w product:1004 : "Travel bag"
+
Redis · -d
redis -d product:1004
Deleted  1
Redis · dbsize
redis : DBSIZE
4
Redis · dump
redis dump redis.dump.json
Saved  redis.dump.json
Redis · load
redis load redis.dump.json
Restored  4
Redis · -e
redis -e
+
Handle a missing key
redis -n missing:key
Key not found: missing:key

File used in this example: sandbox/db/redis.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

SET product:1001 "City shoe"
SET product:1002 "Trail shoe"
SET product:1003 "Canvas bag"
HSET inventory SHOE-1 18 SHOE-2 7 BAG-1 24

Related documentation

Current public release

v1.1.32026-08-11

Saved connections

Adds explicit -m/-M/-k/-K profiles in .lil.key; listings never reveal a stored password.