A powerful command-line interface for managing and interacting with Weaviate vector databases directly from your terminal.
Install using pip:
pip install weaviate-cliOn Mac, install using Homebrew:
brew install weaviate-cli# 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"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.jsonThe configuration file should be a JSON file with the following structure:
{
"host": "your-weaviate-host",
"http_port": "your-http-port",
"grpc_port": "your-grpc-port",
"auth": {
"type": "api_key",
"api_key": "your-api-key"
}
}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:
{
"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 moviesDetailed documentation will be added soon.
weaviate tagWe welcome contributions! Please see our Contributing Guidelines for details.
BSD-3-Clause License