redis-cli Quick Start
Verify a local PostRESP instance, run your first Redis commands, and peek at SQL storage.
Use redis-cli to verify a local PostRESP instance, exercise common commands, and
inspect the same keys in Postgres.
Prerequisites
redis-cli- A local PostRESP instance from the Docker Quick Start or Postgres extensions
- A local port for RESP (examples use
6379)
Start PostRESP first
For the fastest local setup, start with Docker:
docker run -d --name pg_resp \
-p 6379:6379 \
-p 5432:5432 \
-e POSTGRES_USER=redis \
-e POSTGRES_PASSWORD=redis \
-e POSTGRES_DB=pg_resp \
-e USERNAME=redis \
-e PASSWORD=redis \
asamsig/pg_resp:latest
If you already have an instance running, skip ahead.
Connect and verify
redis-cli -p 6379 -a redis --no-auth-warning PING
Expected reply:
PONG
If you published RESP on another host port (for example -p 5762:6379):
redis-cli -p 5762 -a redis --no-auth-warning PING
Client auth is on by default. Pass -a / run AUTH, or start with
REQUIRE_CLIENT_AUTH=false. See Authentication.
Your first commands
Strings, TTL, and a simple list:
redis-cli -p 6379 -a redis --no-auth-warning SET session:1 '{"user":"ada"}'
redis-cli -p 6379 -a redis --no-auth-warning GET session:1
# {"user":"ada"}
redis-cli -p 6379 -a redis --no-auth-warning EXPIRE session:1 60
redis-cli -p 6379 -a redis --no-auth-warning TTL session:1
# 60 (or slightly less)
redis-cli -p 6379 -a redis --no-auth-warning LPUSH jobs task-a
redis-cli -p 6379 -a redis --no-auth-warning LPUSH jobs task-b
redis-cli -p 6379 -a redis --no-auth-warning LRANGE jobs 0 -1
# 1) "task-b"
# 2) "task-a"
Interactive mode works the same way:
redis-cli -p 6379 -a redis --no-auth-warning
127.0.0.1:6379> SET foo bar
OK
127.0.0.1:6379> GET foo
"bar"
127.0.0.1:6379> DEL foo
(integer) 1
See Commands for the full support matrix.
Peek at SQL storage
The same keys live in schema pgresp.
Values are bytea (shown hex-encoded in psql):
# Docker install
docker exec -it pg_resp \
psql -U redis -d pg_resp -c "SELECT * FROM pgresp.strings;"
# Extension install (local psql)
psql -U redis -d pg_resp -c "SELECT * FROM pgresp.strings;"
You can also call SQL helpers directly — for example
SELECT pgresp.get('session:1'); — when debugging from the Postgres side.
Point your app at it
Same URL shape as Redis:
REDIS_URL=redis://127.0.0.1:6379
Continue with Connect from your app for language examples.
Troubleshooting
If redis-cli does not connect on the first try:
- Confirm the container or Postgres host is up (
docker ps, or check the postmaster). - Inspect Docker startup with
docker logs pg_resp. - Confirm you are using the published host port, not only the container port, when ports are remapped.
- For extension installs, ensure
pg_resp_gw_hostis inshared_preload_librariesand the extensions were created in the configured database — see Postgres extensions.