weaviate-cli 3.0.0a2__tar.gz → 3.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. weaviate_cli-3.0.2/.github/workflows/main.yaml +77 -0
  2. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/.github/workflows/release.yaml +4 -8
  3. weaviate_cli-3.0.2/.pre-commit-config.yaml +14 -0
  4. weaviate_cli-3.0.2/CONTRIBUTING.md +68 -0
  5. weaviate_cli-3.0.2/Dockerfile +10 -0
  6. weaviate_cli-3.0.2/MANIFEST.in +1 -0
  7. weaviate_cli-3.0.2/Makefile +24 -0
  8. weaviate_cli-3.0.2/PKG-INFO +168 -0
  9. weaviate_cli-3.0.2/README.md +132 -0
  10. weaviate_cli-3.0.2/cli.py +56 -0
  11. weaviate_cli-3.0.2/publish.md +8 -0
  12. weaviate_cli-3.0.2/pyproject.toml +19 -0
  13. weaviate_cli-3.0.2/requirements-dev.txt +13 -0
  14. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/setup.cfg +11 -6
  15. weaviate_cli-3.0.2/test/README.md +41 -0
  16. weaviate_cli-3.0.2/test/integration/test_integration.py +171 -0
  17. weaviate_cli-3.0.2/test/unittests/conftest.py +23 -0
  18. weaviate_cli-3.0.2/test/unittests/test_cli.py +49 -0
  19. weaviate_cli-3.0.2/test/unittests/test_defaults.py +417 -0
  20. weaviate_cli-3.0.2/test/unittests/test_managers/test_collection_manager.py +199 -0
  21. weaviate_cli-3.0.2/test/unittests/test_managers/test_config_manager.py +42 -0
  22. weaviate_cli-3.0.2/test/unittests/test_managers/test_data_manager.py +64 -0
  23. weaviate_cli-3.0.2/test/unittests/test_managers/test_shard_manager.py +119 -0
  24. weaviate_cli-3.0.2/test/unittests/test_utils.py +97 -0
  25. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/__init__.py +2 -1
  26. weaviate_cli-3.0.2/weaviate_cli/commands/cancel.py +43 -0
  27. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/commands/create.py +144 -44
  28. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/commands/delete.py +51 -19
  29. weaviate_cli-3.0.2/weaviate_cli/commands/get.py +143 -0
  30. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/commands/query.py +24 -11
  31. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/commands/restore.py +16 -10
  32. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/commands/update.py +81 -35
  33. weaviate_cli-3.0.2/weaviate_cli/datasets/__init__.py +2 -0
  34. weaviate_cli-3.0.2/weaviate_cli/defaults.py +153 -0
  35. weaviate_cli-3.0.2/weaviate_cli/managers/__init__.py +0 -0
  36. weaviate_cli-3.0.2/weaviate_cli/managers/backup_manager.py +140 -0
  37. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/managers/collection_manager.py +103 -32
  38. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/managers/config_manager.py +33 -21
  39. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/managers/data_manager.py +199 -88
  40. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/managers/shard_manager.py +23 -10
  41. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/managers/tenant_manager.py +39 -8
  42. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli/utils.py +18 -9
  43. weaviate_cli-3.0.2/weaviate_cli.egg-info/PKG-INFO +168 -0
  44. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli.egg-info/SOURCES.txt +20 -2
  45. weaviate_cli-3.0.2/weaviate_cli.egg-info/requires.txt +5 -0
  46. weaviate_cli-3.0.0a2/.github/workflows/main.yaml +0 -27
  47. weaviate_cli-3.0.0a2/Dockerfile +0 -9
  48. weaviate_cli-3.0.0a2/PKG-INFO +0 -84
  49. weaviate_cli-3.0.0a2/README.rst +0 -49
  50. weaviate_cli-3.0.0a2/cli.py +0 -28
  51. weaviate_cli-3.0.0a2/publish.md +0 -15
  52. weaviate_cli-3.0.0a2/pyproject.toml +0 -9
  53. weaviate_cli-3.0.0a2/requirements-dev.txt +0 -10
  54. weaviate_cli-3.0.0a2/weaviate_cli/commands/get.py +0 -83
  55. weaviate_cli-3.0.0a2/weaviate_cli/managers/backup_manager.py +0 -81
  56. weaviate_cli-3.0.0a2/weaviate_cli.egg-info/PKG-INFO +0 -84
  57. weaviate_cli-3.0.0a2/weaviate_cli.egg-info/requires.txt +0 -4
  58. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/.gitignore +0 -0
  59. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/LICENSE +0 -0
  60. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/setup.py +0 -0
  61. {weaviate_cli-3.0.0a2/weaviate_cli/commands → weaviate_cli-3.0.2/test}/__init__.py +0 -0
  62. {weaviate_cli-3.0.0a2/weaviate_cli/managers → weaviate_cli-3.0.2/weaviate_cli/commands}/__init__.py +0 -0
  63. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2/weaviate_cli}/datasets/movies.json +0 -0
  64. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli.egg-info/dependency_links.txt +0 -0
  65. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli.egg-info/entry_points.txt +0 -0
  66. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli.egg-info/not-zip-safe +0 -0
  67. {weaviate_cli-3.0.0a2 → weaviate_cli-3.0.2}/weaviate_cli.egg-info/top_level.txt +0 -0
