clawbot-codie-channel
v1.0.0
Published
Code27 Codie channel plugin for Clawbot - bidirectional AI communication
Downloads
80
Maintainers
Readme
@openclaw/code27
OpenClaw channel plugin for Code27 - bidirectional communication with AI backend service.
English
Overview
The Code27 channel plugin enables OpenClaw to communicate with the Code27 AI backend service via WebSocket. It provides:
- OAuth 2.0 / PKCE Authentication: Secure SSO-based authentication flow
- Machine Management: Select and manage multiple machines
- Real-time Communication: WebSocket-based bidirectional messaging
- Command Execution: Execute shell commands on the client from the backend
Installation
cd ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/extensions
npm install /path/to/code27-extensionOr globally:
npm install -g /path/to/code27-extensionConfiguration
The plugin can be configured via environment variables or OpenClaw config:
Environment Variables
# Override AI Service URL
export SYBRAN_AI_SERVICE_URL="https://ai-ability.prod.code27.co"
# Override SSO URL
export SYBRAN_SSO_URL="https://account.code27.co"
# Override Backend URL
export SYBRAN_BACKEND_URL="https://codie-backend.prod.code27.co"
# Override OAuth Client ID
export SYBRAN_CLIENT_ID="codie-extension-main"Configuration via OpenClaw Config
{
"channels": {
"code27": {
"enabled": true,
"backendUrl": "https://codie-backend.prod.code27.co",
"ssoUrl": "https://account.code27.co",
"aiServiceUrl": "https://ai-ability.prod.code27.co",
"clientId": "codie-extension-main",
"machineSni": "your-machine-identifier"
}
}
}Setup
Step 1: Enable the Plugin
openclaw plugins enable code27
openclaw gateway restartStep 2: Configure the Channel
Run the OpenClaw configuration wizard:
openclaw configureSelect Code27 from the channel list and follow the prompts:
- SSO Authorization: An OAuth URL will be displayed. Open it in your browser to authenticate.
- Callback: After authentication, the callback will complete automatically (if using SSH port forwarding).
- Select Machine: Choose from your available machines.
Usage
Sending Messages
openclaw message send --channel code27 --to <user-id> "Hello from Code27!"Checking Status
openclaw channels status
openclaw plugins info code27Data Flow
┌─────────────┐ WebSocket ┌──────────────┐
│ OpenClaw │ ◄────────────────────────────► │ Code27 Backend│
│ Gateway │ bidirectional messaging │ AI Service │
└─────────────┘ └──────────────┘
│ │
▼ ▼
┌─────────────┐ ┌──────────────┐
│ Agents │ │ Machines │
│ (LLM, etc) │ │ (Workers) │
└─────────────┘ └──────────────┘Development
Local Testing
# Build the plugin
npm run build
# Run local test (requires valid tokens)
npm run test:localProject Structure
src/
├── channel.ts # Channel plugin implementation
├── client.ts # WebSocket client
├── auth.ts # OAuth authentication service
├── config.ts # Configuration management
├── runtime.ts # Plugin runtime interface
└── run_local.ts # Local test runner中文
概述
Code27 channel 插件使 OpenClaw 能够通过 WebSocket 与 Code27 AI 后端服务进行双向通信。主要功能包括:
- OAuth 2.0 / PKCE 认证:基于 SSO 的安全认证流程
- 机器管理:选择和管理多个机器
- 实时通信:基于 WebSocket 的双向消息传递
- 命令执行:从后端在客户端执行 shell 命令
安装
cd ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/extensions
npm install /path/to/code27-extension或全局安装:
npm install -g /path/to/code27-extension配置
插件可通过环境变量或 OpenClaw 配置进行设置:
环境变量
# 覆盖 AI 服务 URL
export SYBRAN_AI_SERVICE_URL="https://ai-ability.prod.code27.co"
# 覆盖 SSO URL
export SYBRAN_SSO_URL="https://account.code27.co"
# 覆盖后端 URL
export SYBRAN_BACKEND_URL="https://codie-backend.prod.code27.co"
# 覆盖 OAuth 客户端 ID
export SYBRAN_CLIENT_ID="codie-extension-main"通过 OpenClaw 配置
{
"channels": {
"code27": {
"enabled": true,
"backendUrl": "https://codie-backend.prod.code27.co",
"ssoUrl": "https://account.code27.co",
"aiServiceUrl": "https://ai-ability.prod.code27.co",
"clientId": "codie-extension-main",
"machineSni": "your-machine-identifier"
}
}
}设置
步骤 1: 启用插件
openclaw plugins enable code27
openclaw gateway restart步骤 2: 配置 Channel
运行 OpenClaw 配置向导:
openclaw configure从频道列表中选择 Code27 并按照提示操作:
- SSO 授权:显示 OAuth URL,在浏览器中打开进行认证
- 回调:认证完成后,回调将自动完成(如果使用 SSH 端口转发)
- 选择机器:从可用机器中选择一个
使用
发送消息
openclaw message send --channel code27 --to <user-id> "来自 Code27 的问候!"检查状态
openclaw channels status
openclaw plugins info code27数据流向
┌─────────────┐ WebSocket ┌──────────────┐
│ OpenClaw │ ◄────────────────────────────► │ Code27 Backend│
│ Gateway │ 双向消息传递 │ AI 服务 │
└─────────────┘ └──────────────┘
│ │
▼ ▼
┌─────────────┐ ┌──────────────┐
│ Agent │ │ 机器 │
│ (LLM 等) │ │ (工作节点) │
└─────────────┘ └──────────────┘开发
本地测试
# 构建插件
npm run build
# 运行本地测试(需要有效的 token)
npm run test:local项目结构
src/
├── channel.ts # Channel 插件实现
├── client.ts # WebSocket 客户端
├── auth.ts # OAuth 认证服务
├── config.ts # 配置管理
├── runtime.ts # 插件运行时接口
└── run_local.ts # 本地测试运行器License
ISC
