Update cli to match exactly what redis returns#3468
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
|
This pr makes it so the cli replies match exactly what redis returns. For instance @andy-stark-redis @dwdougherty you can test the changes on https://staging.learn.redis.com/docs/latest/develop/ , I sent you creds in a dm |
|
I tested PING, ARGET/ARGETRANGE, HSET/HGETALL, and INFO. The PING, array, and hash commands look good, but INFO isn't quite right. INFO returns a large bulk string and correctly ends each line with a line feed, but in the CLI, the output is one long line. Output from redis-cli: Output from the CLI widget is one long line: redis> INFO |
dwdougherty
left a comment
There was a problem hiding this comment.
LGTM. Thank you, @paoloredis!
Note
Low Risk
Display-only changes in static/js/cli.js with no auth or server logic touched.
Overview
Aligns the embedded redis.io web CLI output with native redis-cli formatting.
Reply rendering now threads a per-reply
statusflag from the API: simple strings / status replies (e.g.PONG,OK) print unquoted; bulk strings use a newreprString()that escapes UTF-8 bytes like redis-cli’ssdscatrepr(\xHHfor non-printable bytes, named escapes for\n, quotes, etc.). Backend-wrapped large integers ({$int: "..."}) render as(integer) …instead of being mishandled as objects.Minor: restores the trailing newline at end of
cli.js.Reviewed by Cursor Bugbot for commit ecc12f8. Bugbot is set up for automated code reviews on this repo. Configure here.