[Feature]: Add `knowhere` CLI with TUI and JSON headless modes
Problem statement
To use Knowhere today, every team must write their own HTTP client, async polling loop and result download logic.
Without an official CLI, users repeatedly reimplement:
- Submitting jobs and waiting for long-running parses.
- Downloading and unpacking result ZIPs.
- Inspecting and understanding the Knowhere output format.
Affected area
Other
Proposed solution
Provide an official knowhere CLI that wraps the existing API and supports two modes:
-
TUI / human-friendly mode (default):
Rich terminal output with progress, colors and concise hints. -
JSON headless mode (
--json):
Machine-friendly output: stdout contains only valid JSON (including errors), with no extra text. Suitable for scripts, CI and AI agents.
Proposed commands:
-
knowhere ingest
Submit parsing jobs for one or more documents.
Options:--wait(block until completed),--no-wait,--name.
UsesPOST /v1/jobsunder the hood. -
knowhere status
Show status and progress for a givenjob_id.
Wrapper overGET /v1/jobs/{id}. -
knowhere download
Download the result package for a job and unpack to a target directory (e.g.chunks.json,images/,tables/). -
knowhere inspect
Inspect a local result directory: sample chunks, field structure, basic counts. Local-only. -
knowhere get-hierarchy
Print the document hierarchy tree derived from the Knowhere result (tree view in TUI, JSON in--jsonmode). -
knowhere retrieve
Run Agentic Retrieval over a parsed result directory given a text query, returning ranked hits with hierarchy paths. -
knowhere read-chunks
Read and filter raw chunks from a result directory (by type, path, etc.), useful for debugging and custom indexing.
Authentication:
- Use
KNOWHERE_API_KEYenvironment variable (and document this clearly) so users can call the CLI from any project without repeating configuration.
Alternatives considered
No response
Compatibility and migration notes
No response
Additional context
No response