Skip to main content

A full-coverage CLI for the Meilisearch REST API, generated from the official OpenAPI spec

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

meilisearch_rest_cli-0.1.2.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

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

meilisearch_rest_cli-0.1.2-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

Details for the file meilisearch_rest_cli-0.1.2.tar.gz.

File metadata

  • Download URL: meilisearch_rest_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for meilisearch_rest_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2377ced841857b8b7fa772bf41094d63a02b8ea8556f66a0373fb485bafd96e7
MD5 dcfd26eff6bd35a1ca27fd5c966a4181
BLAKE2b-256 6fa3c137a2c80a2e4ce17d0191f8e00540c13f69212bc213c16c6cd793e33227

See more details on using hashes here.

File details

Details for the file meilisearch_rest_cli-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for meilisearch_rest_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63425a3f30583790425696af62c7cef78f9972fb5c86fc1b93e57fa75e8318ae
MD5 43eee19b90b089b6352d72d8510bf1d5
BLAKE2b-256 71900ea1dafbaf103089c1a1a672da6cd9f30b5818b5f2aea50e137c1d13da7e

See more details on using hashes here.

Supported by

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