Full-coverage CLI for the Meilisearch REST API
Project description
meilisearch-rest-cli
A full-coverage CLI for the Meilisearch REST API. Every endpoint in the official OpenAPI spec, exposed as a flat command with typed flags.
Generated from Meilisearch's official OpenAPI spec using openapi-cli-gen.
Why
Meilisearch has been asked for a CLI for years (roadmap request). Meanwhile, users drop to curl for admin operations like managing indexes, API keys, tasks, and settings.
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.
Install
pipx install meilisearch-rest-cli
# Or with uv
uv tool install meilisearch-rest-cli
Setup
Point it at your Meilisearch instance (default is http://localhost:7700):
export MEILISEARCH_REST_CLI_BASE_URL=http://localhost:7700
Authentication
If your Meilisearch instance uses an API key, set it via environment variable:
export MEILISEARCH_REST_CLI_TOKEN=your-master-key
The CLI will automatically send it as a Bearer token on every request.
Quick Start
All commands below have been verified against a live Meilisearch 1.41 instance.
# Server health + version
meilisearch-rest-cli health get
meilisearch-rest-cli version get
# List all indexes
meilisearch-rest-cli indexes list
# Create an index
meilisearch-rest-cli indexes create-index --uid movies --primary-key id
# Add documents (use --root — document bodies are user-defined, no typed flags)
meilisearch-rest-cli documents replace --index-uid movies --root '[
{"id": 1, "title": "The Matrix", "year": 1999},
{"id": 2, "title": "Inception", "year": 2010},
{"id": 3, "title": "Titanic", "year": 1997}
]'
# Check task status (writes are async; watch for `succeeded` and indexedDocuments)
meilisearch-rest-cli tasks get-tasks --limit 3
# Search — use --root to pass a raw SearchQuery JSON, which dodges the upstream
# snake_case/camelCase field-name mismatch in Meilisearch's own OpenAPI spec
meilisearch-rest-cli indexes search-with-post --index-uid movies --root '{
"q": "matrix",
"limit": 5
}'
# Stats
meilisearch-rest-cli stats get
meilisearch-rest-cli stats get-index --index-uid movies
# Delete the index
meilisearch-rest-cli indexes delete-index --index-uid movies
A note on --root for searches
Meilisearch's official OpenAPI spec declares SearchQuery field names in snake_case (retrieve_vectors, hits_per_page, attributes_to_retrieve...) but the Meilisearch server actually expects camelCase on the wire (retrieveVectors, hitsPerPage, attributesToRetrieve). This is an upstream spec bug — not specific to this CLI.
The --root flag lets you bypass that mismatch entirely: pass a camelCase JSON payload that matches the actual server API, and the CLI sends it verbatim:
meilisearch-rest-cli indexes search-with-post --index-uid movies --root '{
"q": "matrix",
"limit": 10,
"offset": 0,
"attributesToRetrieve": ["title", "year"],
"showRankingScore": true
}'
Once Meilisearch fixes their spec, the typed flags will work too. Until then, use --root for searches.
Discover All Commands
# Top-level groups
meilisearch-rest-cli --help
# Commands in a group
meilisearch-rest-cli indexes --help
# Flags for a specific command
meilisearch-rest-cli indexes create-index --help
Output Formats
Every command accepts --output-format:
meilisearch-rest-cli indexes list --output-format table
meilisearch-rest-cli indexes list --output-format yaml
meilisearch-rest-cli indexes list --output-format raw
Command Groups
| Group | What it covers |
|---|---|
health |
Server health check |
version |
Server version info |
stats |
Database + per-index stats + metrics |
indexes |
CRUD for indexes + search-with-post / search-with-url-query / swap |
documents |
Add / update / replace / delete / query / get documents |
settings |
All index settings (70+ commands: facet-search, embedders, synonyms, stop-words, ranking-rules, proximity-precision, prefix-search, filterable/sortable/searchable attributes, etc.) |
tasks |
List, query, cancel, delete tasks |
batches |
Batch info |
keys |
API key management |
snapshots |
Create snapshots |
dumps |
Create dumps |
experimental-features |
Enable / disable experimental features |
multi-search |
Search multiple indexes in one request |
facet-search |
Faceted search |
similar-documents |
Find similar documents (semantic) |
logs |
Configure and stream logs |
network |
Remote instance network config |
How It Works
This package is a thin wrapper:
- Embeds the Meilisearch OpenAPI spec (
spec.yaml) - Delegates CLI generation to openapi-cli-gen at runtime
- Pre-configures the base URL for local Meilisearch
If you want to generate a CLI for any other OpenAPI spec, check out openapi-cli-gen.
License
MIT. Not affiliated with Meilisearch — this is an unofficial community CLI built on top of their public OpenAPI spec.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meilisearch_rest_cli-0.1.3.tar.gz.
File metadata
- Download URL: meilisearch_rest_cli-0.1.3.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
753e8ee2d9f864811fe8b56790b40ec785f6b6e983cde5e21ad946e4178c956f
|
|
| MD5 |
e8cc502aad1270932fd47946214de174
|
|
| BLAKE2b-256 |
8012f4dfa48ae0231edb5a33daa0363314c713749b740ba5720ca488be7c4cf5
|
File details
Details for the file meilisearch_rest_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: meilisearch_rest_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
820de7ede592b2c18d4e92aa1afb2fd122decfd828a0440aa2b16701210b3ff2
|
|
| MD5 |
d6b3c07142e0be7ed2dc532b1ceb99f2
|
|
| BLAKE2b-256 |
e842ee0438ab41684e3f545733d77a3c2f2f0652443b1a19ddca208ed3539968
|