Command Line Interface#
RedisVL provides a command line interface (CLI) called rvl for managing vector search indices. The CLI enables you to create, inspect, and delete indices directly from your terminal without writing Python code.
Installation#
The rvl command is included when you install RedisVL.
pip install redisvl
Verify the installation by running:
rvl version
Connection Configuration#
The CLI connects to Redis using the following resolution order:
The
REDIS_URLenvironment variable, if setExplicit connection flags (
--host,--port,--url)Default values (
localhost:6379)
Connection Flags
All commands that interact with Redis accept these optional flags:
Flag |
Type |
Description |
Default |
|---|---|---|---|
|
string |
Full Redis URL (e.g., |
None |
|
string |
Redis server hostname |
|
|
integer |
Redis server port |
|
|
string |
Redis username for authentication |
|
|
string |
Redis password for authentication |
Empty |
|
flag |
Enable SSL/TLS encryption |
Disabled |
Examples
Connect using environment variable:
export REDIS_URL="redis://localhost:6379"
rvl index listall
Connect with explicit host and port:
rvl index listall --host myredis.example.com --port 6380
Connect with authentication and SSL:
rvl index listall --user admin --password secret --ssl
Getting Help#
All commands support the -h and --help flags to display usage information.
Flag |
Description |
|---|---|
|
Display usage information for the command |
Examples
# Display top-level help
rvl --help
# Display help for a command group
rvl index --help
# Display help for a specific subcommand
rvl index create --help
Running rvl without any arguments also displays the top-level help message.
Tip
For a hands-on tutorial with practical examples, see the The RedisVL CLI.
Commands#
rvl version#
Display the installed RedisVL version.
Syntax
rvl version [OPTIONS]
Options
Option |
Description |
|---|---|
|
Print only the version number without additional formatting |
Examples
# Full version output
rvl version
# Version number only
rvl version --short
rvl index#
Manage vector search indices. This command group provides subcommands for creating, inspecting, listing, and removing indices.
Syntax
rvl index <subcommand> [OPTIONS]
Subcommands
Subcommand |
Description |
|---|---|
|
Create a new index from a YAML schema file |
|
Display detailed information about an index |
|
List all existing indices in the Redis instance |
|
Remove an index while preserving the underlying data |
|
Remove an index and delete all associated data |
rvl index create#
Create a new vector search index from a YAML schema definition.
Syntax
rvl index create -s <schema_file> [CONNECTION_OPTIONS]
Required Options
Option |
Description |
|---|---|
|
Path to the YAML schema file defining the index structure |
Example
rvl index create -s schema.yaml
Schema File Format
The schema file must be valid YAML with the following structure:
version: '0.1.0'
index:
name: my_index
prefix: doc
storage_type: hash
fields:
- name: content
type: text
- name: embedding
type: vector
attrs:
dims: 768
algorithm: hnsw
distance_metric: cosine
rvl index info#
Display detailed information about an existing index, including field definitions and index options.
Syntax
rvl index info (-i <index_name> | -s <schema_file>) [OPTIONS]
Options
Option |
Description |
|---|---|
|
Name of the index to inspect |
|
Path to the schema file (alternative to specifying index name) |
Example
rvl index info -i my_index
Output
The command displays two tables:
Index Information containing the index name, storage type, key prefixes, index options, and indexing status
Index Fields listing each field with its name, attribute, type, and any additional field options
rvl index listall#
List all vector search indices in the connected Redis instance.
Syntax
rvl index listall [CONNECTION_OPTIONS]
Example
rvl index listall
Output
Returns a numbered list of all index names:
Indices:
1. products_index
2. documents_index
3. embeddings_index
rvl index delete#
Remove an index from Redis while preserving the underlying data. Use this when you want to rebuild an index with a different schema without losing your data.
Syntax
rvl index delete (-i <index_name> | -s <schema_file>) [CONNECTION_OPTIONS]
Options
Option |
Description |
|---|---|
|
Name of the index to delete |
|
Path to the schema file (alternative to specifying index name) |
Example
rvl index delete -i my_index
rvl index destroy#
Remove an index and permanently delete all associated data from Redis. This operation cannot be undone.
Syntax
rvl index destroy (-i <index_name> | -s <schema_file>) [CONNECTION_OPTIONS]
Options
Option |
Description |
|---|---|
|
Name of the index to destroy |
|
Path to the schema file (alternative to specifying index name) |
Example
rvl index destroy -i my_index
Warning
This command permanently deletes both the index and all documents stored with the index prefix. Ensure you have backups before running this command.
rvl stats#
Display statistics about an existing index, including document counts, memory usage, and indexing performance metrics.
Syntax
rvl stats (-i <index_name> | -s <schema_file>) [OPTIONS]
Options
Option |
Description |
|---|---|
|
Name of the index to query |
|
Path to the schema file (alternative to specifying index name) |
Example
rvl stats -i my_index
Statistics Reference
The command returns the following metrics:
Metric |
Description |
|---|---|
|
Total number of indexed documents |
|
Number of distinct terms in text fields |
|
Highest internal document ID |
|
Total number of index records |
|
Percentage of documents fully indexed |
|
Number of documents that failed to index |
|
Number of times the index has been queried |
|
Average bytes per index record |
|
Document table size in megabytes |
|
Inverted index size in megabytes |
|
Key table size in megabytes |
|
Average offset bits per record |
|
Offset vectors size in megabytes |
|
Average offsets per term |
|
Average records per document |
|
Sortable values size in megabytes |
|
Total time spent indexing in milliseconds |
|
Number of inverted index blocks |
|
Vector index size in megabytes |
rvl migrate#
Warning
The index migrator is an experimental feature. APIs, CLI commands, and on-disk formats (plans, checkpoints, backups) may change in future releases. Review migration plans carefully before applying to production indexes.
Manage document-preserving index migrations. This command group provides subcommands for planning, executing, and validating schema migrations that preserve existing data.
Syntax
rvl migrate <subcommand> [OPTIONS]
Subcommands
Subcommand |
Description |
|---|---|
|
Show migration guidance and supported capabilities |
|
Interactively build a migration plan and schema patch |
|
Generate a migration plan from a schema patch or target schema |
|
Execute a reviewed drop/recreate migration plan |
|
Estimate disk space required for a migration (dry-run) |
|
Restore original vectors from a backup directory |
|
Validate a completed migration against the live index |
|
Generate a batch migration plan for multiple indexes |
|
Execute a batch migration plan with state tracking |
|
Resume an interrupted batch migration |
|
Show status of an in-progress or completed batch migration |
rvl migrate plan#
Generate a migration plan for a document-preserving drop/recreate migration.
Syntax
rvl migrate plan --index <name> (--schema-patch <patch.yaml> | --target-schema <schema.yaml>) [OPTIONS]
Required Options
Option |
Description |
|---|---|
|
Name of the source index to migrate |
|
Path to a YAML schema patch file (mutually exclusive with |
|
Path to a full target schema YAML file (mutually exclusive with |
Optional Options
Option |
Description |
|---|---|
|
Output path for the migration plan YAML (default: |
Example
rvl migrate plan -i my_index --schema-patch changes.yaml --plan-out plan.yaml
rvl migrate apply#
Execute a reviewed drop/recreate migration plan. Use --async for large migrations involving vector quantization.
Warning
Hash vector quantization is unsupported when the same Redis keys are also indexed by another live RediSearch index that expects the old vector datatype. Quantization rewrites vector bytes in the document key itself, so other indexes covering the same key may drop the document or fail to index it. Use an application-level migration with new keys or fields when documents are shared across indexes.
Syntax
rvl migrate apply --plan <migration_plan.yaml> --backup-dir <dir> [OPTIONS]
Required Options
Option |
Description |
|---|---|
|
Path to the migration plan YAML file |
|
Required migration backup directory. Vector backup files are written when hash vector bytes are mutated; index-only and JSON migrations validate and record the directory without writing vector backup files. |
Optional Options
Option |
Description |
|---|---|
|
Run migration asynchronously (recommended for large quantization jobs) |
|
Keys per pipeline batch (default 500) |
|
Number of parallel workers for quantization (default 1). |
|
Path to a YAML file with post-migration query checks |
Example
rvl migrate apply --plan plan.yaml --backup-dir /tmp/backups
rvl migrate apply --plan plan.yaml --async --backup-dir /tmp/backups --workers 4
rvl migrate wizard#
Interactively build a schema patch and migration plan through a guided wizard.
Syntax
rvl migrate wizard [--index <name>] [OPTIONS]
Example
rvl migrate wizard -i my_index --plan-out plan.yaml
rvl migrate rollback#
Restore original vector bytes from a retained backup directory. Rollback restores data only; recreate the original index schema separately if the index definition was changed.
Syntax
rvl migrate rollback --backup-dir <dir> [--index <name>] [OPTIONS]
Required Options
Option |
Description |
|---|---|
|
Directory containing vector backup files from a prior migration |
Example
rvl migrate rollback --backup-dir /tmp/backups --index my_index
rvl migrate batch-plan#
Generate a batch plan that applies one shared schema patch to multiple indexes.
Syntax
rvl migrate batch-plan --schema-patch <patch.yaml> (--pattern <glob> | --indexes <name1,name2> | --indexes-file <file>) [OPTIONS]
rvl migrate batch-apply#
Execute a batch migration plan and write checkpoint state for resume.
Syntax
rvl migrate batch-apply --plan <batch_plan.yaml> --backup-dir <dir> [OPTIONS]
Required Options
Option |
Description |
|---|---|
|
Path to the batch plan YAML file |
|
Required per-index migration backup directory. Stored in checkpoint state and used for vector backup files when hash vector bytes are mutated. |
Example
rvl migrate batch-apply --plan batch_plan.yaml --backup-dir /tmp/backups
rvl migrate batch-resume#
Resume an interrupted batch migration from its checkpoint state.
Syntax
rvl migrate batch-resume --state <batch_state.yaml> [--plan <batch_plan.yaml>] [--retry-failed] [--backup-dir <dir>]
If --backup-dir is omitted, resume uses the backup directory stored in batch_state.yaml. Passing a different backup directory for the same checkpoint is rejected.
rvl migrate batch-status#
Show status for an in-progress or completed batch migration.
Syntax
rvl migrate batch-status --state <batch_state.yaml>
Exit Codes#
The CLI returns the following exit codes:
Code |
Description |
|---|---|
|
Command completed successfully |
|
Command failed due to missing required arguments or invalid input |