Skip to main content

Weaviate CLI

Weaviate logo

Build Status PyPI version

A powerful command-line interface for managing and interacting with Weaviate vector databases directly from your terminal.

Key Features

  • Collections: Create, update, delete and get collection configurations
  • Data Management: Import, query, update and delete data with various search types (vector, keyword, hybrid)
  • Multi-tenancy: Manage tenants and their states across collections
  • Backup & Restore: Create and restore backups with support for S3, GCS and filesystem
  • Sharding: Monitor and manage collection shards
  • Flexible Configuration: Configure vector indexes, replication, consistency levels and more
  • Role Management: Assign and revoke roles and permissions to users

Quick Start

Install using pip:

pip install weaviate-cli

On Mac, install using Homebrew:

brew install weaviate-cli

Basic Usage

# Show available commands
weaviate-cli --help

# Create a collection
weaviate-cli create collection --collection movies --vectorizer transformers

# Import test data
weaviate-cli create data --collection movies --limit 1000

# Query data
weaviate-cli query data --collection movies --search-type hybrid --query "action movies"

Core Commands

  • create: Create collections, tenants, backups, replications or import data
  • delete: Remove collections, tenants, replications or data
  • update: Modify collection settings, tenant states or data
  • get: Retrieve collection info, tenant details, replication operations or shard status
  • query: Search data using various methods
  • restore: Restore backups from supported backends
  • assign: Assign roles and permissions to users
  • revoke: Revoke roles and permissions from users

Configuration

Weaviate CLI allows you to configure your cluster endpoints and parameters through a configuration file. By default, the CLI looks for a configuration file at ~/.config/weaviate/config.json. If this file does not exist, it will be created with the following default values:

{
    "host": "localhost",
    "http_port": "8080",
    "grpc_port": "50051"
}

You can also specify your own configuration file using the --config-file option:

weaviate-cli --config-file /path/to/your/config.json

The configuration file should be a JSON file with the following structure:

{
    "host": "your-weaviate-host",
    "http_port": your-http-port, # note, this should be a number, NOT a string
    "grpc_port": your-grpc-port, # note, this should be a number, NOT a string
    "grpc_host": "your-grpc-host",
    "auth": {
        "type": "api_key",
        "api_key": "your-api-key"
    }
}

You can pass host without protocol and port or with protocol AND port.

E.g. this is also correct.

{
    "host": "https://your-weaviate-host:443",
    "grpc_host": "https://your-grpc-host:443",
    "auth": {
        "type": "api_key",
        "api_key": "your-api-key"
    }
}

NOTE: when you pass port, make sure to omit the protocol, otherwise it'll try to deduct it from the host string.

If you are using a remote Weaviate instance, you can use the weaviate-cli command to authenticate with your Weaviate instance. Here you can see an example on how the configuration file should look like if you are connecting to a WCD cluster:

NOTE: here host URL should be http endpoint not grpc_endpoint of the weaviate cloud. And without "https" prefix.

 {
     "host": "thisisaninventedcluster.url.s3.us-west3.prov.weaviate.cloud",
     "auth": {
         "type": "api_key",
         "api_key": "jfeRFsdfRfSasgsDoNOtTrYToUsErRQwqqdZfghasd"
     },
    "headers":{
        "X-OpenAI-Api-Key":"OPEN_AI_KEY",
        "X-Cohere-Api-Key":"Cohere_AI_KEY",
        "X-JinaAI-Api-Key":"JINA_AI_KEY"
        }
 }

If you want to allow using different users for different actions in your cluster, you can specify the different users in the configuration file and use the --user option to specify which user to use for a specific action. An example of how the configuration file should look like is the following:

{
    "host": "your-weaviate-host",
    "auth": {
        "type": "user",
        "user1": "your-api-key-for-user1",
        "user2": "your-api-key-for-user2"
    }
}

It's important to note that the "type" key must be set to "user" and the users must be specified in the auth section. When using the weaviate-cli command, you can specify the user to use for an action by using the --user option. For example:

weaviate-cli --user user1 create collection --collection movies --vectorizer transformers
weaviate-cli --user user2 get collection --collection movies

Shell Completion

Execute the following commands to enable shell completion.

Warning Warp is currently not supporting dynamic auto completion and thus can not support weaviate-cli completion.

Zsh

_WEAVIATE_CLI_COMPLETE=zsh_source weaviate-cli > ${fpath[1]}/_weaviate-cli
autoload -U compinit && compinit
echo 'autoload -U compinit && compinit' >> ~/.zshrc

Bash

echo 'eval "$(_WEAVIATE_CLI_COMPLETE=bash_source weaviate-cli)"' >> ~/.bashrc

Requirements

  • Python 3.10+
  • Weaviate instance (local or remote)

Documentation

Detailed documentation will be added soon.

Supported Model Provider

  • Weaviate Embeddings Service (WCD clusters only)
  • Contextionary
  • Transformers
  • OpenAI
  • Ollama
  • Cohere
  • JinaAI

Community & Support

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

BSD-3-Clause License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weaviate_cli-3.4.2.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weaviate_cli-3.4.2-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file weaviate_cli-3.4.2.tar.gz.

File metadata

  • Download URL: weaviate_cli-3.4.2.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for weaviate_cli-3.4.2.tar.gz
Algorithm Hash digest
SHA256 eb4a3686a45d48bd2f8833af676b2f1c25effd43ef556ec28535b07fce44ce5c
MD5 0a369dd5321c4185cc7d5c0c754146bd
BLAKE2b-256 a1e84de5b5a3ebc1f1b20512159bda3c0379efe0f291eee2cbc876877ee560ba

See more details on using hashes here.

File details

Details for the file weaviate_cli-3.4.2-py3-none-any.whl.

File metadata

  • Download URL: weaviate_cli-3.4.2-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for weaviate_cli-3.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7dfc55da8532fe9bb2459c64b676cae350ac9680e07344a45ba2d26db774678a
MD5 c28b304382204a16b189cec4b420ea82
BLAKE2b-256 7a61e593e0c317a7c45b784544f3a32768066d9547630748abd621d29cf77021

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.4.2 This release

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.4

2 files

3.2.3

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.4

2 files

3.1.3

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.2.0

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.2.0

1 file

1.1.0

1 file

1.0.0

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page