The official Meilisearch CLI — a single Rust binary that covers everything from day-to-day instance management to advanced data operations, with an interactive TUI mode for search, chat, and settings.
| Interactive Search | Interactive Chat |
![]() |
![]() |
| Settings Overview | Settings Editor |
![]() |
![]() |
# Quick install (latest release)
curl -fsSL https://raw.githubusercontent.com/meilisearch/meilisearch-cli/main/install.sh | sh
# Install a specific version
curl -fsSL https://raw.githubusercontent.com/meilisearch/meilisearch-cli/main/install.sh | sh -s -- v0.1.0
# Custom install directory
INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/meilisearch/meilisearch-cli/main/install.sh | sh
# From source
cargo install --path .The binary is named msc (short for Meilisearch CLI):
msc --help# Check server health
msc health
# Create an index and import data
msc index create movies --primary-key id
msc import movies --file movies.json
# Search
msc search movies "gatsby"
# Interactive search TUI
msc search movies -iThe CLI supports multiple Meilisearch instances through named projects stored in ~/.config/msc/config.toml.
# Add a remote project
msc project add production --url https://my-instance.meilisearch.io --api-key masterKey123
# Switch default project
msc project use production
# List all projects
msc project list
# Target a specific project for one command
msc --project staging health
# Or skip the config file entirely
msc --url http://localhost:7700 --api-key masterKey123 healthmsc index list
msc index create <uid> [--primary-key <key>]
msc index get <uid>
msc index delete <uid>
msc index stats <uid>
msc index swap <index-a> <index-b>msc document add <uid> --file <path>
msc document add <uid> < data.json # stdin
msc document get <uid> <id>
msc document list <uid> [--limit 20]
msc document delete <uid> <id>
msc document delete-all <uid>msc search <uid> <query> [--filter <expr>] [--facets <...>] [--limit <n>]
msc search <uid> -i # interactive TUImsc settings get <uid>
msc settings update <uid> --file settings.json
msc settings reset <uid>
msc settings edit <uid> # opens $EDITOR
msc settings edit <uid> -i # interactive TUI
msc settings edit <uid> synonyms # edit sub-resource in $EDITOR
msc settings diff <uid>msc task list [--status <status>] [--type <type>]
msc task get <id>
msc task cancel <uids>
msc task delete <uids>
msc task wait <id> [--timeout 60000]
msc task watch <id>msc key list
msc key get <key>
msc key create --actions search --indexes movies
msc key delete <key>msc import <uid> --file data.json
msc import <uid> --file data.ndjson --batch-size 10485760
msc import <uid> --file data.csv
msc import <uid> < stdin.ndjsonmsc clone <source-uid> <dest-uid>
msc clone <source-uid> <dest-uid> --from production --to stagingmsc promote --from local --to production
msc promote --from local --to staging --indexes products,categories
msc promote --from local --to production --dry-runmsc local start # Docker preferred, binary fallback
msc local stop
msc local restart
msc local status
msc local logs [-f]
msc local reset # wipe data, restart fresh
msc local upgrade # upgrade to latest versionmsc dump create
msc dump snapshotmsc chat "What products do you have?"
msc chat -i # interactive TUImsc health
msc version
msc statsmsc search movies "query" # pretty-printed JSON in a terminal
msc search movies "query" | jq .hits # compact JSON automatically when piped
msc --json search movies "query" # force compact JSON (alias: --raw)
msc --pretty index list | less # force human output when piped
msc search movies "query" --select id,title # keep only these fields
msc --quiet import movies --file m.json # no status messages on stderrResults go to stdout; status messages and errors go to stderr. Set NO_COLOR to disable colors.
msc is designed to be driven by programs as well as people:
- JSON by default when piped. When stdout is not a terminal, every command prints compact JSON on stdout, and failures print a JSON error on stderr:
{"error": {"kind", "code", "message", "exitCode", "hint", …}}. - Meaningful exit codes.
0ok,1error,2usage,3auth,4not found,5API error,6network,7task failed,8timeout. --waiton any write returns the finished task instead of ataskUid, and exits7if the task failed.--selectkeeps only the fields you need (--select uid,error.code).--dry-runpreviews destructive changes (index/document/key/task deletes, settings update and reset, clone, promote, local reset);--if-exists/--if-not-existsmake creates and deletes safe to retry.- No prompts without a terminal. Commands that would prompt or open a TUI fail fast with exit code
2and a hint. - Environment config:
MSC_URL,MSC_API_KEY,MSC_PROJECT,MSC_WAIT,MSC_CONFIG. msc schemaprints every command and argument as JSON.msc whoamishows which server and key are used, where they came from, and whether they work.msc api <METHOD> <PATH>calls any route with the same auth, errors and--wait;search --body '<json>'passes any search parameter.msc mcpruns an MCP server exposing every command as a tool:claude mcp add meilisearch -- msc mcp.msc skill installinstalls the bundled agent skill into~/.claude/skills(or--localfor one repository). Or install everything, the skill plus the MCP server, as a Claude Code plugin:/plugin marketplace add meilisearch/meilisearch-clithen/plugin install meilisearch-cli@meilisearch.
export MSC_URL=http://localhost:7700
msc index create movies --primary-key id --if-not-exists --wait
msc import movies --file movies.ndjson
msc search movies "dune" --select id,title --limit 5See the agent guide and the output & exit codes reference.
Config file: ~/.config/msc/config.toml
Migration note: users upgrading from earlier versions (when the binary was named
meilisearch) will have their existing config at~/.config/meilisearch/config.tomlautomatically migrated to the new location on first run.
default = "local"
[projects.local]
type = "local"
url = "http://127.0.0.1:7700"
[projects.production]
url = "https://my-instance.meilisearch.io"
api_key = "masterKey123"# Build
cargo build
# Run tests (integration tests target MSC_TEST_URL, default http://localhost:7700,
# and use an isolated config file, so your projects are never touched)
cargo test
MSC_TEST_URL=http://localhost:7799 cargo test
# Lint
cargo clippy --all-targets -- -D warnings
cargo fmt --checkMIT



