文章总结: 本文介绍了OpenClaw这一开源AI助手网关的基础知识、核心架构及部署方法。作者通过实际操作演示了如何利用Kimi大模型一键接入飞书,并详细列出了OpenClaw的命令行功能,展示了其在连接AI模型与现实通讯工具方面的能力,为初学者提供了入门指南。
综合评分: 65
文章分类: AI安全,安全工具,其他
跟着OpenClaw学OpenClaw: 初识OpenClaw,你的AI助手基础设施
zyliang
zyliang
zyliang
2026年2月27日 20:12
北京
OpenClaw很火爆,学习记录下~
【项目地址】
https://github.com/openclaw/openclaw
【官方文档】
https://docs.openclaw.ai/
【关于部署】
除了官方的部署方式,国内很多AI大模型和云厂商也都推出了对应的云化产品,我使用的kimi接入的kimi-claw,小白部署,一键接入,需要开通kimi的Allegretto计划, 订阅费199/月。
【接入飞书】
参考如下文档顺利接入飞书
https://docs.openclaw.ai/channels/feishu
【关于使用】
接入后简单问了几个问题,一些日常工作感觉确实可以交给智能体来做,但也遇到了不少问题,使用体验没有想象中的好,涉及到一些专业知识,回答的也不好,毕竟是 beta版本,另外agent是需要一段时间训练和调教的,问题就先不记录了。
【openclaw学习】
想进一步了解下openclaw的架构和框架,因为使用了偷懒的一键部署,一时不知道从哪里开始,于是有了如下对话:
从格式就可以看出来,上面文字为手搓,下面的内容几乎全部为AI输出,除了实操的结果保真,其他俺也不知道真假,跟着学学看!
📌 导语
OpenClaw是一个开源的AI助手网关,让你能把各种AI能力接入到日常使用的通讯工具中。读完本文,你将了解它的核心架构,并完成基础环境的检查和配置查看。
前置要求:有一台Linux/macOS机器,已安装Node.js
📖 一、OpenClaw是什么?
1.1 一句话定义
OpenClaw是AI与现实世界的连接器——它让AI不仅能回答问题,还能操作你的系统、发送消息、执行定时任务。
1.2 类比理解
想象你是一个老板:
• AI模型 = 你的大脑(会思考)
• OpenClaw = 你的秘书+手机+日程表(能执行、能联络、能提醒)
• Channels = 各种通讯工具(微信、飞书、Tele )
• Skills = 各种专业技能(查天气、读PDF、写代码)
1.3 核心架构
🔧 二、动手检查你的环境
步骤1:确认OpenClaw已安装
执行命令: openclaw –version
root@iv-yeglp4e9kw5i3z4tce1x:~# openclaw --versionConfig warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)2026.2.25root@iv-yeglp4e9kw5i3z4tce1x:~#
执行命令: openclaw –help
root@iv-yeglp4e9kw5i3z4tce1x:~# openclaw --helpConfig warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
🦞 OpenClaw 2026.2.25 (4b5d4a4) — Your .env is showing; don't worry, I'll pretend I didn't see it.
Usage: openclaw [options] [command]
Options: --dev Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas) -h, --help Display help for command --log-level <level> Global log level override for file + console (silent|fatal|error|warn|info|debug|trace) --no-color Disable ANSI colors --profile <name> Use a named profile (isolates OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH under ~/.openclaw-<name>) -V, --version output the version number
Commands: Hint: commands suffixed with * have subcommands. Run <command> --help for details. acp * Agent Control Protocol tools agent Run one agent turn via the Gateway agents * Manage isolated agents (workspaces, auth, routing) approvals * Manage exec approvals (gateway or node host) browser * Manage OpenClaw's dedicated browser (Chrome/Chromium) channels * Manage connected chat channels (Telegram, Discord, etc.) clawbot * Legacy clawbot command aliases completion Generate shell completion script config * Non-interactive config helpers (get/set/unset). Default: starts setup wizard. configure Interactive setup wizard for credentials, channels, gateway, and agent defaults cron * Manage cron jobs via the Gateway scheduler daemon * Gateway service (legacy alias) dashboard Open the Control UI with your current token devices * Device pairing + token management directory * Lookup contact and group IDs (self, peers, groups) for supported chat channels dns * DNS helpers for wide-area discovery (Tailscale + CoreDNS) docs Search the live OpenClaw docs doctor Health checks + quick fixes for the gateway and channels gateway * Run, inspect, and query the WebSocket Gateway health Fetch health from the running gateway help Display help for command hooks * Manage internal agent hooks logs Tail gateway file logs via RPC memory * Search and reindex memory files message * Send, read, and manage messages models * Discover, scan, and configure models node * Run and manage the headless node host service nodes * Manage gateway-owned node pairing and node commands onboard Interactive onboarding wizard for gateway, workspace, and skills pairing * Secure DM pairing (approve inbound requests) plugins * Manage OpenClaw plugins and extensions qr Generate iOS pairing QR/setup code reset Reset local config/state (keeps the CLI installed) sandbox * Manage sandbox containers for agent isolation security * Security tools and local config audits sessions * List stored conversation sessions setup Initialize local config and agent workspace skills * List and inspect available skills status Show channel health and recent session recipients system * System events, heartbeat, and presence tui Open a terminal UI connected to the Gateway uninstall Uninstall the gateway service + local data (CLI remains) update * Update OpenClaw and inspect update channel status webhooks * Webhook helpers and integrations
Examples: openclaw models --help Show detailed help for the models command. openclaw channels login --verbose Link personal WhatsApp Web and show QR + connection logs. openclaw message send --target +15555550123 --message "Hi" --json Send via your web session and print JSON result. openclaw gateway --port 18789 Run the WebSocket Gateway locally. openclaw --dev gateway Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001. openclaw gateway --force Kill anything bound to the default gateway port, then start it. openclaw gateway ... Gateway control via WebSocket. openclaw agent --to +15555550123 --message "Run summary" --deliver Talk directly to the agent using the Gateway; optionally send the WhatsApp reply. openclaw message send --channel telegram --target @mychat --message "Hi" Send via your Telegram bot.
Docs: docs.openclaw.ai/cli
步骤2:查看系统状态
执行命令: openclaw status
root@iv-yeglp4e9kw5i3z4tce1x:~# openclaw statusConfig warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
🦞 OpenClaw 2026.2.25 (4b5d4a4) — Claws out, commit in—let's ship something mildly responsible.
09:00:44 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: kimi-claw (/root/.openclaw/extensions/kimi-claw/dist/index.js), dingtalk-connector (/root/.openclaw/extensions/dingtalk-connector/plugin.ts), feishu (/root/.openclaw/extensions/feishu/index.ts), kimi-search (/root/.openclaw/extensions/kimi-search/dist/index.js). Set plugins.allow to explicit trusted ids.09:00:44 [plugins] [DingTalk] 插件已注册(支持主动发送 AI Card 消息)Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)09:00:46 [plugins] feishu_doc: Registered feishu_doc, feishu_app_scopes09:00:46 [plugins] feishu_wiki: Registered feishu_wiki tool09:00:46 [plugins] feishu_drive: Registered feishu_drive tool09:00:46 [plugins] feishu_bitable: Registered 6 bitable tools09:00:46 [plugins] kimi-search: loaded without install/load-path provenance; treat as untracked local code and pin trust via plugins.allow or install records (/root/.openclaw/extensions/kimi-search/dist/index.js)│Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)◐ Checking for updates….Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)◑ Probing gateway….Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)◇ │◇ OpenClaw status
Overview┌─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐│ Item │ Value │├─────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤│ Dashboard │ http://127.0.0.1:18789/ ││ OS │ linux 6.8.0-55-generic (x64) · node 22.22.0 ││ Tailscale │ off ││ Channel │ stable (default) ││ Update │ available · pnpm · npm update 2026.2.26 ││ Gateway │ local · ws://127.0.0.1:18789 (local loopback) · reachable 25ms · auth token · iv-yeglp4e9kw5i3z4tce1x (10.59.60.148) app 2026.2.13 linux 6.8.0-55-generic ││ Gateway service │ systemd installed · enabled · running (pid 9281, state active) ││ Node service │ systemd not installed ││ Agents │ 1 · 1 bootstrap file present · sessions 167 · default main active 5m ago ││ Memory │ 0 files · 0 chunks · sources memory · plugin memory-core · vector unknown · fts ready · cache on (0) ││ Probes │ skipped (use --deep) ││ Events │ none ││ Heartbeat │ 30m (main) ││ Sessions │ 167 active · default k2p5 (262k ctx) · ~/.openclaw/agents/main/sessions/sessions.json │└─────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Security auditSummary: 0 critical · 6 warn · 1 info WARN Reverse proxy headers are not trusted gateway.bind is loopback and gateway.trustedProxies is empty. If you expose the Control UI through a reverse proxy, configure trusted proxies so local-client c… Fix: Set gateway.trustedProxies to your proxy IPs or keep the Control UI local-only. WARN Some gateway.nodes.denyCommands entries are ineffective gateway.nodes.denyCommands uses exact node command-name matching only (for example `system.run`), not shell-text filtering inside a command payload. - Unknown … Fix: Use exact command names (for example: canvas.present, canvas.hide, canvas.navigate, canvas.eval, canvas.snapshot, canvas.a2ui.push, canvas.a2ui.pushJSONL, canvas.a2ui.reset). If you need broader restrictions, remove risky command IDs from allowCommands/default workflows and tighten tools.exec policy. WARN Extensions exist but plugins.allow is not set Found 4 extension(s) under /root/.openclaw/extensions. Without plugins.allow, any discovered plugin id may load (depending on config and plugin behavior). Fix: Set plugins.allow to an explicit list of plugin ids you trust. WARN Extension plugin tools may be reachable under permissive tool policy Enabled extension plugins: dingtalk-connector, feishu, kimi-claw, kimi-search. Permissive tool policy contexts: - default Fix: Use restrictive profiles (`minimal`/`coding`) or explicit tool allowlists that exclude plugin tools for agents handling untrusted input. WARN Plugin installs include unpinned npm specs Unpinned plugin install records: - feishu (@m1heng-clawd/feishu) - dingtalk-connector (https://github.com/DingTalk-Real-AI/dingtalk-moltbot-connector) Fix: Pin install specs to exact versions (for example, `@scope/[email protected]`) for higher supply-chain stability. WARN Plugin installs are missing integrity metadata Plugin install records missing integrity: - feishu - dingtalk-connector Fix: Reinstall or update plugins to refresh install metadata with resolved integrity hashes.Full report: openclaw security auditDeep probe: openclaw security audit --deep
Channels┌──────────┬─────────┬────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐│ Channel │ Enabled │ State │ Detail │├──────────┼─────────┼────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤│ DingTalk │ ON │ SETUP │ not configured ││ Feishu │ ON │ OK │ configured │└──────────┴─────────┴────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Sessions┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────┬─────────┬──────────────┬──────────────────────────────────┐│ Key │ Kind │ Age │ Model │ Tokens │├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────┼─────────┼──────────────┼──────────────────────────────────┤│ agent:main:main │ direct │ 5m ago │ k2p5 │ 119k/262k (45%) · 🗄️ 199% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 196% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 195% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 14k/262k (5%) · 🗄️ 185% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 196% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 293% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 14k/262k (5%) · 🗄️ 278% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 14k/262k (5%) · 🗄️ 186% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 195% cached ││ agent:main:cron:e0f27b6d-f7fd-4… │ direct │ 1h ago │ k2p5 │ 13k/262k (5%) · 🗄️ 195% cached │└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────┴─────────┴──────────────┴──────────────────────────────────┘
FAQ: https://docs.openclaw.ai/faqTroubleshooting: https://docs.openclaw.ai/troubleshooting
Update available (npm 2026.2.26). Run: openclaw update
Next steps: Need to share? openclaw status --all Need to debug live? openclaw logs --follow Need to test channels? openclaw status --deep
执行命令: openclaw gateway status
root@iv-yeglp4e9kw5i3z4tce1x:~# openclaw gateway statusConfig warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)
🦞 OpenClaw 2026.2.25 (4b5d4a4) — OpenAI-compatible, not OpenAI-dependent.
│◇ Config warnings ─────────────────────────────────────────────────────────────────────────╮│ ││ - plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may ││ be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts) ││ │├───────────────────────────────────────────────────────────────────────────────────────────╯Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)│Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/usr/lib/node_modules/openclaw/extensions/feishu/index.ts)◇ Service: systemd (enabled)File logs: /tmp/openclaw/openclaw-2026-02-27.logCommand: /usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789Service file: ~/.config/systemd/user/openclaw-gateway.serviceService env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.jsonConfig (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)Probe target: ws://127.0.0.1:18789Dashboard: http://127.0.0.1:18789/Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 9281, state active, sub running, last exit 0, reason 0)RPC probe: ok
Listening: 127.0.0.1:18789Troubles: run openclaw statusTroubleshooting: https://docs.openclaw.ai/troubleshootingroot@iv-yeglp4e9kw5i3z4tce1x:~#
步骤3:探索安装目录
执行命令: ls /usr/lib/node_modules/openclaw/extensions/
root@iv-yeglp4e9kw5i3z4tce1x:~# ls /usr/lib/node_modules/openclaw/extensions/bluebubbles diagnostics-otel google-antigravity-auth imessage llm-task mattermost minimax-portal-auth nostr qwen-portal-auth slack telegram tlon whatsappcopilot-proxy discord googlechat irc lobster memory-core msteams open-prose shared synology-chat test-utils twitch zalodevice-pair feishu google-gemini-cli-auth line matrix memory-lancedb nextcloud-talk phone-control signal talk-voice thread-ownership voice-call zalouser
执行命令: ls /usr/lib/node_modules/openclaw/skills/
root@iv-yeglp4e9kw5i3z4tce1x:~# ls /usr/lib/node_modules/openclaw/skills/1password blogwatcher canvas eightctl github himalaya nano-banana-pro openai-image-gen oracle session-logs songsee things-mac voice-callapple-notes blucli clawhub gemini gog imsg nano-pdf openai-whisper ordercli sherpa-onnx-tts sonoscli tmux wacliapple-reminders bluebubbles coding-agent gh-issues goplaces mcporter notion openai-whisper-api peekaboo skill-creator spotify-player trello weatherbear-notes camsnap discord gifgrep healthcheck model-usage obsidian openhue sag slack summarize video-frames xurl
步骤4:查看你的配置
执行命令: cat ~/.openclaw/config.json | head -30
步骤5:查看工作区
执行命令: ls ~/.openclaw/workspace/
root@iv-yeglp4e9kw5i3z4tce1x:~# ls ~/.openclaw/workspace/AGENTS.md Bug_Analysis_Report.pptx generate_charts.py memory prisma-airs.html prisma-airs.mmd skills USER.mdBOOTSTRAP.md draw_mindmap.py HEARTBEAT.md ppt_content.txt prisma-airs-mindmap.md Prisma_AIRS_管理指南_中文版.docx SOUL.md 周报模板.mdbug_analysis_charts.png generate_bug_ppt.py IDENTITY.md ppt_optimization_plan.md prisma-airs-mindmap.png Prisma_AIRS_管理指南_中文版.md TOOLS.mdroot@iv-yeglp4e9kw5i3z4tce1x:~#
❓ 三、常见问题
问题1:command not found: openclaw 解决思路:检查是否全局安装,执行 npm list -g openclaw
root@iv-yeglp4e9kw5i3z4tce1x:~# npm list -g openclaw/usr/lib└── [email protected]
问题2:Gateway状态显示stopped 解决思路:尝试启动,执行 openclaw gateway start
问题3:配置文件不存在 解决思路:首次运行需要初始化配置
📝 四、小结与预告
本文要点:
OpenClaw是AI助手的基础设施,连接模型与现实世界
三大核心组件:Channels(通讯)、Skills(能力)、Cron(定时)
学会了检查安装状态、查看目录结构、浏览配置文件
下篇预告:《Gateway:整个系统的心脏》,将深入了解Gateway的生命周期管理,学会手动控制它的启动和停止。
免责声明:
本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。
任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。
本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我。
本文转载自:zyliang zyliang
zyliang《跟着OpenClaw学OpenClaw: 初识OpenClaw,你的AI助手基础设施》