cli-anything-chromadb

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-anything-chromadb

cli-anything-chromadb

A stateless command-line interface for ChromaDB vector database, built on the HTTP API v2. Designed for AI agents and power users who need to manage collections, documents, and run semantic queries without a browser UI.
这是一款基于HTTP API v2构建的ChromaDB向量数据库无状态命令行界面,专为AI Agent和高级用户设计,无需浏览器UI即可管理集合、文档并运行语义查询。

Installation

安装

This CLI is installed as part of the cli-anything-chromadb package:
bash
pip install cli-anything-chromadb
Prerequisites:
  • Python 3.10+
  • ChromaDB server running at localhost:8000 (or specify via --host)
本CLI作为cli-anything-chromadb包的一部分进行安装:
bash
pip install cli-anything-chromadb
前置要求:
  • Python 3.10及以上版本
  • ChromaDB服务器运行在localhost:8000(或通过--host参数指定其他地址)

Usage

使用方法

Basic Commands

基础命令

bash
undefined
bash
undefined

Show help

显示帮助信息

cli-anything-chromadb --help
cli-anything-chromadb --help

Start interactive REPL mode

启动交互式REPL模式

cli-anything-chromadb
cli-anything-chromadb

Check server health

检查服务器健康状态

cli-anything-chromadb --json server heartbeat
cli-anything-chromadb --json server heartbeat

List all collections

列出所有集合

cli-anything-chromadb --json collection list
cli-anything-chromadb --json collection list

Semantic search

语义搜索

cli-anything-chromadb --json query search --collection hub_knowledge --text "How to deploy"
undefined
cli-anything-chromadb --json query search --collection hub_knowledge --text "How to deploy"
undefined

REPL Mode

REPL模式

When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-chromadb
当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-chromadb

Enter commands interactively with tab-completion and history

可通过交互式方式输入命令,支持自动补全和历史记录

undefined
undefined

Command Groups

命令组

server

server

Server health and version commands.
CommandDescription
heartbeat
Check ChromaDB server health
version
Get ChromaDB server version
服务器健康状态和版本相关命令。
命令描述
heartbeat
检查ChromaDB服务器健康状态
version
获取ChromaDB服务器版本

collection

collection

Manage ChromaDB collections.
CommandDescription
list
List all collections
create --name NAME
Create a new collection
delete --name NAME
Delete a collection
info NAME
Get collection info
管理ChromaDB集合。
命令描述
list
列出所有集合
create --name NAME
创建新集合
delete --name NAME
删除集合
info NAME
获取集合信息

document

document

Manage documents in collections.
CommandDescription
add --collection C --id ID --document TEXT
Add document(s)
get --collection C
Get documents
delete --collection C --id ID
Delete document(s)
count --collection C
Count documents
管理集合中的文档。
命令描述
add --collection C --id ID --document TEXT
添加文档
get --collection C
获取文档
delete --collection C --id ID
删除文档
count --collection C
统计文档数量

query

query

Semantic search against collections.
CommandDescription
search --collection C --text T
Semantic search
针对集合进行语义搜索。
命令描述
search --collection C --text T
语义搜索

Output Formats

输出格式

All commands support dual output modes:
  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (
    --json
    flag): Structured JSON for agent consumption
bash
undefined
所有命令支持两种输出模式:
  • 人类可读格式(默认):表格、彩色文本、格式化内容
  • 机器可读格式
    --json
    参数):结构化JSON,供Agent使用
bash
undefined

Human output

人类可读输出

cli-anything-chromadb server heartbeat
cli-anything-chromadb server heartbeat

JSON output for agents

供Agent使用的JSON输出

cli-anything-chromadb --json server heartbeat
undefined
cli-anything-chromadb --json server heartbeat
undefined

For AI Agents

面向AI Agent的使用说明

When using this CLI programmatically:
  1. Always use
    --json
    flag
    for parseable output
  2. Check return codes - 0 for success, non-zero for errors
  3. Parse stderr for error messages on failure
  4. Use
    --host
    to connect to non-default ChromaDB instances
以编程方式使用本CLI时:
  1. 始终使用
    --json
    参数
    以获得可解析的输出
  2. 检查返回码——0表示成功,非0表示错误
  3. 解析stderr以获取失败时的错误信息
  4. 使用
    --host
    参数
    连接到非默认的ChromaDB实例

Version

版本

1.0.0
1.0.0