OmniClaw is an "active" intelligent application gateway supporting multi-channel access. It acts as a bridge between various Instant Messaging (IM) platforms and powerful AI execution engines.
The core philosophy of OmniClaw is "Configure once, run anywhere"โletting AI return to its essence as a tool while providing a unified gateway for interaction.
Inspired by paperclipai/paperclip, opencode, and openclaw.
- ๐๏ธ Architecture
- ๐ Core Features
- ๐ Quick Start
- ๐ ๏ธ Advanced Features
- ๐ Directory Structure
- ๐ก๏ธ Security & Privacy
- ๐ฏ Roadmap
graph LR
%% Main Flow
subgraph IM ["Gateways (IM Platforms)"]
direction TB
FS[Feishu / Lark]
WC[WeChat]
TG[Telegram]
TM[Terminal]
end
subgraph Core ["OmniClaw Core (Orchestrator)"]
direction TB
Brain{{"Brain (Context Manager)"}}
HB([Heartbeat Engine])
Logic[("Identity & Memory<br/>SOUL.md / MEMORY.md")]
end
subgraph AI ["Executors (Pluggable AI)"]
direction TB
OC[Opencode]
CC[Claude Code]
EXT["Custom Adapters"]
end
subgraph Target ["World (Execution)"]
direction TB
SysFS[[File System]]
Shell[[CLI / Shell]]
Web[[External APIs]]
end
%% Connections
IM <--> Brain
HB -.-> Brain
Brain <--> Logic
Brain <--> AI
AI <--> Target
%% Styling
style Brain fill:#f9f,stroke:#333,stroke-width:2px
style Logic fill:#e1f5fe,stroke:#01579b
style HB fill:#fff9c4,stroke:#fbc02d
Message Processing Flow:
User Message โ IM Gateway โ OmniClaw Brain โ AI Executor โ Target Environment
- Input: User sends a request (via Feishu/WeChat/TG/Terminal).
- Orchestration:
Brainloads context,SOUL, andAGENTSrules. - Execution:
AI Executor(Opencode/Claude) performs CLI tasks. - Feedback: Results are logged in
MEMORYand sent back to theUser.
OmniClaw decouples interaction from logic. Connect your AI to any platform with a single configuration:
- ๐ข Feishu/Lark: Enterprise-grade bot integration. Supports interactive cards (Card Schema 2.0), rich text rendering, smart image compression, and "thinking" indicators.
- ๐ฌ WeChat: Personal/Group chat integration using Wechaty.
- ๐ฎ Telegram: Full bot integration via Long Polling (no public HTTPS or webhook setup required). Supports text, images, files, MarkdownโHTML auto-conversion, message chunking, and "โณ processing" indicators.
- ๐ป Terminal: Direct CLI interaction for local development.
OmniClaw is designed to be AI framework agnostic. The underlying "Brain" can be swapped with different executors by setting a single environment variable:
| Executor | Mechanism | Best For |
|---|---|---|
opencode |
Spawns opencode serve as a local REST server; sessions are persistent |
Complex CLI automation, long-running tasks |
claude |
Runs claude --print โฆ --output-format stream-json; sessions maintained via --resume |
High-reasoning development, quick Q&A |
Custom Adapters: Implement the BaseExecutor abstract class in src/executor/ to bridge any other AI framework.
Unlike traditional "passive-response" bots, OmniClaw features a built-in heartbeat system. It "wakes up" autonomously to monitor builds, crawl data, or generate reports, proactively notifying you on your preferred IM channel.
Maintain a consistent AI persona across all platforms:
SOUL.md: Your AI's character, values, and communicative style.AGENTS.md: Task-specific rules and tool usage protocols.MEMORY.md: Shared long-term memory across sessions and platforms.- Search & Deduplication: Built-in fingerprinting to prevent message redelivery; automated Daily Logs for easy session auditing.
- Node.js (v18+ recommended)
- At least one AI executor installed:
- opencode (default): Install from opencode.ai, verify with
opencode --version - Claude Code: Install from claude.ai/code, verify with
claude --version
- opencode (default): Install from opencode.ai, verify with
Copy .env.example and fill in your API keys:
cp .env.example .envKey configurations:
| Variable | Description | Default |
|---|---|---|
EXECUTOR |
AI backend: opencode or claude |
opencode |
FEISHU_APP_ID |
Feishu bot App ID | โ |
FEISHU_APP_SECRET |
Feishu bot App Secret | โ |
TELEGRAM_BOT_TOKEN |
Telegram bot token (from @BotFather) | โ |
TRIGGER_PORT |
Port for the Trigger HTTP API | 3099 |
- Open Telegram and chat with @BotFather.
- Send
/newbotand follow the prompts (choose a name and username). - Copy the token (format:
7xxxxxxxxxx:AAFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) into your.env:TELEGRAM_BOT_TOKEN=7xxxxxxxxxx:AAFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - OmniClaw uses Long Polling โ no public HTTPS endpoint or webhook registration is needed. Just run and it works.
Scheduled task receivers for Telegram: use
"type": "chat_id"with the numeric chat/group ID (e.g."id": "123456789"). You can get your chat ID by messaging @userinfobot.
Set EXECUTOR in your .env to choose the AI backend:
# Use opencode (default, requires opencode installed)
EXECUTOR=opencode
# Use Claude Code CLI (requires claude installed and authenticated)
EXECUTOR=claude
# Use Claude Code at a custom binary path
EXECUTOR=claude:/usr/local/bin/claude-
Install Dependencies:
npm install
-
Development Mode: Start directly with
ts-node(built-inTerminalGateway):npm run dev
-
Production Mode:
npm run build npm start
- Persistent Sessions: Both executors maintain session context across messages โ
opencodevia headless REST sessions,claudevia--resume <session-id>. - Trigger API: POST endpoints to immediately trigger AI tasks from external webhooks.
Place .json config files in the schedules/ directory. OmniClaw supports Hot-Reloading, meaning changes take effect immediately without restarting.
Feishu:
{
"id": "daily_report",
"cron": "0 9 * * *",
"gateway": "feishu",
"receiver": {
"type": "chat_id",
"id": "oc_xxxxxxxxxxxxxxxx"
},
"prompt": "Please summarize yesterday's project progress and list today's to-do items."
}Telegram:
{
"id": "daily_report",
"cron": "0 9 * * *",
"gateway": "telegram",
"receiver": {
"type": "chat_id",
"id": "123456789"
},
"prompt": "Please summarize yesterday's project progress and list today's to-do items."
}- Supports Cron expressions.
- Specify target Gateways (
feishu,telegram,terminal) and receivers (chat_id/user_id).
Built-in management commands to control the system bypass the AI:
/cmd <command>: Run arbitrary shell command on the server and return output./build: Trigger project build (npm run build)./restart: Rebuild and then self-respawn the OmniClaw process./log [lines]: Tail the last N lines (default 100) of the execution log./help: Display the list of available commands and usage guide.
omniclaw/
โโโ src/
โ โโโ gateway/ # IM Adapters (Feishu, WeChat, TG, etc.)
โ โโโ executor/ # Opencode/CLI child process management
โ โโโ engine/ # Core logic (Brain, Heartbeat, Memory)
โ โโโ index.ts # Entry point
โโโ schedules/ # Cron task configurations (JSON)
โโโ memory/ # Daily conversation and task logs
โโโ SOUL.md # Soul/Personality definition
โโโ AGENTS.md # Behavioral guidelines/Tool specs
โโโ package.json # Dependencies & scripts
- Credential Isolation: All sensitive keys should be stored in the
.envfile orsecrets/directory. The project includes a.gitignoreto prevent these files from being committed. - Local Logs:
logs/andmemory/directories are stored locally only, used to maintain persistent AI memory and for debugging. - Open Source Tip: If you plan to clone and redistribute this project, ensure you remove sensitive information from the
.githistory if it was ever accidentally committed.
- Memory Enhancement: Implement vector-based long-term memory and RAG (Retrieval-Augmented Generation) for deeper project context.
- OpenClaw Gateway Support: Full compatibility with the OpenClaw protocol to enable cross-agent communication (A2A).
- Plugin Ecosystem: Support for third-party tools and custom IM adapters.
ISC License. Built for autonomous productivity.