Update commands to use redis-cli shortcode for interactive examples#3608
Update commands to use redis-cli shortcode for interactive examples#3608paoloredis wants to merge 9 commits into
Conversation
|
|
…d ignore try_it=false snippets
|
I updated a bunch of commands so that they use the redis-cli shortcode for interactivity, and updated the tooling to support it. You can test it against the staging environment |
andy-stark-redis
left a comment
There was a problem hiding this comment.
Bugbot has already noted the only problem I could spot (the random set of examples I tested worked fine interactively after the bit at the start), so LGTM.
|
Actually looks like I'm going to have to change the redis-cli shortcode because right now it's usage does not want an explicit |
{{% redis-cli %}} dumped its whole inner transcript — the "redis> " prompts and
the printed output — into the interactive terminal, so cli.js executed the
prompt and output lines as commands (double "redis> ", "unknown command
'redis>'"). Parse the transcript instead: keep only the "> "/"redis> " command
lines, strip the prompt, and feed just those bare commands to the form and the
"Try it" button (matching tabbed-clients-example). Blocks with no command lines
render as a static block.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… transcripts
Rewrite the bare-command {{% redis-cli %}} examples across content/commands as
"redis> " + expected-output transcripts (generated against redis.io/cli) so they
render as interactive terminals and can be verified. Random (SPOP, SRANDMEMBER,
...) and volatile (TIME, PTTL, CLIENT, ...) commands keep a representative sample
but omit the output that can't reproduce.
Also update the verifier (build/check_tryit_output.py) to parse {{% redis-cli %}}
blocks, honour try_it="false", render $bin binary replies, treat COMMAND /
FT.SEARCH / FT.AGGREGATE / VSIM as unordered and TIME/PTTL/CLIENT/... as volatile
(auto-skip), harden unclosed-block parsing, and guard on reply count.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a16bdf. Configure here.
COMMAND INFO/DOCS lists a command's subcommands in registration/hash order, which isn't guaranteed, so the `config` subcommands reshuffle between backends (staging vs redis.io/cli) and tripped an exact-match MISMATCH on command-info.md. Add COMMAND to UNORDERED_CMDS so it's compared as an unordered multiset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I ended up having to update the redis-cli shortcode to support the new |
Looks good now :-) |

Note
Low Risk
Documentation and CI verification tooling only; no application or auth changes. CI may surface new mismatches against live redis.io/cli until examples stabilize.
Overview
Extends CI verification so
check_tryit_output.pyvalidates bothclients-exampleand{{% redis-cli %}}blocks, with safer parsing for unclosed shortcodes, base64$binrendering for binary replies (e.g. Bloom/Cuckoo SCANDUMP), and auto-skip for volatile commands (TIME,PTTL,CLIENT, …),try_it="false", and non-deterministic output.COMMANDis treated as order-insensitive for comparison.Refreshes command documentation across a large set of pages: examples move to the interactive
{{% redis-cli %}}shortcode with fullredis>/ expected-output transcripts (replacing command-only lines orhighlight bashfences). Bloom/Cuckoo filter pages get the same treatment;cf.infoexample output and labels are corrected.Reviewed by Cursor Bugbot for commit 3f9674d. Bugbot is set up for automated code reviews on this repo. Configure here.