密钥位置

/home/ubuntu/.openclaw/agents/main/agent

会话

会话的目录和密钥位置的目录位于同一目录下,具体如下所示:

1
2
3
4
5
6
7
8
9
ubuntu@VM-0-6-ubuntu:~/.openclaw/agents/main$ tree
.
├── agent
│ ├── auth-profiles.json
│ └── models.json
└── sessions
├── 018a193b-2c91-4979-93f7-4920571a44fa.jsonl.deleted.2026-03-04T13-38-32.193Z
├── 01facb05-abde-4fb4-b38f-ab57ea3a7e86.jsonl
├── 048df74e-0eff-4388-9cd9-673af088659b.jsonl

常用命令

1
2
3
4
5
6
# 展示当前的版本
ubuntu@VM-0-6-ubuntu:~$ openclaw -v
2026.3.1
ubuntu@VM-0-6-ubuntu:~$
# 更新 openclaw 为新版本
ubuntu@VM-0-6-ubuntu:~$ npm install -g openclaw

卸载

  • 步骤 1:停止 openclaw gateway 服务
1
2
3
4
# 停止 gateway
openclaw gateway stop
# 检查状态
openclaw gateway status
  • 步骤 2:官方卸载命令
1
openclaw uninstall
  • 步骤 3:移除全局 CLI 包
1
npm rm -g openclaw

如果你用的是 pnpm 或 bun,对应换成:

1
2
3
pnpm rm -g openclaw
# 或者
bun rm -g openclaw
  • 步骤 4:检查残留
1
2
3
4
5
6
7
8
# 检查全局包
npm list -g openclaw

# 检查目录
ls ~/.openclaw/

# 检查端口占用
lsof -i:18789

飞书插件指南

1
2
# 展示所有的插件
openclaw plugins list

参考文档:飞书 IM 插件

gateway 生命周期管理

启动

1
openclaw gateway start
  • 加载 openclaw.json 配置
  • 扫描并加载插件
  • 初始化 IM 通道(连接飞书、企微等)
  • 启动 HTTP 服务监听端口
  • 写入 pid 文件

检查 gateway 状态

1
openclaw gateway status

会显示:

  • 运行状态(running / stopped)
  • 进程 ID
  • 监听端口
  • 已加载的插件数量

停止 Gateway

1
openclaw gateway stop

如果 Gateway 卡住,可以强制停止:

1
openclaw gateway stop --force

重启 gateway

修改配置后需要重启:

1
openclaw gateway restart

常见问题

端口被占用

1
lsof -i :18789

插件有问题

1
2
3
4
# 卸载
openclaw plugins uninstall @openclaw/feishu-plugin
# 安装
openclaw plugins install @openclaw/feishu-plugin