You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cli): Clean up CLI command structure and improve documentation (#594)
## Motivation
This PR improves the discoverability of the existing `rvl` CLI surface
without changing the public command model. Before this change, the
top-level help was sparse, `rvl index` did not present its operations as
proper documented subcommands, and the docs did not clearly mirror the
current command tree. That made it harder to understand the intended
workflows directly from the terminal, especially for maintainers and
support engineers who need to inspect the available commands quickly.
## Changes
This change keeps the top-level surface unchanged at `index`, `stats`,
`version`, and `mcp`, but refines the `argparse` wiring so the help
output reads like a deliberate interface. `rvl --help` now lists the
command groups with short purpose text and representative examples, `rvl
index --help` exposes `create`, `info`, `listall`, `delete`, and
`destroy` as proper documented subcommands, and `rvl stats --help` now
explains the expected inputs and shows both index-name and schema-path
examples along with a Redis connection example. The MCP help text was
also aligned to use direct `rvl mcp ...` examples where the CLI is
already assumed to be installed.
The documentation changes keep the written guidance in sync with the
runtime help. The README now reflects the revised top-level help and
points readers to the richer `index` and `stats` help entrypoints, while
the CLI notebook now documents the full current command tree rather than
only the top-level groups.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Primarily refactors `argparse` wiring for `rvl`, `rvl index`, and `rvl
stats`; while intended to be behavior-preserving, changes to command
parsing/help text could impact existing scripts relying on previous
usage/error behavior.
>
> **Overview**
> Improves `rvl` CLI discoverability by expanding top-level `--help`
output with command-group descriptions and examples, and by documenting
`rvl index` operations as proper `argparse` subcommands (`create`,
`info`, `listall`, `delete`, `destroy`) with per-command help/epilog
text.
>
> Enhances `rvl stats` help text similarly, reorganizes shared CLI flags
in `cli/utils.py` into clearer argument groups (index selection vs Redis
connection), and aligns `rvl mcp` help examples to assume an installed
`rvl` binary.
>
> Updates README and the CLI user-guide notebook to match the revised
help/command tree, and adjusts unit tests to reflect the new help text
and parsing structure.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
71a6711. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: limjoobin <joobin.lim@redis.com>
Co-authored-by: limjoobin <38883279+limjoobin@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -527,17 +527,27 @@ router("Hi, good morning")
527
527
Create, destroy, and manage Redis index configurations from a purpose-built CLI interface: `rvl`.
528
528
529
529
```bash
530
-
$ rvl -h
530
+
$ rvl --help
531
531
532
532
usage: rvl <command> [<args>]
533
533
534
-
Commands:
535
-
index Index manipulation (create, delete, etc.)
536
-
mcp Run the RedisVL MCP server
537
-
version Obtain the version of RedisVL
538
-
stats Obtain statistics about an index
534
+
Redis Vector Library CLI.
535
+
536
+
Command groups:
537
+
index Create, inspect, list, and delete Redis search indexes
538
+
stats Show statistics for an existing Redis search index
539
+
version Show the installed RedisVL version
540
+
mcp Run the RedisVL MCP server
541
+
542
+
Examples:
543
+
rvl index --help
544
+
rvl index create -s schema.yaml
545
+
rvl stats -i user_index
546
+
rvl mcp --config /path/to/mcp.yaml
539
547
```
540
548
549
+
Use `rvl index --help` to see documented subcommands such as `create`, `info`, `listall`, `delete`, and `destroy`. Use `rvl stats --help` to see both index-name and schema-path examples plus the shared Redis connection options for data-plane commands.
Copy file name to clipboardExpand all lines: docs/user_guide/cli.ipynb
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
"source": [
7
7
"# The RedisVL CLI\n",
8
8
"\n",
9
-
"RedisVL is a Python library with a dedicated CLI to help load and create vector search indices within Redis.\n",
9
+
"RedisVL is a Python library with a dedicated CLI to create, inspect, list, and delete Redis search indexes, inspect index statistics, and run the RedisVL MCP server.\n",
10
10
"\n",
11
11
"This notebook will walk through how to use the Redis Vector Library CLI (``rvl``).\n",
12
12
"\n",
@@ -39,18 +39,20 @@
39
39
"metadata": {},
40
40
"source": [
41
41
"## Commands\n",
42
-
"Here's a table of all the rvl commands and options. We'll go into each one in detail below.\n",
42
+
"The table below documents the current CLI tree. Use ``rvl index --help`` and ``rvl stats --help`` for detailed flag help and examples.\n",
"| `rvl version` | | display the redisvl library version|\n",
47
-
"| `rvl index` | `create --schema` or `-s <schema.yaml>`| create a redis index from the specified schema file|\n",
48
-
"| `rvl index` | `listall` | list all the existing search indices|\n",
49
-
"| `rvl index` | `info --index` or ` -i <index_name>` | display the index definition in tabular format|\n",
50
-
"| `rvl index` | `delete --index` or `-i <index_name>` | remove the specified index, leaving the data still in Redis|\n",
51
-
"| `rvl index` | `destroy --index` or `-i <index_name>`| remove the specified index, as well as the associated data|\n",
52
-
"| `rvl stats` | `--index` or `-i <index_name>` | display the index statistics, including number of docs, average bytes per record, indexing time, etc|\n",
53
-
"| `rvl stats` | `--schema` or `-s <schema.yaml>` | display the index statistics of a schema defined in <schema.yaml>. The index must have already been created within Redis|"
44
+
"| Command | Purpose |\n",
45
+
"|---------|---------|\n",
46
+
"| `rvl version` | display the installed RedisVL version |\n",
47
+
"| `rvl index create` | create a new Redis search index from a schema YAML file |\n",
48
+
"| `rvl index info` | display schema and storage details for an index |\n",
49
+
"| `rvl index listall` | list Redis search indexes available on the target Redis deployment |\n",
50
+
"| `rvl index delete` | delete an index while leaving indexed data in Redis |\n",
51
+
"| `rvl index destroy` | delete an index and drop its indexed data |\n",
52
+
"| `rvl stats` | display statistics for an existing Redis search index |\n",
53
+
"| `rvl mcp` | run the RedisVL MCP server |\n",
54
+
"\n",
55
+
"Within data-plane commands, ``-i`` or ``--index`` targets an existing Redis index name and ``-s`` or ``--schema`` points to a schema YAML file. Shared Redis connection options such as ``--url``, ``--host``, and ``--port`` apply to ``rvl index`` and ``rvl stats``."
54
56
]
55
57
},
56
58
{
@@ -59,7 +61,7 @@
59
61
"source": [
60
62
"## Index\n",
61
63
"\n",
62
-
"The ``rvl index`` command can be used for a number of tasks related to creating and managing indices. Whether you are working in Python or another language, this cli tool can still be useful for managing and inspecting your indices.\n",
64
+
"The ``rvl index`` command groups the index management workflows. Use ``rvl index --help`` to see the documented subcommands: ``create``, ``info``, ``listall``, ``delete``, and ``destroy``. Whether you are working in Python or another language, this CLI can still be useful for managing and inspecting your indexes.\n",
63
65
"\n",
64
66
"First, we will create an index from a yaml schema that looks like the following:\n"
65
67
]
@@ -251,7 +253,7 @@
251
253
"source": [
252
254
"## Stats\n",
253
255
"\n",
254
-
"The ``rvl stats`` command will return some basic information about the index. This is useful for checking the status of an index, or for getting information about the index to use in other commands."
256
+
"The ``rvl stats`` command returns basic information about an index. Use ``-i`` or ``--index`` to target an existing Redis index name, or ``-s`` or ``--schema`` to target a schema-defined index. Shared Redis connection options such as ``--url``, ``--host``, and ``--port`` also apply here."
0 commit comments