SuperAPI AI 工具集

setup-synclaw

部署与运维

查看项目

更新于 10-16 00:02

技能介绍

用途:从零安装并运行 SyncClaw,适用于用户提出 setup synclaw、install synclaw、deploy synclaw、init synclaw 等需求时。

前置条件:Node.js 20+、Git;OpenClaw Gateway 实例为可选项,仅在需要智能体执行时使用。

快速安装:运行内置脚本 bash scripts/setup.sh --gateway-url ws://localhost:18789 --gateway-token YOUR_TOKEN。可用选项包括 --dir <path>(克隆的父目录,默认当前目录)、--gateway-url <url>(Gateway WebSocket 端点,默认 ws://localhost:18789)、--gateway-token <token>(Gateway 认证令牌)。脚本会克隆仓库、安装依赖、配置 .env、初始化 SQLite 数据库、执行生产构建,并全局安装 synclaw CLI。

手动安装:依次执行 git clone https://github.com/lxcong/synclaw.git && cd synclaw、npm install、cp .env.example .env(编辑填入 Gateway URL 与令牌)、npm run db:generate、npm run db:push、npm run db:seed(可选,示例数据)、npm run build、npm install -g synclaw。

环境变量:DATABASE_URL(SQLite 路径,默认 file:./dev.db)、OPENCLAW_GATEWAY_URL(默认 ws://localhost:18789)、OPENCLAW_GATEWAY_TOKEN(无默认值)。

CLI 用法:在项目目录中执行 synclaw start [-p port] [-H host] [-d dev] 启动服务;synclaw stop [-t timeout] 停止;synclaw restart 重启;synclaw status 查看 PID、运行时长与 Gateway 状态;synclaw logs [-f] [-n lines] 查看或跟踪日志。

验证:进入 synclaw 目录后执行 synclaw start,再用 synclaw status 确认显示 Running 及 PID 与端口,curl localhost:3000 应返回 HTML,最后可用 synclaw stop 停止。

限制:资料未提供系统兼容性、权限要求、端口冲突处理、生产部署方式及故障排查细节。