用途:通过官方 chatwoot CLI 检查与操作 Chatwoot 客服平台数据,覆盖会话、消息、联系人、收件箱、标签、团队、帮助中心文章、Webhook 等对象。
规则与前提:必须使用官方 CLI,若缺失或未认证,应先停止并引导完成安装与认证,不要用原始 REST、Rails runner、数据库查询或容器访问绕过,除非用户明确要求备选方案。自托管部署需准备 Base URL(如 https://chatwoot.example.com)和 Account ID(仪表盘 URL 中的数字)。API 访问令牌不得写入技能文件、文档、shell 历史或最终答案。
安装与认证:检测命令 command -v chatwoot && chatwoot --version;缺失时安装 curl -fsSL https://chwt.app/install-cli | sh;随后 chatwoot --version、chatwoot auth login。登录需填写 Base URL、API Key(个人访问令牌)和 Account ID。配置持久化中,非密钥配置在 ~/.chatwoot/config.yaml,API key 存于系统钥匙串;无头或 CI 可用 CHATWOOT_API_KEY 覆盖。可用 chatwoot auth status、chatwoot config path、chatwoot config view 检查。注意 chatwoot 为客服 API CLI,区别于管理服务器运维的 cwctl。
常用工作流:chatwoot convs 列出会话,可加 --assignee all --inbox 5、--query "refund";chatwoot conv 123 查看;chatwoot conv 123 reply "..." 回复,加 --private 转为私密备注;resolve/open/pending 改状态;assign --agent me 或 --team 7 分配;label billing,urgent 打标签;priority urgent 改优先级。另有 chatwoot inboxes、agents、labels、teams、me。自动化可用 -o json 或 -q;noun 命令未覆盖时用 chatwoot api 路径,如 chatwoot api /conversations/123 或 chatwoot api -X PATCH /conversations/123 --data '{"status":"open"}',该路径会展开在 /api/v1/accounts/<account_id> 下。
客服反馈场景:用 chatwoot convs -o json 或 chatwoot api 获取候选会话,优先活跃/近期会话;客户消息为 incoming,客服回复为 outgoing,私密备注不算客户反馈;精确日期过滤可用 chatwoot api 的 /conversations/filter。需要命令语法、安装细节或 API 覆盖范围时,阅读 references/cli.md。
限制:资料未提供 CLI 版本要求、配额、收费及各端点完整支持范围。