{
  "id": "cli",
  "title": "The RedisVL CLI",
  "url": "https://redis.io/docs/latest/develop/ai/redisvl/user_guide/cli/",
  "summary": "",
  "tags": [],
  "last_updated": "2026-05-06T11:49:45+02:00",
  "page_type": "content",
  "content_hash": "dace972ec59903fd57a4044eacba5861748b14c8321d5bd1fb95dd3b90e59dbf",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "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\nThis notebook will walk through how to use the Redis Vector Library CLI (``rvl``).\n\nBefore running this notebook, be sure to\n1. Have installed ``redisvl`` and have that environment active for this notebook.\n2. Have a running Redis instance with Redis Search enabled\n\nFor complete command syntax and options, see the CLI Reference.\n\n\n[code example]"
    },
    {
      "id": "commands",
      "title": "Commands",
      "role": "syntax",
      "text": "The table below documents the current CLI tree. Use ``rvl index --help`` and ``rvl stats --help`` for detailed flag help and examples.\n\n| Command | Purpose |\n|---------|---------|\n| `rvl version` | display the installed RedisVL version |\n| `rvl index create` | create a new Redis search index from a schema YAML file |\n| `rvl index info` | display schema and storage details for an index |\n| `rvl index listall` | list Redis search indexes available on the target Redis deployment |\n| `rvl index delete` | delete an index while leaving indexed data in Redis |\n| `rvl index destroy` | delete an index and drop its indexed data |\n| `rvl stats` | display statistics for an existing Redis search index |\n| `rvl mcp` | run the RedisVL MCP server |\n\nWithin 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``."
    },
    {
      "id": "index",
      "title": "Index",
      "role": "content",
      "text": "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\nFirst, we will create an index from a yaml schema that looks like the following:\n\n\n\n[code example]\n\n    Overwriting schema.yaml\n\n\n\n[code example]\n\n    Index created successfully\n\n\n\n[code example]\n\n    Indices:\n    1. vectorizers\n\n\n\n[code example]\n\n    \n    \n    Index Information:\n    ╭───────────────┬───────────────┬───────────────┬───────────────┬───────────────╮\n    │ Index Name    │ Storage Type  │ Prefixes      │ Index Options │ Indexing      │\n    ├───────────────┼───────────────┼───────────────┼───────────────┼───────────────┤\n    | vectorizers   | HASH          | ['doc']       | []            | 0             |\n    ╰───────────────┴───────────────┴───────────────┴───────────────┴───────────────╯\n    Index Fields:\n    ╭─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────╮\n    │ Name            │ Attribute       │ Type            │ Field Option    │ Option Value    │ Field Option    │ Option Value    │ Field Option    │ Option Value    │ Field Option    │ Option Value    │\n    ├─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┤\n    │ sentence        │ sentence        │ TEXT            │ WEIGHT          │ 1               │                 │                 │                 │                 │                 │                 │\n    │ embedding       │ embedding       │ VECTOR          │ algorithm       │ FLAT            │ data_type       │ FLOAT32         │ dim             │ 768             │ distance_metric │ COSINE          │\n    ╰─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────╯\n\n\n\n[code example]\n\n    Index deleted successfully\n\n\n\n[code example]\n\n    Indices:"
    },
    {
      "id": "stats",
      "title": "Stats",
      "role": "content",
      "text": "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.\n\n\n[code example]\n\n    Index created successfully\n\n\n\n[code example]\n\n    Indices:\n    1. vectorizers\n\n\n\n[code example]\n\n    \n    Statistics:\n    ╭─────────────────────────────┬────────────╮\n    │ Stat Key                    │ Value      │\n    ├─────────────────────────────┼────────────┤\n    │ num_docs                    │ 0          │\n    │ num_terms                   │ 0          │\n    │ max_doc_id                  │ 0          │\n    │ num_records                 │ 0          │\n    │ percent_indexed             │ 1          │\n    │ hash_indexing_failures      │ 0          │\n    │ number_of_uses              │ 1          │\n    │ bytes_per_record_avg        │ nan        │\n    │ doc_table_size_mb           │ 0.00769805 │\n    │ inverted_sz_mb              │ 0          │\n    │ key_table_size_mb           │ 2.28881835 │\n    │ offset_bits_per_record_avg  │ nan        │\n    │ offset_vectors_sz_mb        │ 0          │\n    │ offsets_per_term_avg        │ nan        │\n    │ records_per_doc_avg         │ nan        │\n    │ sortable_values_size_mb     │ 0          │\n    │ total_indexing_time         │ 0          │\n    │ total_inverted_index_blocks │ 0          │\n    │ vector_index_sz_mb          │ 0          │\n    ╰─────────────────────────────┴────────────╯"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "You can modify these commands with the below optional arguments\n\n| Argument       | Description | Default |\n|----------------|-------------|---------|\n| `-u --url`     | The full Redis URL to connect to | `redis://localhost:6379` |\n| `--host`       | Redis host to connect to | `localhost` |\n| `-p --port`    | Redis port to connect to. Must be an integer | `6379` |\n| `--user`       | Redis username, if one is required   | `default` |\n| `--ssl`        | Boolean flag indicating if ssl is required. If set the Redis base url changes to `rediss://` | None |\n| `-a --password`| Redis password, if one is required| `\"\"` |"
    },
    {
      "id": "choosing-your-redis-instance",
      "title": "Choosing your Redis instance",
      "role": "content",
      "text": "By default rvl first checks if you have `REDIS_URL` environment variable defined and tries to connect to that. If not, it then falls back to `localhost:6379`, unless you pass the `--host` or `--port` arguments\n\n\n[code example]\n\n    Indices:\n    1. vectorizers"
    },
    {
      "id": "using-ssl-encryption",
      "title": "Using SSL encryption",
      "role": "content",
      "text": "If your Redis instance is configured to use SSL encryption then set the `--ssl` flag.\nYou can similarly specify the username and password to construct the full Redis URL\n\n\n[code example]\n\n\n[code example]\n\n    Index deleted successfully"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "python",
      "code": "# First, see if the rvl tool is installed\n!rvl version",
      "section_id": "overview"
    },
    {
      "id": "index-ex0",
      "language": "python",
      "code": "%%writefile schema.yaml\n\nversion: '0.1.0'\n\nindex:\n    name: vectorizers\n    prefix: doc\n    storage_type: hash\n\nfields:\n    - name: sentence\n      type: text\n    - name: embedding\n      type: vector\n      attrs:\n        dims: 768\n        algorithm: flat\n        distance_metric: cosine",
      "section_id": "index"
    },
    {
      "id": "index-ex1",
      "language": "python",
      "code": "# Create an index from a yaml schema\n!rvl index create -s schema.yaml",
      "section_id": "index"
    },
    {
      "id": "index-ex2",
      "language": "python",
      "code": "# list the indices that are available\n!rvl index listall",
      "section_id": "index"
    },
    {
      "id": "index-ex3",
      "language": "python",
      "code": "# inspect the index fields\n!rvl index info -i vectorizers",
      "section_id": "index"
    },
    {
      "id": "index-ex4",
      "language": "python",
      "code": "# delete an index without deleting the data within it\n!rvl index delete -i vectorizers",
      "section_id": "index"
    },
    {
      "id": "index-ex5",
      "language": "python",
      "code": "# see the indices that still exist\n!rvl index listall",
      "section_id": "index"
    },
    {
      "id": "stats-ex0",
      "language": "python",
      "code": "# create a new index with the same schema\n# recreating the index will reindex the documents\n!rvl index create -s schema.yaml",
      "section_id": "stats"
    },
    {
      "id": "stats-ex1",
      "language": "python",
      "code": "# list the indices that are available\n!rvl index listall",
      "section_id": "stats"
    },
    {
      "id": "stats-ex2",
      "language": "python",
      "code": "# see all the stats for the index\n!rvl stats -i vectorizers",
      "section_id": "stats"
    },
    {
      "id": "choosing-your-redis-instance-ex0",
      "language": "python",
      "code": "# specify your Redis instance to connect to\n!rvl index listall --host localhost --port 6379",
      "section_id": "choosing-your-redis-instance"
    },
    {
      "id": "using-ssl-encryption-ex0",
      "language": "python",
      "code": "# NBVAL_SKIP\n# Not run in CI. This cell would block until the nbval cell timeout\n# connect to rediss://jane_doe:password123@localhost:6379\n!rvl index listall --user jane_doe -a password123 --ssl",
      "section_id": "using-ssl-encryption"
    },
    {
      "id": "using-ssl-encryption-ex1",
      "language": "python",
      "code": "!rvl index destroy -i vectorizers",
      "section_id": "using-ssl-encryption"
    }
  ]
}
