meili is the official command line tool for Meilisearch. It talks to any Meilisearch instance, local or remote, and to Meilisearch Cloud.
It is built for coding agents first: no prompts, structured output, stable errors and exit codes, and a meili schema command that describes the whole CLI in one call.
Status: work in progress. The command tree and contracts are defined in
docs/, the implementation has not started yet. Nothing is published on npm for now.
Once released, the package will be @meilisearch/cli on npm and the binary meili.
npm install -g @meilisearch/cliRequires Node 22 or newer.
export MEILI_URL=http://localhost:7700
export MEILI_API_KEY=masterKey
meili health
meili index create movies --primary-key id --wait
meili document add movies --file movies.json --wait
meili search movies "batman" --limit 5
meili settings update movies filterable-attributes --data '["genres"]' --waitEvery command prints JSON when stdout is not a terminal, and a table when it is. Force a mode with --output json|ndjson|table.
meili health | version | stats
meili index list | get | create | update | delete | swap | stats
meili document list | get | add | update | delete | delete-all
meili search <index> [query]
meili multi-search | facet-search | similar
meili settings get | update | reset
meili task list | get | wait | cancel | delete
meili batch list | get
meili key list | get | create | update | delete
meili dump create | meili snapshot create
meili context list | add | use | current | remove
meili cloud login | logout | whoami | org | project | billing | region | plan
meili schema | docs | completions <shell>
The full list, with the API route behind each command, lives in docs/contract/commands.md.
Connection settings resolve in this order: flags (--url, --api-key), environment variables (MEILI_URL, MEILI_API_KEY), then a named context from the config file.
Contexts let you switch between instances:
meili context add prod --url https://ms-abc123.fra.meilisearch.io --api-key ...
meili context use prod
meili context currentSee docs/contract/config.md for every environment variable and the config file format.
- Data goes to stdout, everything else goes to stderr.
- API responses are returned as they are, never wrapped.
- Errors are JSON objects with a stable
code, and exit codes have fixed meanings (seedocs/contract/output.md). - No interactive prompt when stdin is not a TTY. Destructive commands need
--yes. meili schemaprints every command, argument and flag as JSON.meili docsprints a compact agent guide.
docs/contract/: what the CLI promises (commands, output, config)docs/adr/: why we decided what we decidedCLAUDE.md: maintainer guide for humans and coding agents
Read CONTRIBUTING.md, then CLAUDE.md. One command per pull request, and pnpm lint, pnpm typecheck, pnpm test must pass.