Chroma CLI 还提供了很多有用的命令,下面简单介绍:
Commands:
browse Browse Chroma collections
浏览 Chroma 集合
copy Copy collection between local and Chroma Cloud
在本地与 Chroma Cloud 之间复制集合
db Manage Chroma Cloud databases
管理 Chroma Cloud 数据库
docs Open Chroma online documentation
打开 Chroma 在线文档
install Install sample applications
安装示例应用
login Log in to Chroma Cloud
登录 Chroma Cloud
profile Manage Chroma Cloud profiles
管理 Chroma Cloud 配置档案
run Start a local Chroma server
启动本地 Chroma 服务
support Open the Chroma Discord
打开 Chroma Discord 社区
update Check for Chroma CLI updates
检查 Chroma CLI 更新
vacuum Vacuum a local Chroma persistent directory
对本地 Chroma 持久化目录执行清理压缩
help Print this message or the help of the given subcommand(s)
打印帮助信息或指定子命令的帮助chroma browse --path ./chroma_data不用写代码就能看集合列表和数据,排查问题的时候很方便。
Vacuum a local Chroma persistent directory
清理本地 Chroma 持久化目录(回收磁盘空间、清理冗余数据)
Usage: chroma vacuum [OPTIONS]
用法:chroma vacuum [选项]
Options:
--path <PATH> The path of your Chroma DB
Chroma 数据库路径
--force Skip vacuum confirmation
跳过清理确认提示
--timeout <TIMEOUT> Maximum time (in seconds) to wait for vacuum
清理操作最长等待时间(单位:秒)chroma vacuum --path ./chroma_data --force --timeout 60执行效果:
root@localhost:/data/chroma# chroma vacuum --path /data/chroma --force --timeout 60
/usr/lib/python3/dist-packages/requests/__init__.py:87: RequestsDependencyWarning: urllib3 (2.8.0) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Chroma Vacuum
Purging the log...
Vacuuming (this may take a while)...
🧼 Vacuum complete!
Database size reduced by 4.0KiB (⬇️0%)作用类似于 SQLite 的 VACUUM:清理删除留下的空洞、整理 WAL、缩小文件。建议:
大量删除之后跑一次
做备份之前跑一次(保证一致性)
它会请求独占锁,跑的时候别有服务在写
更多命令自行尝试。