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.4Stable
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

Start with a safe inspection

Connect with redis -c localhost (password is requested separately) or add -n only for a server that does not require authentication. -t "product:*" lists matching keys, -s product:1001 shows type and TTL, -n product:1001 previews its value, and -f "product:*" shoe 10 searches within a bounded set. Use redis : DBSIZE or another native command for features outside the compact interface.

Before changing data

-w only sets a **string** value; to modify a hash, list or sorted set, use the appropriate native Redis command after :. -d removes a key. dump saves a lil JSON container of binary-safe Redis DUMP payloads and TTLs, not an RDB/AOF server backup. load uses RESTORE and can replace existing keys. Verify the selected numeric database before deletion or restoration. Real use requires PHP Redis and access to Redis; demo outputs use a fixed teaching snapshot.

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.4
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
Illustrative sandbox preview — no live connection
A connection is required; the status view names the server and selected database.
Redis · localhost
redis -c localhost -n
Illustrative sandbox preview — no live connection
Connection example: server and database will be shown after a successful connection.
Redis · localhost
redis -c localhost demo 0
Illustrative sandbox preview — no live connection
Password is requested separately; connection details depend on the server.
Redis · localhost
redis -c localhost -p 6380 -n
Illustrative sandbox preview — no live connection
Connection example: server and database will be shown after a successful connection.
Select another numeric database
redis -use 0
Illustrative sandbox preview — no live connection
Selected database: 0 (requires an active connection)
Show databases reported by Redis INFO keyspace
redis -l
Illustrative sandbox preview — no live connection
db0: keys=4
List keys; * and ? are Redis glob wildcards
redis -t
Illustrative sandbox preview — no live connection
inventory  hash
product:1001  string
product:1002  string
product:1003  string
List keys; * and ? are Redis glob wildcards
redis -t "product:*"
Illustrative sandbox preview — no live connection
product:1001  string
product:1002  string
product:1003  string
Show key type, TTL and memory information
redis -s product:1001
Illustrative sandbox preview — no live connection
Key  product:1001
Type  string
TTL  -1 (in this teaching snapshot)
Bytes  depends on Redis version
Preview a key value
redis -n product:1001
Illustrative sandbox preview — no live connection
City shoe
Preview a key value
redis -n inventory 2
Illustrative sandbox preview — no live connection
{"SHOE-1": 18, "SHOE-2": 7}
Find matching keys, or search text across their names and values
redis -f "product:*"
Illustrative sandbox preview — no live connection
product:1001  string
product:1002  string
product:1003  string
Handle a missing key
redis -f "product:*" shoe 10
Illustrative sandbox preview — no live connection
product:1001  string  City shoe
product:1002  string  Trail shoe
Export one key as JSON
redis -o product:1001
Illustrative sandbox preview — no live connection
{
  "key": "product:1001",
  "type": "string",
  "value": "City shoe"
}
Export one key as JSON
redis -o product:1001 tmp/product.json
Illustrative sandbox preview — no live connection
Saved  sandbox/tmp/product.json (if the destination does not exist)
Redis · json
redis -o product:1001 tmp/product.json -f
Illustrative sandbox preview — no live connection
Saved  sandbox/tmp/product.json (replace existing file only with -f)
Set one string value
redis -w product:1004 : Travel bag
Illustrative sandbox preview — no live connection
+ (sets one string key)
Delete one key
redis -d product:1004
Illustrative sandbox preview — no live connection
Deleted  0 (the independent snapshot has no product:1004)
Execute a native Redis command
redis : GET product:1001
Illustrative sandbox preview — no live connection
City shoe
Execute a native Redis command
redis : DBSIZE
Illustrative sandbox preview — no live connection
4
Create a binary-safe logical dump
redis dump tmp/redis-backup.json
Illustrative sandbox preview — no live connection
Saved  sandbox/tmp/redis-backup.json
Format  lil-redis-dump (logical data export, not server backup)
Redis · dump
redis dump tmp/redis-backup.json -f
Illustrative sandbox preview — no live connection
Saved  sandbox/tmp/redis-backup.json
Format  lil-redis-dump (logical data export, not server backup)
Restore a lil Redis dump
redis load tmp/redis-backup.json
Illustrative sandbox preview — no live connection
Redis RESTORE reads a lil dump file; this file must exist and existing keys may be replaced.
Save the current connection in .lil.key; default name is the Redis database number
redis -m cache-demo
Illustrative sandbox preview — no live connection
Saved  cache-demo (stores a sensitive profile in .lil.key)
List saved connections or inspect one without showing its password
redis -k
Illustrative sandbox preview — no live connection
No saved connections (unless a profile has already been saved)
List saved connections or inspect one without showing its password
redis -k cache-demo
Illustrative sandbox preview — no live connection
Saved connection not found: cache-demo (unless saved earlier)
Connect using a saved connection
redis -K unknown
Illustrative sandbox preview — no live connection
Saved connection not found: unknown
Remove a saved connection
redis -M unknown
Illustrative sandbox preview — no live connection
Saved connection not found: unknown
Disconnect and clear connection data
redis -e
Illustrative sandbox preview — no live connection
+
Preview a key value
redis -n missing:key
Illustrative sandbox preview — no live connection
Key not found
Select another numeric database
redis -use wrong
Illustrative sandbox preview — no live connection
Numeric Redis database required
Set one string value
redis -w product:1004
Illustrative sandbox preview — no live connection
Value required after :

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.42026-11-01

Production refinement

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