Skip to main content

A full-coverage CLI for the Qdrant vector database REST API, generated from the official OpenAPI spec

Project description

qdrant-rest-cli

A full-coverage CLI for the Qdrant vector database REST API. Every endpoint in Qdrant's OpenAPI spec, exposed as a typed command. Generated from Qdrant's official OpenAPI spec using openapi-cli-gen.

Why

Qdrant ships excellent client SDKs (Python, Rust, Go, JS), but no REST CLI. For shell scripting, Makefile targets, CI pipelines, and interactive ad-hoc queries, most people drop to raw curl and hand-build JSON payloads.

This CLI gives you the entire Qdrant REST API as flat shell commands with typed flags — collections, points, search, snapshots, distributed cluster ops — without writing any Python or curl boilerplate. When Qdrant adds endpoints, a regeneration picks them up.

Install

pipx install qdrant-rest-cli

# Or with uv
uv tool install qdrant-rest-cli

Setup

Point it at your Qdrant instance (default is http://localhost:6333):

export QDRANT_REST_CLI_BASE_URL=http://localhost:6333

If your instance uses an API key:

export QDRANT_REST_CLI_API_KEY=your-api-key

The CLI sends it as the api-key header automatically, matching Qdrant's security scheme.

Quick Start

All commands below have been verified against a live Qdrant instance.

# Server health
qdrant-rest-cli service root
qdrant-rest-cli service healthz

# List collections
qdrant-rest-cli collections get-collections

# Create a collection (4-dim vectors, cosine distance)
qdrant-rest-cli collections create \
  --collection-name pets \
  --vectors '{"size": 4, "distance": "Cosine"}'

# Upsert points with payloads (use --root for the full JSON request body)
qdrant-rest-cli points upsert --collection-name pets --root '{
  "points": [
    {"id": 1, "vector": [0.9, 0.1, 0.1, 0.1], "payload": {"name": "cat",  "species": "mammal"}},
    {"id": 2, "vector": [0.1, 0.9, 0.1, 0.1], "payload": {"name": "dog",  "species": "mammal"}},
    {"id": 3, "vector": [0.1, 0.1, 0.9, 0.1], "payload": {"name": "bird", "species": "avian"}}
  ]
}'

# Count points
qdrant-rest-cli points count --collection-name pets

# Semantic search — return results WITH their payloads
qdrant-rest-cli search points \
  --collection-name pets \
  --vector '[0.85, 0.15, 0.1, 0.1]' \
  --limit 2 \
  --with-payload true

# Scroll through all points
qdrant-rest-cli points scroll --collection-name pets --limit 10

# Get a collection's info
qdrant-rest-cli collections get-collection --collection-name pets

# Delete the collection
qdrant-rest-cli collections delete --collection-name pets

Discover All Commands

# Top-level groups
qdrant-rest-cli --help

# Commands in a group
qdrant-rest-cli collections --help

# Flags for a specific command
qdrant-rest-cli search points --help

Output Formats

Every command accepts --output-format:

qdrant-rest-cli collections get-collections --output-format table
qdrant-rest-cli collections get-collections --output-format yaml
qdrant-rest-cli collections get-collections --output-format raw

Command Groups

Group What it covers
service Server root, health (healthz, livez, readyz), telemetry, metrics
collections Full CRUD for collections + optimizations
aliases Collection aliases
points Upsert, get, delete, scroll, count, batch operations, payload/vector updates, facets
search Query points, batch search, recommend, discover, point groups, matrices
snapshots Create / list / delete / restore snapshots (collection + shard level)
distributed Cluster status, peer management, shard keys
indexes Payload index create/delete
beta Issue tracking for the running instance

Passing Complex JSON Bodies

Most Qdrant write endpoints take deeply nested request bodies (lists of points, complex filters, hybrid queries). For these, pass the entire body as a JSON string via --root:

qdrant-rest-cli points upsert --collection-name pets --root '{"points":[...]}'

qdrant-rest-cli search points --collection-name pets --root '{
  "vector": [0.85, 0.15, 0.1, 0.1],
  "limit": 5,
  "with_payload": true,
  "filter": {"must": [{"key": "species", "match": {"value": "mammal"}}]}
}'

Flat endpoints (like collections create) accept typed flags directly — use whichever is clearer for a given call.

Real Example: End-to-End Vector Search

$ qdrant-rest-cli collections create \
    --collection-name movies \
    --vectors '{"size": 4, "distance": "Cosine"}'
{"result": true, "status": "ok", "time": 0.012}

$ qdrant-rest-cli points upsert --collection-name movies --root '{
    "points": [
      {"id": 1, "vector": [0.9, 0.1, 0.1, 0.1], "payload": {"title": "The Matrix"}},
      {"id": 2, "vector": [0.1, 0.9, 0.1, 0.1], "payload": {"title": "Titanic"}}
    ]
  }'
{"result": {"operation_id": 0, "status": "completed"}, "status": "ok"}

$ qdrant-rest-cli search points --collection-name movies \
    --vector '[0.85, 0.15, 0.1, 0.1]' \
    --limit 2 \
    --with-payload true
{
  "result": [
    {"id": 1, "score": 0.998, "payload": {"title": "The Matrix"}},
    {"id": 2, "score": 0.299, "payload": {"title": "Titanic"}}
  ],
  "status": "ok"
}

How It Works

This package is a thin wrapper:

  • Embeds the Qdrant OpenAPI spec (spec.yaml)
  • Delegates CLI generation to openapi-cli-gen at runtime
  • Default base URL: http://localhost:6333

Since it's spec-driven, new Qdrant endpoints show up automatically on regeneration — no manual wrapping to fall behind.

License

MIT. Not affiliated with Qdrant — 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

qdrant_rest_cli-0.1.1.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

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

qdrant_rest_cli-0.1.1-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

Details for the file qdrant_rest_cli-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for qdrant_rest_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7caa8f52cb1d57da52ab94413530814fd05e1c3311958cad1e5edfb44b5be6af
MD5 0d299a157f369ff5f0a7da47f0e909be
BLAKE2b-256 29042a84654eaf39e59e631c782d2a28ca220f92ee969977aed2671844009f79

See more details on using hashes here.

File details

Details for the file qdrant_rest_cli-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qdrant_rest_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84ff4ff4abe6886c42a481157d584b7b241f5d50a45ddda2843d3722a7ba5719
MD5 bfbaf947e426bf5cacf31d58a882fbeb
BLAKE2b-256 f8d722fa9ea74c3afa6c6c31a508bcf1ea0a9a5cf964bc3fca4c822b42464017

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