Skip to content

Commit a2808c4

Browse files
committed
docs: add CLI reference page and remove dead format flag (#499)
Add dedicated CLI reference documentation following Diataxis framework: - Create docs/api/cli.rst with complete command reference including syntax, options, connection configuration, and help documentation - Add CLI to API docs toctree - Add CLI how-to card linking to existing tutorial - Cross-link tutorial to reference page Remove dead code: - Delete unused -f/--format flag from rvl index and rvl stats commands - Flag accepted parameter but never used it in display functions
1 parent b8c234f commit a2808c4

5 files changed

Lines changed: 12 additions & 14 deletions

File tree

docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ reranker
2323
cache
2424
message_history
2525
router
26+
cli
2627
```
2728

docs/user_guide/cli.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"\n",
1313
"Before running this notebook, be sure to\n",
1414
"1. Have installed ``redisvl`` and have that environment active for this notebook.\n",
15-
"2. Have a running Redis instance with Redis Search enabled"
15+
"2. Have a running Redis instance with Redis Search enabled\n",
16+
"\n",
17+
"For complete command syntax and options, see the [CLI Reference](../api/cli.rst)."
1618
]
1719
},
1820
{

docs/user_guide/how_to_guides/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ How-to guides are **task-oriented** recipes that help you accomplish specific go
3636
- [Choose a Storage Type](../05_hash_vs_json.ipynb) -- Hash vs JSON formats and nested data
3737
:::
3838

39+
:::{grid-item-card} 💻 CLI Operations
40+
41+
- [Manage Indices with the CLI](../cli.ipynb) -- create, inspect, and delete indices from your terminal
42+
:::
43+
3944
::::
4045

4146
## Quick Reference
@@ -53,6 +58,7 @@ How-to guides are **task-oriented** recipes that help you accomplish specific go
5358
| Improve search accuracy | [Rerank Search Results](../06_rerankers.ipynb) |
5459
| Optimize index performance | [Optimize Indexes with SVS-VAMANA](../09_svs_vamana.ipynb) |
5560
| Decide on storage format | [Choose a Storage Type](../05_hash_vs_json.ipynb) |
61+
| Manage indices from terminal | [Manage Indices with the CLI](../cli.ipynb) |
5662

5763
```{toctree}
5864
:hidden:

redisvl/cli/index.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ def __init__(self):
3030
parser = argparse.ArgumentParser(usage=self.usage)
3131

3232
parser.add_argument("command", help="Subcommand to run")
33-
parser.add_argument(
34-
"-f",
35-
"--format",
36-
help="Output format for info command",
37-
type=str,
38-
default="rounded_outline",
39-
)
4033
parser = add_index_parsing_options(parser)
4134

4235
args = parser.parse_args(sys.argv[2:])

redisvl/cli/stats.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class Stats:
4242

4343
def __init__(self):
4444
parser = argparse.ArgumentParser(usage=self.usage)
45-
46-
parser.add_argument(
47-
"-f", "--format", help="Output format", type=str, default="rounded_outline"
48-
)
4945
parser = add_index_parsing_options(parser)
5046
args = parser.parse_args(sys.argv[2:])
5147
try:
@@ -61,7 +57,7 @@ def stats(self, args: Namespace):
6157
rvl stats -i <index_name> | -s <schema_path>
6258
"""
6359
index = self._connect_to_index(args)
64-
_display_stats(index.info(), output_format=args.format)
60+
_display_stats(index.info())
6561

6662
def _connect_to_index(self, args: Namespace) -> SearchIndex:
6763
# connect to redis
@@ -85,7 +81,7 @@ def _connect_to_index(self, args: Namespace) -> SearchIndex:
8581
return index
8682

8783

88-
def _display_stats(index_info, output_format="rounded_outline"):
84+
def _display_stats(index_info):
8985
# Extracting the statistics
9086
stats_data = [(key, str(index_info.get(key))) for key in STATS_KEYS]
9187

0 commit comments

Comments
 (0)