@@ -0,0 +1,77 @@
1
+ name: Main
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ lint-and-format:
11
+ name: Run Linter and Formatter
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+ - run: pip install -r requirements-dev.txt
19
+ - name: "Black"
20
+ run: black --check cli.py weaviate_cli test
21
+ - name: "Check release for pypi"
22
+ run: |
23
+ python -m build
24
+ python -m twine check dist/*
25
+
26
+ unit-tests:
27
+ name: Run Unit Tests
28
+ needs: [lint-and-format]
29
+ runs-on: ubuntu-latest
30
+ strategy:
31
+ matrix:
32
+ version: [ "3.9", "3.10", "3.11", "3.12" ]
33
+ steps:
34
+ - uses: actions/checkout@v3
35
+ - uses: actions/setup-python@v4
36
+ with:
37
+ python-version: ${{ matrix.version }}
38
+ - run: pip install -e .
39
+ - name: Run unit tests with pytest
40
+ run: |
41
+ pip install pytest-html
42
+ pytest test/unittests --html=test-report-${{ matrix.version }}.html --self-contained-html
43
+ - name: Upload test results
44
+ if: always()
45
+ uses: actions/upload-artifact@v3
46
+ with:
47
+ name: test-results-${{ matrix.version }}
48
+ path: test-report-${{ matrix.version }}.html
49
+
50
+ integration-tests:
51
+ needs: [unit-tests]
52
+ env:
53
+ WEAVIATE_VERSION: "1.27.0"
54
+ MODULES: "text2vec-transformers,text2vec-contextionary"
55
+ name: Run Integration Tests
56
+ runs-on: ubuntu-latest
57
+ strategy:
58
+ matrix:
59
+ version: [ "3.9", "3.10", "3.11", "3.12" ]
60
+ steps:
61
+ - uses: actions/checkout@v3
62
+ - uses: actions/setup-python@v4
63
+ with:
64
+ python-version: ${{ matrix.version }}
65
+ - run: pip install -e .
66
+ - name: Start up Weaviate cluster
67
+ uses: weaviate/weaviate-local-k8s@v2
68
+ with:
69
+ workers: 1
70
+ replicas: 1
71
+ weaviate-version: ${{ env.WEAVIATE_VERSION }}
72
+ modules: ${{ env.MODULES }}
73
+ enable-backup: true
74
+ - name: Run integration tests with pytest
75
+ run: |
76
+ pip install pytest-html
77
+ pytest test/integration/ --html=test-report-${{ matrix.version }}.html --self-contained-html
@@ -3,7 +3,7 @@ name: Build and Publish
3
3
  on:
4
4
  push:
5
5
  tags:
6
- - '**'
6
+ - '*'
7
7
 
8
8
  jobs:
9
9
  build-package:
@@ -11,14 +11,13 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Checkout
14
- uses: actions/checkout@v3
14
+ uses: actions/checkout@v4
15
15
  with:
16
16
  fetch-depth: 0
17
17
  - name: Set up Python 3.11
18
18
  uses: actions/setup-python@v4
19
19
  with:
20
20
  python-version: "3.11"
21
- cache: 'pip' # caching pip dependencies
22
21
  - name: Install dependencies
23
22
  run: pip install -r requirements-dev.txt
24
23
  - name: Build a binary wheel
@@ -32,7 +31,6 @@ jobs:
32
31
  gh-release:
33
32
  name: Create a GitHub Release on new tags
34
33
  needs: [build-package]
35
- if: startsWith(github.ref, 'refs/tags')
36
34
  runs-on: ubuntu-latest
37
35
  permissions:
38
36
  contents: write
@@ -43,7 +41,7 @@ jobs:
43
41
  name: weaviate-cli-wheel
44
42
  path: dist
45
43
  - name: Release
46
- uses: softprops/action-gh-release@v1
44
+ uses: softprops/action-gh-release@v2
47
45
  with:
48
46
  generate_release_notes: true
49
47
  draft: true
@@ -60,14 +58,12 @@ jobs:
60
58
  uses: actions/setup-python@v5
61
59
  with:
62
60
  python-version: "3.11"
63
- cache: 'pip' # caching pip dependencies
64
61
  - name: Install dependencies
65
62
  run: pip install -r requirements-dev.txt
66
63
  - name: Build a binary wheel
67
64
  run: python -m build
68
65
  - name: Publish distribution 📦 to PyPI on new tags
69
- if: startsWith(github.ref, 'refs/tags')
70
66
  uses: pypa/gh-action-pypi-publish@release/v1
71
67
  with:
72
68
  verbose: true
73
- password: ${{ secrets.PYPI_API_TOKEN }}
69
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,14 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+
10
+ - repo: https://github.com/psf/black
11
+ rev: 24.2.0
12
+ hooks:
13
+ - id: black
14
+ language_version: python3
@@ -0,0 +1,68 @@
1
+ # Contributing to Weaviate CLI
2
+
3
+ Thank you for looking into contributing to Weaviate CLI! We really appreciate that you are willing to spend some time and effort to make Weaviate better for everyone!
4
+
5
+ We have a detailed [contributor guide](https://weaviate.io/developers/contributor-guide/current/) as a part of our documentation. If you are new, we recommend reading through the [getting started guide for contributors](https://weaviate.io/developers/contributor-guide/current/getting-started/index.html) after reading this overview.
6
+
7
+ ## Finding a Good First Issue
8
+ We use the `good-first-issue` labels on issues that we think are great to get started. These issues are typically isolated to a specific area of the CLI.
9
+
10
+ ## Prerequisites
11
+ To contribute to Weaviate CLI you should have:
12
+ - Basic Python skills
13
+ - Experience using Weaviate CLI to understand the effects of changes
14
+ - Knowledge of writing tests (see our test files for examples)
15
+
16
+ ## Development Setup
17
+ *Note: The Weaviate team uses Linux and Mac (darwin/arm64) machines exclusively. Development on Windows may lead to unexpected issues.*
18
+
19
+ 1. Fork the repository
20
+ 2. Clone your fork
21
+ 3. Create a virtual environment:
22
+ ```bash
23
+ python -m venv .venv
24
+ ```
25
+ 4. Install development dependencies using Makefile:
26
+ ```bash
27
+ make install-dev
28
+ ```
29
+
30
+ ### Code Style
31
+ - We use Black for code formatting
32
+ - Install development dependencies and pre-commit hooks (if not already installed):
33
+ ```bash
34
+ make install-dev
35
+ ```
36
+ - Before committing, ensure code is formatted:
37
+ ```bash
38
+ make format
39
+ ```
40
+ - CI will check formatting using:
41
+ ```bash
42
+ make lint
43
+ ```
44
+
45
+ ## Tagging Your Commit
46
+ Please tag your commit(s) with the appropriate GH issue that your change refers to, e.g. `gh-9001 reduce memory allocations of ACME widget`. Please also include something in your PR description to indicate which issue it will close, e.g. `fixes #9001` or `closes #9001`.
47
+
48
+ ## Pull Request
49
+ If you open an external pull request our CI pipeline will get started. This external run will not have access to secrets. This prevents people from submitting a malicious PR to steal secrets. As a result, the CI run will be slightly different from an internal one. For example, it will not automatically push a Docker image. If your PR is merged, a container with your changes will be built from the trunk.
50
+
51
+ ## Agreements
52
+
53
+ ### Code of Conduct
54
+ Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
55
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
56
+
57
+ ### Contributor License Agreement
58
+ Contributions to Weaviate must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of Weaviate. Go to [this page](https://www.semi.technology/playbooks/misc/contributor-license-agreement.html) to read the current agreement.
59
+
60
+ The process works as follows:
61
+ - You contribute by opening a [pull request](#pull-request).
62
+ - If you have not contributed before, our bot will ask you to agree with the CLA.
63
+
64
+ ## If in Doubt, Ask
65
+ The Weaviate team consists of some of the nicest people on this planet. If something is unclear or you'd like a second opinion, please don't hesitate to ask. We are glad that you want to help us, so naturally, we will also do our best to help you on this journey.
66
+
67
+ ## Thanks for Contributing!
68
+ We really appreciate your effort in making Weaviate better for everyone!
@@ -0,0 +1,10 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ COPY . .
6
+
7
+ RUN apt-get update && apt-get install -y git
8
+ RUN pip install .
9
+
10
+ ENTRYPOINT ["python", "cli.py"]
@@ -0,0 +1 @@
1
+ include weaviate_cli/datasets/*.json
@@ -0,0 +1,24 @@
1
+ .PHONY: format lint test install-dev
2
+
3
+ build:
4
+ python -m build
5
+
6
+ build-check:
7
+ python -m twine check dist/*
8
+
9
+ install-dev:
10
+ pip install -r requirements-dev.txt
11
+ pre-commit install
12
+
13
+ format:
14
+ black cli.py weaviate_cli test
15
+
16
+ lint:
17
+ black --check cli.py weaviate_cli test
18
+
19
+ test:
20
+ pytest test/unittests
21
+
22
+ build-all: build build-check
23
+
24
+ all: format lint test build-all
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.1
2
+ Name: weaviate-cli
3
+ Version: 3.0.2
4
+ Summary: Command line interface to interact with weaviate
5
+ Home-page: https://github.com/weaviate/weaviate-cli
6
+ Download-URL: https://github.com/weaviate/weaviate-cli
7
+ Author: Weaviate
8
+ Author-email: hello@weaviate.io
9
+ License: BSD 3-clause
10
+ Project-URL: Docs, https://github.com/weaviate/weaviate-cli/blob/main/README.rst
11
+ Project-URL: Bugs, https://github.com/weaviate/weaviate-cli/issues
12
+ Keywords: cli,weaviate
13
+ Platform: Linux
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Natural Language :: English
18
+ Classifier: License :: OSI Approved :: GNU General Public License (GPL)
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.9
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: Implementation :: CPython
28
+ Requires-Python: >=3.9
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: weaviate-client>=4.5.0
32
+ Requires-Dist: click==8.1.7
33
+ Requires-Dist: semver>=3.0.2
34
+ Requires-Dist: numpy>=1.24.0
35
+ Requires-Dist: importlib-resources>=5.0.0
36
+
37
+ # Weaviate CLI
38
+
39
+ <img src="https://raw.githubusercontent.com/semi-technologies/weaviate/19de0956c69b66c5552447e84d016f4fe29d12c9/docs/assets/weaviate-logo.png" width="180" align="right" alt="Weaviate logo">
40
+
41
+ [![Build Status](https://github.com/weaviate/weaviate-cli/actions/workflows/main.yaml/badge.svg)](https://github.com/weaviate/weaviate-cli/actions/workflows/main.yaml)
42
+ [![PyPI version](https://badge.fury.io/py/weaviate-cli.svg)](https://badge.fury.io/py/weaviate-cli)
43
+
44
+ A powerful command-line interface for managing and interacting with Weaviate vector databases directly from your terminal.
45
+
46
+ ## Key Features
47
+ - **Collections**: Create, update, delete and get collection configurations
48
+ - **Data Management**: Import, query, update and delete data with various search types (vector, keyword, hybrid)
49
+ - **Multi-tenancy**: Manage tenants and their states across collections
50
+ - **Backup & Restore**: Create and restore backups with support for S3, GCS and filesystem
51
+ - **Sharding**: Monitor and manage collection shards
52
+ - **Flexible Configuration**: Configure vector indexes, replication, consistency levels and more
53
+
54
+ ## Quick Start
55
+ Install using pip:
56
+
57
+ ```bash
58
+ pip install weaviate-cli
59
+ ```
60
+
61
+ ## Basic Usage
62
+
63
+ ```bash
64
+ # Show available commands
65
+ weaviate-cli --help
66
+
67
+ # Create a collection
68
+ weaviate-cli create collection --collection movies --vectorizer transformers
69
+
70
+ # Import test data
71
+ weaviate-cli create data --collection movies --limit 1000
72
+
73
+ # Query data
74
+ weaviate-cli query data --collection movies --search-type hybrid --query "action movies"
75
+ ```
76
+
77
+ ## Core Commands
78
+
79
+ - **create**: Create collections, tenants, backups or import data
80
+ - **delete**: Remove collections, tenants or data
81
+ - **update**: Modify collection settings, tenant states or data
82
+ - **get**: Retrieve collection info, tenant details or shard status
83
+ - **query**: Search data using various methods
84
+ - **restore**: Restore backups from supported backends
85
+
86
+ ## Configuration
87
+
88
+ Weaviate CLI allows you to configure your cluster endpoints and parameters through a configuration file. By default, the CLI looks for a
89
+ configuration file at `~/.config/weaviate/config.json`. If this file does not exist, it will be created with the following default values:
90
+
91
+ ```json
92
+ {
93
+ "host": "localhost",
94
+ "http_port": "8080",
95
+ "grpc_port": "50051"
96
+ }
97
+ ```
98
+
99
+ You can also specify your own configuration file using the `--config-file` option:
100
+
101
+ ```bash
102
+ weaviate-cli --config-file /path/to/your/config.json
103
+ ```
104
+
105
+ The configuration file should be a JSON file with the following structure:
106
+
107
+ ```json
108
+ {
109
+ "host": "your-weaviate-host",
110
+ "http_port": "your-http-port",
111
+ "grpc_port": "your-grpc-port",
112
+ "auth": {
113
+ "type": "api_key",
114
+ "api_key": "your-api-key"
115
+ }
116
+ }
117
+ ```
118
+
119
+ If you are using a remote Weaviate instance, you can use the `weaviate-cli` command to authenticate with your Weaviate instance.
120
+ Here you can see an example on how the configuration file should look like if you are connecting to a WCD cluster:
121
+
122
+ ```json
123
+ {
124
+ "host": "thisisaninventedcluster.url.s3.us-west3.prov.weaviate.cloud",
125
+ "auth": {
126
+ "type": "api_key",
127
+ "api_key": "jfeRFsdfRfSasgsDoNOtTrYToUsErRQwqqdZfghasd"
128
+ },
129
+ "headers":{
130
+ "X-OpenAI-Api-Key":"OPEN_AI_KEY",
131
+ "X-Cohere-Api-Key":"Cohere_AI_KEY",
132
+ "X-JinaAI-Api-Key":"JINA_AI_KEY"
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## Requirements
138
+
139
+ - Python 3.9+
140
+ - Weaviate instance (local or remote)
141
+
142
+ ## Documentation
143
+
144
+ Detailed documentation will be added soon.
145
+
146
+ ## Supported Model Provider
147
+
148
+ - Contextionary
149
+ - Transformers
150
+ - OpenAI
151
+ - Ollama
152
+ - Cohere
153
+ - JinaAI
154
+
155
+ ## Community & Support
156
+
157
+ - [Slack Community](https://weaviate.io/slack) - Join our active community
158
+ - [Stack Overflow](https://stackoverflow.com/questions/tagged/weaviate) - Search using the `weaviate` tag
159
+ - [GitHub Issues](https://github.com/weaviate/weaviate-cli/issues) - Report bugs or request features
160
+
161
+ ## Contributing
162
+
163
+ We welcome contributions! Please see our [Contributing Guidelines](https://github.com/weaviate/weaviate-cli/blob/main/CONTRIBUTING.md) for
164
+ details.
165
+
166
+ ## License
167
+
168
+ BSD-3-Clause License
@@ -0,0 +1,132 @@
1
+ # Weaviate CLI
2
+
3
+ <img src="https://raw.githubusercontent.com/semi-technologies/weaviate/19de0956c69b66c5552447e84d016f4fe29d12c9/docs/assets/weaviate-logo.png" width="180" align="right" alt="Weaviate logo">
4
+
5
+ [![Build Status](https://github.com/weaviate/weaviate-cli/actions/workflows/main.yaml/badge.svg)](https://github.com/weaviate/weaviate-cli/actions/workflows/main.yaml)
6
+ [![PyPI version](https://badge.fury.io/py/weaviate-cli.svg)](https://badge.fury.io/py/weaviate-cli)
7
+
8
+ A powerful command-line interface for managing and interacting with Weaviate vector databases directly from your terminal.
9
+
10
+ ## Key Features
11
+ - **Collections**: Create, update, delete and get collection configurations
12
+ - **Data Management**: Import, query, update and delete data with various search types (vector, keyword, hybrid)
13
+ - **Multi-tenancy**: Manage tenants and their states across collections
14
+ - **Backup & Restore**: Create and restore backups with support for S3, GCS and filesystem
15
+ - **Sharding**: Monitor and manage collection shards
16
+ - **Flexible Configuration**: Configure vector indexes, replication, consistency levels and more
17
+
18
+ ## Quick Start
19
+ Install using pip:
20
+
21
+ ```bash
22
+ pip install weaviate-cli
23
+ ```
24
+
25
+ ## Basic Usage
26
+
27
+ ```bash
28
+ # Show available commands
29
+ weaviate-cli --help
30
+
31
+ # Create a collection
32
+ weaviate-cli create collection --collection movies --vectorizer transformers
33
+
34
+ # Import test data
35
+ weaviate-cli create data --collection movies --limit 1000
36
+
37
+ # Query data
38
+ weaviate-cli query data --collection movies --search-type hybrid --query "action movies"
39
+ ```
40
+
41
+ ## Core Commands
42
+
43
+ - **create**: Create collections, tenants, backups or import data
44
+ - **delete**: Remove collections, tenants or data
45
+ - **update**: Modify collection settings, tenant states or data
46
+ - **get**: Retrieve collection info, tenant details or shard status
47
+ - **query**: Search data using various methods
48
+ - **restore**: Restore backups from supported backends
49
+
50
+ ## Configuration
51
+
52
+ Weaviate CLI allows you to configure your cluster endpoints and parameters through a configuration file. By default, the CLI looks for a
53
+ configuration file at `~/.config/weaviate/config.json`. If this file does not exist, it will be created with the following default values:
54
+
55
+ ```json
56
+ {
57
+ "host": "localhost",
58
+ "http_port": "8080",
59
+ "grpc_port": "50051"
60
+ }
61
+ ```
62
+
63
+ You can also specify your own configuration file using the `--config-file` option:
64
+
65
+ ```bash
66
+ weaviate-cli --config-file /path/to/your/config.json
67
+ ```
68
+
69
+ The configuration file should be a JSON file with the following structure:
70
+
71
+ ```json
72
+ {
73
+ "host": "your-weaviate-host",
74
+ "http_port": "your-http-port",
75
+ "grpc_port": "your-grpc-port",
76
+ "auth": {
77
+ "type": "api_key",
78
+ "api_key": "your-api-key"
79
+ }
80
+ }
81
+ ```
82
+
83
+ If you are using a remote Weaviate instance, you can use the `weaviate-cli` command to authenticate with your Weaviate instance.
84
+ Here you can see an example on how the configuration file should look like if you are connecting to a WCD cluster:
85
+
86
+ ```json
87
+ {
88
+ "host": "thisisaninventedcluster.url.s3.us-west3.prov.weaviate.cloud",
89
+ "auth": {
90
+ "type": "api_key",
91
+ "api_key": "jfeRFsdfRfSasgsDoNOtTrYToUsErRQwqqdZfghasd"
92
+ },
93
+ "headers":{
94
+ "X-OpenAI-Api-Key":"OPEN_AI_KEY",
95
+ "X-Cohere-Api-Key":"Cohere_AI_KEY",
96
+ "X-JinaAI-Api-Key":"JINA_AI_KEY"
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## Requirements
102
+
103
+ - Python 3.9+
104
+ - Weaviate instance (local or remote)
105
+
106
+ ## Documentation
107
+
108
+ Detailed documentation will be added soon.
109
+
110
+ ## Supported Model Provider
111
+
112
+ - Contextionary
113
+ - Transformers
114
+ - OpenAI
115
+ - Ollama
116
+ - Cohere
117
+ - JinaAI
118
+
119
+ ## Community & Support
120
+
121
+ - [Slack Community](https://weaviate.io/slack) - Join our active community
122
+ - [Stack Overflow](https://stackoverflow.com/questions/tagged/weaviate) - Search using the `weaviate` tag
123
+ - [GitHub Issues](https://github.com/weaviate/weaviate-cli/issues) - Report bugs or request features
124
+
125
+ ## Contributing
126
+
127
+ We welcome contributions! Please see our [Contributing Guidelines](https://github.com/weaviate/weaviate-cli/blob/main/CONTRIBUTING.md) for
128
+ details.
129
+
130
+ ## License
131
+
132
+ BSD-3-Clause License
@@ -0,0 +1,56 @@
1
+ import click
2
+ import sys
3
+ from weaviate_cli.managers.config_manager import ConfigManager
4
+ from weaviate_cli.commands.create import create
5
+ from weaviate_cli.commands.delete import delete
6
+ from weaviate_cli.commands.get import get
7
+ from weaviate_cli.commands.update import update
8
+ from weaviate_cli.commands.query import query
9
+ from weaviate_cli.commands.restore import restore
10
+ from weaviate_cli.commands.cancel import cancel
11
+ from weaviate_cli import __version__
12
+
13
+
14
+ def print_version(ctx, param, value):
15
+ if not value or ctx.resilient_parsing:
16
+ return
17
+ click.echo(f"Weaviate CLI version {__version__}")
18
+ ctx.exit()
19
+
20
+
21
+ @click.group()
22
+ @click.option(
23
+ "--config-file",
24
+ required=False,
25
+ type=str,
26
+ is_flag=False,
27
+ help="If specified cli uses the config specified with this path.",
28
+ )
29
+ @click.option(
30
+ "--version",
31
+ is_flag=True,
32
+ callback=print_version,
33
+ expose_value=False,
34
+ is_eager=True,
35
+ help="Prints the version of the CLI.",
36
+ )
37
+ @click.pass_context
38
+ def main(ctx: click.Context, config_file):
39
+ """Weaviate CLI tool"""
40
+ try:
41
+ ctx.obj = {"config": ConfigManager(config_file)}
42
+ except Exception as e:
43
+ click.echo(f"Fatal Error: {e}")
44
+ sys.exit(1)
45
+
46
+
47
+ main.add_command(create)
48
+ main.add_command(delete)
49
+ main.add_command(get)
50
+ main.add_command(update)
51
+ main.add_command(restore)
52
+ main.add_command(query)
53
+ main.add_command(cancel)
54
+
55
+ if __name__ == "__main__":
56
+ main()
@@ -0,0 +1,8 @@
1
+ 1. Set the new version in the `weaviate/version.py` and `test/test_version.py`.
2
+ 2. Run all tests. (Check `test/README.md`)
3
+ 3. Check if you are on the correct **GitBranch**.
4
+ 4. **Commit** the most current version to GitHub if this has not been done yet.
5
+ 5. Give the commit of the current version a proper tag:\
6
+ `git tag -a '<your tag>' -m '<some message for the tag>' && git push --tags`
7
+ Tags are either in the form of `v0.2.5` or `v0.2.5rc0`.
8
+ 6. The release workflow defined in `.github/workflows/release.yaml` will take care of building, creating the release, and pushing to PyPI.
@@ -0,0 +1,19 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools >= 65",
4
+ "setuptools_scm[toml] >6.2",
5
+ "wheel >= 0.38.1",
6
+ ]
7
+ build-backend = 'setuptools.build_meta'
8
+
9
+ [tool.setuptools_scm]
10
+
11
+ [tool.black]
12
+ line-length = 88
13
+ target-version = ['py311']
14
+ include = '\.pyi?$'
15
+ extend-exclude = '''
16
+ # A regex preceded with ^/ will apply only to files and directories
17
+ # in the root of the project.
18
+ ^/docs
19
+ '''
@@ -0,0 +1,13 @@
1
+ weaviate-client>=4.0.0
2
+ click==8.1.7
3
+ twine
4
+ pytest
5
+ semver==3.0.2
6
+ numpy>=1.24.0
7
+ build
8
+ wheel
9
+ importlib_metadata==8.5.0
10
+ importlib-resources>=5.0.0
11
+ setuptools_scm
12
+ black==24.3.0
13
+ pre-commit==3.6.2