بنقرة واحدة
extract-redis-cli-examples
// Extract Redis CLI examples from documentation pages, identify which commands are demonstrated, and determine what multi-language code examples need to be created or updated.
// Extract Redis CLI examples from documentation pages, identify which commands are demonstrated, and determine what multi-language code examples need to be created or updated.
Port a Redis use-case example (cache-aside, session store, rate limiter, leaderboard, etc.) to all 9 supported client libraries in parallel, with cross-client synthesis and audit
Generate tabbed code examples (TCEs) for Redis commands across all supported client languages
| name | extract-redis-cli-examples |
| description | Extract Redis CLI examples from documentation pages, identify which commands are demonstrated, and determine what multi-language code examples need to be created or updated. |
This skill helps you extract Redis CLI examples from Redis documentation pages and prepare them for multi-language tabbed code example (TCE) implementation.
Use this skill when you need to:
Redis CLI examples appear in documentation in four formats:
{{% redis-cli %}}
SET mykey "Hello"
GET mykey
{{% /redis-cli %}}
This creates an interactive redis-cli experience. The text between shortcodes contains executable commands.
{{< highlight bash >}}
127.0.0.1:6379> SET mykey "Hello"
OK
127.0.0.1:6379> GET mykey
"Hello"
{{< / highlight >}}
Used for syntax-highlighted code blocks. The [lang] parameter (e.g., bash) specifies highlighting.
{{< clients-example set="set_and_get" step="basic" >}}
> SET mykey "Hello"
OK
> GET mykey
"Hello"
{{< /clients-example >}}
Important: This format indicates multi-language examples MAY already exist. Check data/examples.json for the example ID to see which languages are implemented.
````bash
> SET mykey "Hello"
OK
> GET mykey
"Hello"
````
Standard markdown code blocks, often with bash, plaintext, or no language specified.
Command lines are identified by prompt prefixes:
> - Standard promptredis> - Redis prompt127.0.0.1:6379> - Full Redis promptLines WITHOUT these prefixes are typically output and should be ignored. However, it may be the case that lines without prefixes are actual Redis commands, and represent code examples.
| Pattern | Example | Extracted Command |
|---|---|---|
| Single-word | > SET key value | SET |
| Multi-word | > ACL CAT | ACL CAT |
| Dot notation | > JSON.SET doc $ '{}' | JSON.SET |
| With arguments | > HSET key field value | HSET |
Input:
> HSET bike:1 model Deimos brand Ergonom
(integer) 2
> HGET bike:1 model
"Deimos"
> HGETALL bike:1
1) "model"
2) "Deimos"
Extracted commands: ["HSET", "HGET", "HGETALL"]
Look for all four source formats in the markdown file. For each occurrence, extract:
clients-example: the set and step parameter valuesFor each CLI block:
>, redis>, 127.0.0.1:6379>)For clients-example blocks, check if implementations exist:
# Check data/examples.json for the example ID
cat data/examples.json | jq '.["<example-id>"]'
This shows which client languages already have implementations.
Output a structured report with:
## Extraction Report: [filename]
### Examples Found
| # | Format | Commands | Example ID | Status |
|---|--------|----------|------------|--------|
| 1 | redis-cli | SET, GET | N/A | Needs TCE |
| 2 | clients-example | HSET, HGET | hash_tutorial | Partial (missing: Go, Rust) |
| 3 | highlight | ZADD, ZRANGE | N/A | Needs TCE |
### Action Items
1. **Create new TCE**: Examples 1, 3 need full multi-language implementation
2. **Add languages**: Example 2 needs Go, Rust implementations added
The following languages are configured in config.toml (in display order):
for-ais-only/tcedocs/README.md - How to add multi-language examplesfor-ais-only/tcedocs/SPECIFICATION.md - Complete TCE specificationfor-ais-only/tcedocs/CLI_COMMAND_EXTRACTION_QUICK_REFERENCE.md - Quick referenceconfig.toml - Client configuration and display orderdata/examples.json - Existing example implementationsdata/commands_core.json - Command metadata (summaries, groups, complexity)When asked to extract examples from a command page like content/commands/hset.md:
data/examples.json for existing implementationsAnalyzing: content/commands/hset.md
Found 3 CLI example blocks:
1. Lines 45-52: redis-cli shortcode
Commands: HSET, HGET
Status: No TCE exists
Action: Create new example set "cmds_hash" with step "hset_basic"
2. Lines 78-95: clients-example (set="hash_tutorial", step="hset_hget")
Commands: HSET, HGET, HGETALL
Status: TCE exists with Python, Node.js, Java-Sync
Action: Add missing languages (Go, C#, Rust, PHP)
3. Lines 120-125: fenced code block
Commands: HSET
Status: No TCE exists
Action: Can merge with example #1 or create separate step
redis-cli shortcodes - These are interactive and high-value for conversion