meilisearch-rest-cli 0.1.0__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.
- meilisearch_rest_cli-0.1.0/.gitignore +7 -0
- meilisearch_rest_cli-0.1.0/LICENSE +21 -0
- meilisearch_rest_cli-0.1.0/PKG-INFO +158 -0
- meilisearch_rest_cli-0.1.0/README.md +130 -0
- meilisearch_rest_cli-0.1.0/pyproject.toml +44 -0
- meilisearch_rest_cli-0.1.0/src/meilisearch_rest_cli/__init__.py +1 -0
- meilisearch_rest_cli-0.1.0/src/meilisearch_rest_cli/cli.py +20 -0
- meilisearch_rest_cli-0.1.0/src/meilisearch_rest_cli/spec.yaml +13805 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shivaam
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meilisearch-rest-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A full-coverage CLI for the Meilisearch REST API, generated from the official OpenAPI spec
|
|
5
|
+
Project-URL: Homepage, https://github.com/shivaam/meilisearch-rest-cli
|
|
6
|
+
Project-URL: Repository, https://github.com/shivaam/meilisearch-rest-cli
|
|
7
|
+
Project-URL: Issues, https://github.com/shivaam/meilisearch-rest-cli/issues
|
|
8
|
+
Project-URL: Meilisearch API docs, https://www.meilisearch.com/docs/reference/api/overview
|
|
9
|
+
Author: shivaam
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: api,cli,meilisearch,openapi,rest,search
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Database
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Utilities
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: openapi-cli-gen>=0.0.13
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# meilisearch-rest-cli
|
|
30
|
+
|
|
31
|
+
**A full-coverage CLI for the Meilisearch REST API.** Every endpoint in the official OpenAPI spec, exposed as a flat command with typed flags.
|
|
32
|
+
|
|
33
|
+
Generated from [Meilisearch's official OpenAPI spec](https://github.com/meilisearch/open-api) using [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen).
|
|
34
|
+
|
|
35
|
+
## Why
|
|
36
|
+
|
|
37
|
+
Meilisearch has been asked for a CLI for years ([roadmap request](https://roadmap.meilisearch.com/c/136-meilisearch-command-line-interface-cli)). Meanwhile, users drop to `curl` for admin operations like managing indexes, API keys, tasks, and settings.
|
|
38
|
+
|
|
39
|
+
This CLI covers every endpoint in the REST API automatically — nothing to maintain, no features skipped. When Meilisearch updates their spec, a regeneration gets you the new commands.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pipx install meilisearch-rest-cli
|
|
45
|
+
|
|
46
|
+
# Or with uv
|
|
47
|
+
uv tool install meilisearch-rest-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
Point it at your Meilisearch instance:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
export MEILISEARCH_REST_CLI_BASE_URL=http://localhost:7700
|
|
56
|
+
|
|
57
|
+
# Or use the flag on every call (default is http://localhost:7700)
|
|
58
|
+
meilisearch-rest-cli Health get
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Common operations
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Server health + version
|
|
65
|
+
meilisearch-rest-cli Health get
|
|
66
|
+
meilisearch-rest-cli Version get
|
|
67
|
+
|
|
68
|
+
# List indexes
|
|
69
|
+
meilisearch-rest-cli Indexes list
|
|
70
|
+
|
|
71
|
+
# Create an index
|
|
72
|
+
meilisearch-rest-cli Indexes create-index --uid movies --primary-key id
|
|
73
|
+
|
|
74
|
+
# Stats (all indexes or per-index)
|
|
75
|
+
meilisearch-rest-cli Stats get
|
|
76
|
+
meilisearch-rest-cli Stats get-index --index-uid movies
|
|
77
|
+
|
|
78
|
+
# Tasks
|
|
79
|
+
meilisearch-rest-cli Tasks get-tasks --limit 10
|
|
80
|
+
meilisearch-rest-cli Tasks get-task --task-uid 42
|
|
81
|
+
|
|
82
|
+
# Delete an index
|
|
83
|
+
meilisearch-rest-cli Indexes delete-index --index-uid movies
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Authentication
|
|
87
|
+
|
|
88
|
+
If your Meilisearch instance uses an API key, set it via environment variable:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
export MEILISEARCH_REST_CLI_TOKEN=your-master-key
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The CLI will automatically send it as a Bearer token on every request.
|
|
95
|
+
|
|
96
|
+
### Discover all commands
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Top-level command groups
|
|
100
|
+
meilisearch-rest-cli --help
|
|
101
|
+
|
|
102
|
+
# Commands in a group
|
|
103
|
+
meilisearch-rest-cli Indexes --help
|
|
104
|
+
|
|
105
|
+
# Flags for a specific command
|
|
106
|
+
meilisearch-rest-cli Indexes create-index --help
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Output Formats
|
|
110
|
+
|
|
111
|
+
Every command accepts `--output-format`:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
meilisearch-rest-cli Indexes list --output-format json # default
|
|
115
|
+
meilisearch-rest-cli Indexes list --output-format table # rich table
|
|
116
|
+
meilisearch-rest-cli Indexes list --output-format yaml
|
|
117
|
+
meilisearch-rest-cli Indexes list --output-format raw
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Command Groups
|
|
121
|
+
|
|
122
|
+
| Group | Commands |
|
|
123
|
+
|---|---|
|
|
124
|
+
| Health | Server health check |
|
|
125
|
+
| Version | Server version info |
|
|
126
|
+
| Stats | Database + per-index stats |
|
|
127
|
+
| Indexes | CRUD for indexes |
|
|
128
|
+
| Documents | Add/update/delete documents, search |
|
|
129
|
+
| Settings | All index settings (filterable attrs, sortable attrs, etc.) |
|
|
130
|
+
| Tasks | List, query, cancel tasks |
|
|
131
|
+
| Keys | API key management |
|
|
132
|
+
| Batches | Batch operations |
|
|
133
|
+
| Snapshots | Create snapshots |
|
|
134
|
+
| Dumps | Create dumps |
|
|
135
|
+
| Experimental features | Enable/disable experimental features |
|
|
136
|
+
| Multi-search | Search multiple indexes in one request |
|
|
137
|
+
| Facet Search | Faceted search |
|
|
138
|
+
| Similar documents | Find similar documents |
|
|
139
|
+
| Logs | Configure and stream logs |
|
|
140
|
+
| Network | Remote instance config |
|
|
141
|
+
|
|
142
|
+
## Limitations
|
|
143
|
+
|
|
144
|
+
- **Complex request bodies**: Some endpoints with deeply nested `oneOf` / `anyOf` schemas accept a JSON string via the `--root` flag instead of individual fields. This is a current limitation of the underlying tool; most common operations use flat flags.
|
|
145
|
+
- **Document operations**: Uploading documents uses `--root` with a JSON array.
|
|
146
|
+
|
|
147
|
+
## How It Works
|
|
148
|
+
|
|
149
|
+
This package is a thin wrapper:
|
|
150
|
+
- Embeds the Meilisearch OpenAPI spec (`spec.yaml`)
|
|
151
|
+
- Delegates CLI generation to [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen) at runtime
|
|
152
|
+
- Pre-configures the base URL for local Meilisearch
|
|
153
|
+
|
|
154
|
+
If you want to generate a CLI for any other OpenAPI spec, check out [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen).
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT. Not affiliated with Meilisearch — this is an unofficial community CLI built on top of their public OpenAPI spec.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# meilisearch-rest-cli
|
|
2
|
+
|
|
3
|
+
**A full-coverage CLI for the Meilisearch REST API.** Every endpoint in the official OpenAPI spec, exposed as a flat command with typed flags.
|
|
4
|
+
|
|
5
|
+
Generated from [Meilisearch's official OpenAPI spec](https://github.com/meilisearch/open-api) using [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen).
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
Meilisearch has been asked for a CLI for years ([roadmap request](https://roadmap.meilisearch.com/c/136-meilisearch-command-line-interface-cli)). Meanwhile, users drop to `curl` for admin operations like managing indexes, API keys, tasks, and settings.
|
|
10
|
+
|
|
11
|
+
This CLI covers every endpoint in the REST API automatically — nothing to maintain, no features skipped. When Meilisearch updates their spec, a regeneration gets you the new commands.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pipx install meilisearch-rest-cli
|
|
17
|
+
|
|
18
|
+
# Or with uv
|
|
19
|
+
uv tool install meilisearch-rest-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
Point it at your Meilisearch instance:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
export MEILISEARCH_REST_CLI_BASE_URL=http://localhost:7700
|
|
28
|
+
|
|
29
|
+
# Or use the flag on every call (default is http://localhost:7700)
|
|
30
|
+
meilisearch-rest-cli Health get
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Common operations
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Server health + version
|
|
37
|
+
meilisearch-rest-cli Health get
|
|
38
|
+
meilisearch-rest-cli Version get
|
|
39
|
+
|
|
40
|
+
# List indexes
|
|
41
|
+
meilisearch-rest-cli Indexes list
|
|
42
|
+
|
|
43
|
+
# Create an index
|
|
44
|
+
meilisearch-rest-cli Indexes create-index --uid movies --primary-key id
|
|
45
|
+
|
|
46
|
+
# Stats (all indexes or per-index)
|
|
47
|
+
meilisearch-rest-cli Stats get
|
|
48
|
+
meilisearch-rest-cli Stats get-index --index-uid movies
|
|
49
|
+
|
|
50
|
+
# Tasks
|
|
51
|
+
meilisearch-rest-cli Tasks get-tasks --limit 10
|
|
52
|
+
meilisearch-rest-cli Tasks get-task --task-uid 42
|
|
53
|
+
|
|
54
|
+
# Delete an index
|
|
55
|
+
meilisearch-rest-cli Indexes delete-index --index-uid movies
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Authentication
|
|
59
|
+
|
|
60
|
+
If your Meilisearch instance uses an API key, set it via environment variable:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export MEILISEARCH_REST_CLI_TOKEN=your-master-key
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The CLI will automatically send it as a Bearer token on every request.
|
|
67
|
+
|
|
68
|
+
### Discover all commands
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Top-level command groups
|
|
72
|
+
meilisearch-rest-cli --help
|
|
73
|
+
|
|
74
|
+
# Commands in a group
|
|
75
|
+
meilisearch-rest-cli Indexes --help
|
|
76
|
+
|
|
77
|
+
# Flags for a specific command
|
|
78
|
+
meilisearch-rest-cli Indexes create-index --help
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Output Formats
|
|
82
|
+
|
|
83
|
+
Every command accepts `--output-format`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
meilisearch-rest-cli Indexes list --output-format json # default
|
|
87
|
+
meilisearch-rest-cli Indexes list --output-format table # rich table
|
|
88
|
+
meilisearch-rest-cli Indexes list --output-format yaml
|
|
89
|
+
meilisearch-rest-cli Indexes list --output-format raw
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Command Groups
|
|
93
|
+
|
|
94
|
+
| Group | Commands |
|
|
95
|
+
|---|---|
|
|
96
|
+
| Health | Server health check |
|
|
97
|
+
| Version | Server version info |
|
|
98
|
+
| Stats | Database + per-index stats |
|
|
99
|
+
| Indexes | CRUD for indexes |
|
|
100
|
+
| Documents | Add/update/delete documents, search |
|
|
101
|
+
| Settings | All index settings (filterable attrs, sortable attrs, etc.) |
|
|
102
|
+
| Tasks | List, query, cancel tasks |
|
|
103
|
+
| Keys | API key management |
|
|
104
|
+
| Batches | Batch operations |
|
|
105
|
+
| Snapshots | Create snapshots |
|
|
106
|
+
| Dumps | Create dumps |
|
|
107
|
+
| Experimental features | Enable/disable experimental features |
|
|
108
|
+
| Multi-search | Search multiple indexes in one request |
|
|
109
|
+
| Facet Search | Faceted search |
|
|
110
|
+
| Similar documents | Find similar documents |
|
|
111
|
+
| Logs | Configure and stream logs |
|
|
112
|
+
| Network | Remote instance config |
|
|
113
|
+
|
|
114
|
+
## Limitations
|
|
115
|
+
|
|
116
|
+
- **Complex request bodies**: Some endpoints with deeply nested `oneOf` / `anyOf` schemas accept a JSON string via the `--root` flag instead of individual fields. This is a current limitation of the underlying tool; most common operations use flat flags.
|
|
117
|
+
- **Document operations**: Uploading documents uses `--root` with a JSON array.
|
|
118
|
+
|
|
119
|
+
## How It Works
|
|
120
|
+
|
|
121
|
+
This package is a thin wrapper:
|
|
122
|
+
- Embeds the Meilisearch OpenAPI spec (`spec.yaml`)
|
|
123
|
+
- Delegates CLI generation to [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen) at runtime
|
|
124
|
+
- Pre-configures the base URL for local Meilisearch
|
|
125
|
+
|
|
126
|
+
If you want to generate a CLI for any other OpenAPI spec, check out [openapi-cli-gen](https://github.com/shivaam/openapi-cli-gen).
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT. Not affiliated with Meilisearch — this is an unofficial community CLI built on top of their public OpenAPI spec.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "meilisearch-rest-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A full-coverage CLI for the Meilisearch REST API, generated from the official OpenAPI spec"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "shivaam" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["meilisearch", "cli", "rest", "api", "search", "openapi"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Database",
|
|
26
|
+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
|
27
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
28
|
+
"Topic :: Utilities",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"openapi-cli-gen>=0.0.13",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
meilisearch-rest-cli = "meilisearch_rest_cli.cli:main"
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Homepage = "https://github.com/shivaam/meilisearch-rest-cli"
|
|
39
|
+
Repository = "https://github.com/shivaam/meilisearch-rest-cli"
|
|
40
|
+
Issues = "https://github.com/shivaam/meilisearch-rest-cli/issues"
|
|
41
|
+
"Meilisearch API docs" = "https://www.meilisearch.com/docs/reference/api/overview"
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.wheel]
|
|
44
|
+
packages = ["src/meilisearch_rest_cli"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""meilisearch-rest-cli CLI — generated by openapi-cli-gen."""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from openapi_cli_gen import build_cli
|
|
4
|
+
|
|
5
|
+
# Base URL: override via MEILISEARCH_REST_CLI_BASE_URL env var, fall back to spec default
|
|
6
|
+
_base_url = os.environ.get("MEILISEARCH_REST_CLI_BASE_URL") or "http://localhost:7700"
|
|
7
|
+
|
|
8
|
+
app = build_cli(
|
|
9
|
+
spec=Path(__file__).parent / "spec.yaml",
|
|
10
|
+
name="meilisearch-rest-cli",
|
|
11
|
+
base_url=_base_url,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main():
|
|
16
|
+
app()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
main()
|