# 运维速查 — Ops Quick Reference ## 飞书白名单管理 ```bash # 查看当前白名单 python3 -c " import json d = json.load(open('/root/.openclaw/openclaw.json')) print(d['channels']['feishu']['allowFrom']) " # 添加用户(需要 open_id) # 编辑 ~/.openclaw/openclaw.json → channels.feishu.allowFrom # 添加后无需重启,配置热加载生效 ``` ## Git 推送 ```bash cd /root/.openclaw/workspace git add -A git commit -m "更新说明" git push ``` ## 自动同步(每天 2:30 AM) - **脚本:** `/root/sync-xdespace.sh` - **日志:** `/root/xdespace-sync.log` - **定时:** crontab `30 2 * * *` - **功能:** 检测工作区变更 → 自动提交 → 推送远程 - **超时:** Git 操作超时 30 秒,超时或远程不响应则跳过 - **互斥锁:** 防止前一次未完成时重复运行 ## Ollama ```bash # 查看模型 ollama list # 拉取模型 ollama pull <模型名> # 推理测试 ollama run qwen2.5:7b "你好" ``` ## MemOS Local(记忆服务) - **API:** `http://127.0.0.1:18799` - **Swagger 文档:** 浏览器打开 `http://127.0.0.1:18799` - **服务管理:** `systemctl {status|start|stop|restart} memos-local` - **日志:** `journalctl -u memos-local --no-pager -n 50` ### 小德用的 CLI 封装 ```bash # 添加记忆 memos.sh add "文本内容" [user_id] # 搜索记忆 memos.sh search "查询关键字" [user_id] [top_k] # 对话(带记忆上下文) memos.sh chat "消息" [user_id] # 统计 memos.sh stats [user_id] # 健康检查 memos.sh health ``` ## 系统维护 ```bash # Gateway 状态 openclaw gateway status # 查看日志(飞书/网关) journalctl -u openclaw --no-pager -n 50 # MemOS Local 日志 journalctl -u memos-local --no-pager -n 50 # 查看 MemOS 端口 ss -tlnp | grep 18799 ```