Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a4169ac83 | ||
|
|
4fd70438b8 | ||
|
|
1680834ab2 | ||
|
|
b0c707b74a | ||
|
|
6fe2e2bd3a | ||
|
|
cedade141b | ||
|
|
154b863f78 | ||
|
|
07d816053f | ||
|
|
6346ea2748 | ||
|
|
69269963d0 | ||
|
|
c6150d117b | ||
|
|
8eb9801f0f | ||
|
|
1f5f92ba36 | ||
|
|
c8629f8670 | ||
|
|
e2f4e88a7a | ||
|
|
089ff8986a | ||
|
|
d57d26471f |
@@ -1,7 +1,239 @@
|
||||
# OpenClaw Manager — 开发日志
|
||||
|
||||
> 最后更新:2026-02-25
|
||||
> 当前版本:v0.5.2
|
||||
> 最后更新:2026-02-27
|
||||
> 当前版本:v0.7.1
|
||||
|
||||
---
|
||||
|
||||
## v0.7.1 更新日志(2026-02-27)
|
||||
|
||||
### New Features
|
||||
|
||||
**Dashboard Guidance Block (Telegram-first usage + safety)**
|
||||
- Added a concise guidance card under Dashboard explaining OCM's intended Telegram workflow
|
||||
- Clarifies prerequisites: users should already have basic OpenClaw CLI experience
|
||||
- Clarifies purpose: OCM mainly helps visualize and update `openclaw.json` for easier main-agent/sub-agent management and multi-tree structures
|
||||
- Added explicit Telegram security checklist:
|
||||
- BotFather `Allow Groups = ON`
|
||||
- BotFather `Group Privacy = OFF`
|
||||
- Keep each group private (only you + agent/sub-agents), do not invite others
|
||||
|
||||
### Improvements
|
||||
|
||||
**Model Dropdown Source — only `openclaw models list`**
|
||||
- Model dropdown options are now sourced from real CLI output (`openclaw models list`) instead of built-in/static lists or config-only additions
|
||||
- Applies to all relevant selectors: agent/sub-agent creation forms, agent inline model switcher, primary model selector, and fallback picker
|
||||
- Added warning message when model list loading/parsing fails
|
||||
|
||||
### Technical Notes
|
||||
|
||||
- Added model ID parser for CLI output and short-term cache for model list fetches
|
||||
- `GET /api/models` now returns:
|
||||
- `knownModels` from CLI
|
||||
- `modelListError` for UI warning display
|
||||
- Startup script banners updated to `v0.7.1` (`start.sh` / `start.bat`)
|
||||
|
||||
---
|
||||
|
||||
## v0.7.0 更新日志(2026-02-27)
|
||||
|
||||
### New Features
|
||||
|
||||
**Dashboard Redesign — Circular Gauge System Health**
|
||||
- CPU%, RAM%, DISK% displayed as SVG circular gauges with colour-coded arcs (green < 70%, amber < 90%, red ≥ 90%)
|
||||
- System info card: hostname, OS, Node.js, CPU model, cores, uptime, load average (1/5/15 min)
|
||||
- Agent overview: separate main agent count and sub-agent count (plus total)
|
||||
- Auto-refresh toggle: when enabled, dashboard polls `/api/dashboard` every 10 seconds
|
||||
- Backend now measures CPU usage via `os.cpus()` delta sampling (200ms interval) and returns `loadAvg` from `os.loadavg()`
|
||||
|
||||
**Sub-Agent Creation Flow — Step-by-Step Guide Rewrite**
|
||||
- Expanded from 3 steps to 5 detailed steps covering the full BotFather → Telegram Group → OCM workflow
|
||||
- Step 1: Create new Bot via `/newbot` in BotFather
|
||||
- Step 2: Disable Group Privacy via `/mybots` → Bot Settings → Group Privacy → Turn off
|
||||
- Step 3: Create Telegram group, add Bot (with security warning)
|
||||
- Step 4: Get Group ID from gateway logs
|
||||
- Step 5: Fill in the form
|
||||
- New "Your Telegram User ID" input field — auto-writes to `channels.telegram.allowFrom` whitelist on creation
|
||||
- Security warning banner: "Do NOT add other people to this group" with explanation about API cost risks
|
||||
|
||||
**Setup Page — English Localization**
|
||||
- All Chinese text in the initial directory selection page translated to English
|
||||
- Includes: title, description, labels, placeholders, error messages, button text
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
**Agent tree: sub-agents not grouped under main (old config format)**
|
||||
- **Symptom**: On machines with openclaw.json created before OCM v0.6 multi-bot support, all sub-agents displayed as independent cards instead of nested under main
|
||||
- **Root cause**: Old-format bindings lack `accountId` field in sub-agent entries. The tree builder relied on `parentAccountId` to match sub-agents to roots, but old bindings only had `channel` + `peer` — no `accountId`. So `parentAccountId` was null and no parent match was found
|
||||
- **Fix**: Fallback inference — if a sub-agent has a peer binding but no `accountId`, automatically infer `parentAccountId` from main's binding (`accountId`) or fall back to `'default'`
|
||||
|
||||
### Technical Notes
|
||||
|
||||
- **CPU usage measurement:** Two `os.cpus()` snapshots 200ms apart, calculating idle-to-total ratio across all cores
|
||||
- **Gauge rendering:** Pure SVG arcs with `stroke-dasharray` animation, no external libraries. 270° arc (gap at bottom), colour transitions via `gaugeColor()` function
|
||||
- **allowFrom auto-config:** `POST /api/agents` now accepts optional `telegramUserId` field (numeric string), appends to `channels.telegram.allowFrom[]` if not already present
|
||||
- **Old-config compatibility:** Sub-agent bindings without `accountId` are now auto-assigned to the main agent's bot, maintaining backward compatibility with configs created before multi-bot support
|
||||
|
||||
---
|
||||
|
||||
## v0.6.6 更新日志(2026-02-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
**Agent tree: main agent not detected as root**
|
||||
- **Symptom**: Sub-agents displayed as independent agents instead of under their parent. All agents appeared as orphan roots.
|
||||
- **Root cause**: `main` agent in OpenClaw is the default catch-all and typically has NO explicit binding in `openclaw.json`. The `hasOwnBot` detection required an explicit binding with `accountId && !peer`, so `main` was classified as a non-root. Without `main` being a root, sub-agents' `parentAccountId` had no matching root to link to.
|
||||
- **Fix**:
|
||||
- `main` is now always treated as a root agent regardless of binding existence
|
||||
- `main`'s `accountId` is inferred from `channels.telegram.accounts`: first unclaimed account (not explicitly bound to another agent), or first account as fallback
|
||||
- Sub-agents with `parentAccountId` matching `main`'s inferred `accountId` now correctly appear under `main` in the tree
|
||||
|
||||
---
|
||||
|
||||
## v0.6.5 更新日志(2026-02-26)
|
||||
|
||||
### New Features
|
||||
|
||||
**Dashboard Tab (🏠 Dashboard)**
|
||||
- New default landing tab showing system overview at a glance
|
||||
- **System card**: hostname, OS, Node.js version, CPU model/cores, uptime, memory usage with progress bar
|
||||
- **Gateway card**: process status indicator (running/stopped/unknown) with coloured dot, port, PID, HTTP ping reachability
|
||||
- **Agents card**: total agent count, last session activity timestamp (Brisbane time), OCM version, server time
|
||||
- **Storage card**: OpenClaw dir size, disk usage with progress bar, free space
|
||||
- New `GET /api/dashboard` endpoint aggregates all info (ps grep + curl ping + fs stat)
|
||||
- Lazy-loaded on tab switch; auto-loaded on first page load
|
||||
|
||||
**Cache-Control + Version-Based Cache Busting**
|
||||
- All HTTP responses now include `Cache-Control: no-store, no-cache, must-revalidate`
|
||||
- HTML responses include `ETag: "ocm-<version>"` for version-based cache validation
|
||||
- All responses include `X-OCM-Version` header
|
||||
- Browser `api()` function checks `X-OCM-Version` against client version; shows toast notification when server has been updated, prompting user to refresh
|
||||
- Prevents stale frontend from calling deleted/changed API endpoints after update
|
||||
|
||||
### Cleanup
|
||||
|
||||
**Old `/api/agents/main` endpoint fully removed** (confirmed via code search — no residual references)
|
||||
|
||||
### Technical Notes
|
||||
|
||||
- Dashboard gateway detection: `ps aux | grep openclaw.*gateway` for process status, `curl --max-time 2 http://127.0.0.1:<port>` for HTTP ping
|
||||
- Disk usage: `df -k` for filesystem stats, `du -sk` for OpenClaw dir size
|
||||
- Agent last activity: scans `~/.openclaw/agents/*/sessions/*.jsonl` mtime
|
||||
- Version cache busting: `OCM_CLIENT_VERSION` is injected into browser script via template literal `${APP_VERSION}`, compared against `X-OCM-Version` response header on every API call
|
||||
|
||||
---
|
||||
|
||||
## v0.6.0 更新日志(2026-02-26)
|
||||
|
||||
### 重大 Bug 修复
|
||||
|
||||
**Add Agent 覆盖已有 Bot Token(数据破坏性 Bug)**
|
||||
- **症状**:通过 Add Agent 表单添加新 agent 时,直接覆盖 `channels.telegram.botToken`,导致所有已有 agent(包括 sub-agent)全部失效
|
||||
- **根本原因**:`POST /api/agents/main` 端点无条件覆盖 `channels.telegram.botToken` 字段,没有保护已有配置
|
||||
- **修复**:
|
||||
- 彻底删除 `POST /api/agents/main` 端点
|
||||
- 新建 `POST /api/agents/bot` 端点,使用 OpenClaw 的 `channels.telegram.accounts` 多 bot 结构
|
||||
- 每个新 agent 获得独立的 `accountId` 和 `botToken`,绝不覆盖已有 token
|
||||
- 自动迁移:首次添加新 bot 时,自动将旧格式(顶层 `botToken`)迁移到 `accounts.default`
|
||||
- **数据恢复**:程序在修改前自动创建 `openclaw.json.create.*` 备份,可通过 `cp` 恢复
|
||||
|
||||
**浏览器 Popover API 命名冲突**
|
||||
- **症状**:点击 "+ Add Agent" / "+ Add Sub-Agent" 按钮报错 `NotSupportedError: Failed to execute 'togglePopover' on 'HTMLElement'`
|
||||
- **根本原因**:自定义函数 `togglePopover()` 与浏览器原生 Popover API 的 `HTMLElement.togglePopover()` 方法冲突
|
||||
- **修复**:函数重命名为 `showConfigPop()`
|
||||
|
||||
### 架构变更
|
||||
|
||||
**多 Bot 支持(Multi-Account)**
|
||||
- 支持 OpenClaw 的 `channels.telegram.accounts` 结构,每个主 agent 可绑定独立的 Telegram bot
|
||||
- 配置格式:
|
||||
```json
|
||||
{
|
||||
"channels": { "telegram": { "accounts": {
|
||||
"default": { "botToken": "TOKEN_A" },
|
||||
"research": { "botToken": "TOKEN_B" }
|
||||
}}}
|
||||
}
|
||||
```
|
||||
- `GET /api/agents` 返回 `hasOwnBot` 字段,标识 agent 是否拥有独立 bot
|
||||
- Sub-Agent 表单新增 "Parent Agent" 下拉,选择共享哪个 bot(不再硬编码 "main")
|
||||
|
||||
**去除 Landing Page,直接进入主程序**
|
||||
- 移除模式选择首页(Sub-agent / Multi-agent 二选一)
|
||||
- 启动后直接进入 Agent 管理页面
|
||||
- 移除 landing page 相关 HTML、CSS、JS、i18n keys
|
||||
|
||||
**Agent 页面重设计(popover 配置窗口)**
|
||||
- 不再使用左右分屏布局
|
||||
- "+ Add Agent" / "+ Add Sub-Agent" 按钮居中显示在 agent 树上方
|
||||
- 点击按钮弹出浮动配置窗口(popover),包含引导步骤和表单
|
||||
- Agent 树宽度限制 720px 居中,多个 agent 树纵向排列
|
||||
|
||||
### 功能改进
|
||||
|
||||
**Stats 重写 — 从 session JSONL 文件解析真实用量**
|
||||
- 不再从 `gateway.log` 解析(之前一直是 0 数据)
|
||||
- 改为扫描 `~/.openclaw/agents/*/sessions/*.jsonl`
|
||||
- 解析 `type: "message"` + `role: "assistant"` 的 `message.usage` 字段
|
||||
- 新增维度:By Agent(每个 agent 的用量)、Cache Read tokens
|
||||
- 测试验证:成功解析出 990 条请求、6 个 agent、10 个模型的真实数据
|
||||
|
||||
**Model 下拉 — 只显示已注册模型**
|
||||
- 不再使用硬编码的 KNOWN_MODELS 列表
|
||||
- 改为从 `openclaw.json` 的 `agents.defaults.models` 读取实际注册的模型
|
||||
|
||||
**Agent 树事件委托**
|
||||
- `renderAgents()` 中的按钮不再使用 `onclick="func('escaped-string')"` 内联写法
|
||||
- 改用 `data-action` / `data-id` 属性 + 事件委托(`agentTreeAction`),避免 template literal 转义问题
|
||||
|
||||
**响应式布局**
|
||||
- `main` 容器改为 `max-width:100%`,适配不同屏幕宽度
|
||||
- 新增 `@media (max-width: 600px)` 断点:侧边导航折叠、按钮纵向排列
|
||||
|
||||
**备份时间戳改为 Brisbane 时区**
|
||||
- `brisbaneTimestamp()` 函数,所有备份文件名使用 `Australia/Brisbane` 时区
|
||||
- 重要:系统所有时间显示统一按 Brisbane 处理
|
||||
|
||||
**启动脚本全面重写**
|
||||
- `start.sh` / `start.bat` 全部英文
|
||||
- 端口冲突时自动 kill 旧进程,而非报错退出
|
||||
- 支持 `--host` 参数
|
||||
|
||||
**README 重写**
|
||||
- 移除所有空的 screenshot 占位符(含敏感 ID 的截图已删除)
|
||||
- 更新功能描述匹配 v0.6
|
||||
- 精简结构,保留中英文双语
|
||||
|
||||
### 新功能 i18n 策略
|
||||
|
||||
- v0.6 新增的所有 UI 文案仅提供英文
|
||||
- 中文翻译推迟到 v1.0 正式版
|
||||
|
||||
### 技术备忘
|
||||
|
||||
- **Template literal 转义规则**:MAIN_HTML_SCRIPT 是反引号模板字符串
|
||||
- `\n` → 真实换行(浏览器 JS 字符串跨行 → SyntaxError),必须写 `\\n`
|
||||
- `\'` → `'`(无法用于 onclick 里的引号转义),改用 data 属性 + 事件委托
|
||||
- `\`` → `` ` ``(嵌套模板字符串在 evaluated output 中正常工作)
|
||||
- **`assertBrowserScriptSyntax()`** 在启动时检查 MAIN_HTML_SCRIPT 的 evaluated 值
|
||||
- **OpenClaw config 多 bot 格式**:`channels.telegram.accounts.<id>.botToken`,binding 用 `accountId` 路由
|
||||
|
||||
### 下一步(v0.7+)
|
||||
|
||||
- [x] Dashboard 首页 tab(系统信息 + OpenClaw health 状态)— done in v0.6.5
|
||||
- [x] HTTP 响应加 `Cache-Control: no-store` + version-based cache busting — done in v0.6.5
|
||||
- [x] 彻底删除旧 `/api/agents/main` 端点残留(确认已清除)— confirmed in v0.6.5
|
||||
- [x] Agent tree: independent roots per bot + side-by-side layout — done in v0.6.5
|
||||
- [x] Agent tree: expand/collapse toggle for sub-agents — done in v0.6.5
|
||||
- [x] Add Agent: creates `agents/<id>/sessions/` runtime dirs + SOUL.md personality — done in v0.6.5
|
||||
- [x] Agent tree: main agent always root with inferred accountId — done in v0.6.6
|
||||
- [ ] Dashboard: auto-refresh every 30s when tab is active
|
||||
- [ ] Dashboard: OpenClaw version display (from `openclaw --version`)
|
||||
- [ ] Agent page: edit agent name, purpose, personality inline
|
||||
- [ ] Agent page: restart gateway button with status feedback
|
||||
- [ ] Settings tab: edit openclaw.json key fields via form (model, workspace defaults)
|
||||
- [ ] Telegram bot connectivity test button (ping bot API from server)
|
||||
- [ ] DEVLOG.md 中文 → 逐步迁移为英文
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.openclaw.manager</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.5.0</string>
|
||||
<string>0.7.1</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.5.0</string>
|
||||
<string>0.7.1</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
|
||||
@@ -1,116 +1,89 @@
|
||||
# OpenClaw Manager (OCM)
|
||||
|
||||
> A zero-dependency, single-file local dashboard for [OpenClaw](https://github.com/anthropics/openclaw) — manage sub-agents, run commands in a built-in CLI, and stop hand-editing JSON.
|
||||
A zero-dependency, single-file web dashboard for [OpenClaw](https://github.com/anthropics/openclaw). Manage agents, monitor token usage, and run commands — all from your browser, no `npm install` required.
|
||||
|
||||
[中文说明](#中文说明)
|
||||
|
||||
---
|
||||
|
||||
## Quick Start (1 min)
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Install
|
||||
# Clone
|
||||
git clone https://github.com/dtzp555-max/ocm.git
|
||||
cd ocm
|
||||
|
||||
# Update (existing clone)
|
||||
git pull --ff-only
|
||||
|
||||
# Run (no npm install needed)
|
||||
bash start.sh # macOS / Linux
|
||||
start.bat # Windows
|
||||
bash start.sh # macOS / Linux
|
||||
start.bat # Windows
|
||||
|
||||
# Update
|
||||
git pull --ff-only
|
||||
```
|
||||
|
||||
Open [http://localhost:3333](http://localhost:3333).
|
||||
|
||||
## Why OCM
|
||||
|
||||
- **Single-file + zero dependency**: one `openclaw-manager.js`, no build step
|
||||
- **Fast daily operations**: agent/model/auth/cron/backup in one local UI
|
||||
- **Built-in terminal**: run `openclaw` commands with streaming output and presets
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Landing Page
|
||||
Choose between Sub-agent mode and Multi-agent mode. Switch language (EN / 中文) anytime.
|
||||
|
||||

|
||||
|
||||
### Agent Management
|
||||
View all agents (main + sub-agents) at a glance. Each card shows model, group binding, and workspace path. Switch models inline, browse files, or delete with auto-backup.
|
||||
|
||||

|
||||
|
||||
### Built-in CLI Terminal
|
||||
Run any openclaw command with real-time streaming output. The terminal panel sits at the bottom of the page and expands on demand.
|
||||
|
||||

|
||||
|
||||
<details>
|
||||
<summary>More screenshots</summary>
|
||||
|
||||
### New Subagent Wizard
|
||||
4-step guided wizard to create a sub-agent: basic info → model → personality & memory → confirm. Fully bilingual.
|
||||
|
||||

|
||||
|
||||
### Model Selector
|
||||
Rich model dropdown grouped by provider — GitHub Copilot, Anthropic, OpenAI, Google, DeepSeek, Kimi, Groq, Mistral, Together, plus your custom models.
|
||||
|
||||

|
||||
|
||||
### Actions Menu
|
||||
Quick access to gateway operations, backups, health checks, and directory management. Use **"Switch OpenClaw Dir"** to point OCM to your OpenClaw config on first setup.
|
||||
|
||||

|
||||
|
||||
### Cron Job Management
|
||||
View, add, enable/disable, and manually trigger openclaw-related cron tasks. Integrates with NAS backup schedules.
|
||||
|
||||

|
||||
|
||||
Preset command menu with built-in commands and your personal favorites — one click to run.
|
||||
|
||||

|
||||
|
||||
Command output streams in real-time. Star frequently used commands for quick access, or use the Manage button to organize favorites.
|
||||
|
||||

|
||||
</details>
|
||||
Open [http://localhost:3333](http://localhost:3333) in your browser. For remote access, use `bash start.sh --host 0.0.0.0`.
|
||||
|
||||
## Features
|
||||
|
||||
- **Agents & Workspace** — Create sub-agents, switch models inline, and browse/edit workspace files
|
||||
- **Models & Auth** — Manage primary/fallback models and follow provider auth guides
|
||||
- **Ops Panel** — Restart gateway, view logs, run health checks, and switch OpenClaw directory
|
||||
- **Stats & Cron** — Token/cost stats from `gateway.log` plus cron task management
|
||||
- **Backups** — Local backup/rollback and NAS backup (SFTP/rsync)
|
||||
- **Built-in CLI** — Real-time command terminal with presets, favorites, and tab completion
|
||||
**Screenshots** — Redacted UI walkthrough (no personal paths, no Telegram IDs):
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
**Agent Management** — Add main agents and sub-agents through a guided setup flow. View all agents in a tree structure with model selection, workspace browsing, and inline configuration.
|
||||
|
||||
**Usage Statistics** — Real token usage data parsed directly from OpenClaw session files. Breakdown by model, agent, and day with a visual chart.
|
||||
|
||||
**Model & Auth** — Configure models from your registered provider list. Follow built-in guides for provider authentication setup.
|
||||
|
||||
**Built-in CLI** — Run any `openclaw` command with real-time streaming output. Preset commands, favorites, and tab completion included.
|
||||
|
||||
**Ops Panel** — Restart gateway, view logs, run health checks, manage backups (local + NAS via SFTP/rsync), and handle cron tasks.
|
||||
|
||||
**Bilingual UI** — English and Chinese interface with one-click language switching.
|
||||
|
||||
## Telegram Workflow & Safety
|
||||
|
||||
OCM is designed primarily for **Telegram-based OpenClaw workflows**:
|
||||
|
||||
- Bind Telegram groups to one or more main agents, then create sub-agents under each tree
|
||||
- Keep each agent's context isolated via independent `workspace`, `SOUL.md`, and `MEMORY.md`
|
||||
- OCM mainly helps you **safely update `openclaw.json`** via UI instead of manual editing
|
||||
- Recommended for users who already have basic OpenClaw CLI experience (`onboard`, auth, gateway logs)
|
||||
|
||||
Critical Telegram settings:
|
||||
|
||||
- In BotFather, keep **Allow Groups = ON**
|
||||
- In BotFather, set **Group Privacy = OFF**
|
||||
- For each agent group, keep it private: **only you + that agent/sub-agents**
|
||||
- Do **not** invite other people to these groups (cost and security risk)
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js >= 18 ([download](https://nodejs.org/))
|
||||
- Node.js 18+ ([download](https://nodejs.org/))
|
||||
- A working [OpenClaw](https://github.com/anthropics/openclaw) installation
|
||||
|
||||
Install/update/run commands are in **Quick Start (1 min)** above.
|
||||
|
||||
### First Run
|
||||
|
||||
On first launch, the start script auto-detects `~/.openclaw` and creates a `manager-config.json` for you. If your OpenClaw config is elsewhere, use **Actions → Switch OpenClaw Dir** in the UI to point to the correct path.
|
||||
|
||||
### macOS Double-click
|
||||
|
||||
Double-click `OpenClaw Manager.app` in Finder. On first launch, you may need to allow it in System Settings → Privacy & Security.
|
||||
|
||||
### Custom Port
|
||||
|
||||
```bash
|
||||
bash start.sh --port 8080
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The app locates your OpenClaw config directory in this order:
|
||||
On first launch, OCM auto-detects `~/.openclaw` and creates a local `manager-config.json`. If your OpenClaw config is elsewhere, use **Actions → Switch OpenClaw Dir** or specify it directly:
|
||||
|
||||
```bash
|
||||
bash start.sh --dir /path/to/.openclaw --port 8080
|
||||
```
|
||||
|
||||
Detection priority:
|
||||
|
||||
| Priority | Method |
|
||||
|----------|--------|
|
||||
@@ -125,9 +98,17 @@ You can also create `manager-config.json` manually:
|
||||
{ "dir": "~/.openclaw" }
|
||||
```
|
||||
|
||||
`~` expands to your home directory on all platforms. `manager-config.json` is in `.gitignore` and won't be committed.
|
||||
`manager-config.json` is gitignored and won't be committed.
|
||||
|
||||
## Optional: Shell Alias
|
||||
## Remote Access
|
||||
|
||||
By default OCM binds to `0.0.0.0` (all interfaces). Access it from another device on your LAN using the IP shown at startup. To restrict to localhost only:
|
||||
|
||||
```bash
|
||||
bash start.sh --host 127.0.0.1
|
||||
```
|
||||
|
||||
## Shell Alias (Optional)
|
||||
|
||||
```bash
|
||||
# Add to ~/.zshrc or ~/.bashrc
|
||||
@@ -138,14 +119,12 @@ alias ocm="bash ~/path/to/ocm/start.sh"
|
||||
|
||||
```
|
||||
ocm/
|
||||
├── openclaw-manager.js ← The entire app (server + frontend, single file)
|
||||
├── start.sh ← macOS/Linux start script (auto-detect Node, port, config)
|
||||
├── start.bat ← Windows start script
|
||||
├── OpenClaw Manager.app/ ← macOS Finder double-click launcher
|
||||
├── screenshots/ ← README screenshots
|
||||
├── manager-config.json ← Local config (gitignored)
|
||||
├── package.json
|
||||
├── DEVLOG.md ← Development log
|
||||
├── openclaw-manager.js ← Entire app (server + frontend, single file)
|
||||
├── start.sh ← macOS/Linux launcher (auto-detect, port conflict handling)
|
||||
├── start.bat ← Windows launcher
|
||||
├── OpenClaw Manager.app/ ← macOS Finder double-click launcher
|
||||
├── manager-config.json ← Local config (gitignored)
|
||||
├── DEVLOG.md ← Development log
|
||||
└── README.md
|
||||
```
|
||||
|
||||
@@ -155,12 +134,6 @@ ocm/
|
||||
- **Frontend**: Vanilla HTML/CSS/JS embedded in a template literal — no build step, no framework
|
||||
- **Architecture**: Single-file, zero-dependency, runs anywhere Node.js runs
|
||||
|
||||
## Support / Donate
|
||||
|
||||
If OCM saves you time, consider starring the repo or sponsoring development.
|
||||
|
||||
- GitHub Sponsors: *(add link when ready)*
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
@@ -169,94 +142,54 @@ MIT
|
||||
|
||||
## 中文说明
|
||||
|
||||
### 简介
|
||||
OpenClaw Manager 是一个零依赖的本地 Web 管理界面,用于可视化管理 [OpenClaw](https://github.com/anthropics/openclaw) AI 智能体。所有代码在一个 `.js` 文件中,只需 Node.js 18+,不需要 `npm install`。
|
||||
|
||||
OpenClaw Manager 是一个零依赖的本地 Web 管理界面,用于可视化管理 [OpenClaw](https://github.com/anthropics/openclaw) AI 智能体。所有代码合并在一个 `.js` 文件中,只需要 Node.js 18+,不需要 `npm install`。
|
||||
|
||||
### 1 分钟上手
|
||||
### 快速开始
|
||||
|
||||
```bash
|
||||
# 首次安装
|
||||
git clone https://github.com/dtzp555-max/ocm.git
|
||||
cd ocm
|
||||
|
||||
# 已安装后更新
|
||||
git pull --ff-only
|
||||
|
||||
# 运行(无需 npm install)
|
||||
bash start.sh # macOS / Linux
|
||||
start.bat # Windows
|
||||
bash start.sh # macOS / Linux
|
||||
start.bat # Windows
|
||||
```
|
||||
|
||||
访问 [http://localhost:3333](http://localhost:3333)。
|
||||
访问 [http://localhost:3333](http://localhost:3333)。远程访问请使用 `bash start.sh --host 0.0.0.0`。
|
||||
|
||||
### 界面预览
|
||||
### 功能
|
||||
|
||||
#### 模式选择
|
||||

|
||||
- **Agent 管理** — 添加主 Agent 和子 Agent,树状结构查看,内联切换模型,浏览工作区文件
|
||||
- **使用统计** — 从 OpenClaw 会话文件解析真实 Token 用量,按模型/Agent/日期维度展示
|
||||
- **模型与认证** — 管理注册模型列表,内置 Provider 认证引导
|
||||
- **内置终端** — 实时流式输出,预设命令,收藏夹,Tab 补全
|
||||
- **运维面板** — 重启网关、查看日志、健康检查、本地/NAS 备份、Cron 任务管理
|
||||
- **双语界面** — 中英文一键切换
|
||||
|
||||
#### Agent 管理
|
||||

|
||||
### Telegram 场景与安全提示
|
||||
|
||||
#### 内置 CLI 终端
|
||||
底部终端面板,支持实时流式输出、预设命令、收藏夹、Tab 补全。
|
||||
OCM 主要面向 **Telegram 场景**:
|
||||
|
||||

|
||||
- 通过群组绑定主 Agent,并在每条树下管理多个 Sub-Agent
|
||||
- 让每个 Agent 拥有独立 `workspace`、`SOUL.md`、`MEMORY.md`
|
||||
- 通过可视化方式更新 `openclaw.json`,减少手动改配置风险
|
||||
- 建议使用者已具备基础 OpenClaw CLI 操作经验(如 `onboard`、认证、查看网关日志)
|
||||
|
||||
<details>
|
||||
<summary>更多截图</summary>
|
||||
关键安全设置(务必确认):
|
||||
|
||||
#### 新建向导
|
||||

|
||||
- BotFather 里 **Allow Groups = ON**
|
||||
- BotFather 里 **Group Privacy = OFF**
|
||||
- 每个 Agent 群组只保留“你自己 + 对应 Agent/Sub-Agent”
|
||||
- 不要邀请其他人进组(会带来安全和 API 费用风险)
|
||||
|
||||
#### 模型选择 & 操作菜单
|
||||
首次安装后,通过 **Actions → Switch OpenClaw Dir** 指向你的 OpenClaw 配置目录即可开始使用。
|
||||
### 配置
|
||||
|
||||

|
||||

|
||||
启动脚本自动检测 `~/.openclaw` 目录。如需指定其他路径:
|
||||
|
||||
#### Cron 定时任务
|
||||

|
||||
```bash
|
||||
bash start.sh --dir /path/to/.openclaw --port 8080
|
||||
```
|
||||
|
||||

|
||||

|
||||
</details>
|
||||
|
||||
### 功能一览
|
||||
|
||||
- **Agent 与 Workspace** — 新建子智能体、内联切换模型、浏览/编辑工作区文件
|
||||
- **模型与认证** — 管理主模型/Fallback 链,按引导完成各 Provider 认证
|
||||
- **运维操作面板** — 重启网关、查看日志、健康检查、切换 OpenClaw 目录
|
||||
- **统计与计划任务** — 从 `gateway.log` 汇总 Token/费用,并管理 Cron 任务
|
||||
- **备份能力** — 本地备份回滚 + NAS 远程备份(SFTP/rsync)
|
||||
- **内置 CLI 终端** — 实时输出、预设命令、收藏、Tab 补全
|
||||
|
||||
安装/更新/运行命令见上方 **1 分钟上手**。
|
||||
|
||||
### 首次运行
|
||||
|
||||
启动脚本会自动检测 `~/.openclaw` 目录并创建 `manager-config.json`。如果你的 OpenClaw 配置在其他位置,进入界面后点击 **Actions → Switch OpenClaw Dir** 切换即可。
|
||||
|
||||
### 指定 OpenClaw 目录
|
||||
|
||||
程序按以下优先级查找配置:
|
||||
|
||||
1. `--dir` 命令行参数
|
||||
2. `OPENCLAW_DIR` 环境变量
|
||||
3. 同目录下的 `manager-config.json`
|
||||
4. `~/.openclaw`(默认)
|
||||
|
||||
也可以手动创建 `manager-config.json`:
|
||||
也可手动创建 `manager-config.json`:
|
||||
|
||||
```json
|
||||
{ "dir": "~/.openclaw" }
|
||||
```
|
||||
|
||||
`~` 在所有平台自动展开为用户主目录。
|
||||
|
||||
### Shell 别名(可选)
|
||||
|
||||
```bash
|
||||
# 加到 ~/.zshrc 或 ~/.bashrc
|
||||
alias ocm="bash ~/path/to/ocm/start.sh"
|
||||
```
|
||||
|
||||
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 207 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openclaw-manager",
|
||||
"version": "0.5.0",
|
||||
"version": "0.7.1",
|
||||
"description": "A local web UI for managing OpenClaw AI agents — no npm install required",
|
||||
"main": "openclaw-manager.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
:: ================================================================
|
||||
:: OpenClaw Manager v0.6.0 — Start Script (Windows)
|
||||
:: OpenClaw Manager v0.7.1 — Start Script (Windows)
|
||||
::
|
||||
:: Features:
|
||||
:: * Auto-detect Node.js, show install instructions if missing
|
||||
@@ -19,7 +19,7 @@ set "MIN_NODE_MAJOR=18"
|
||||
|
||||
echo.
|
||||
echo ===================================
|
||||
echo OpenClaw Manager v0.6.0
|
||||
echo OpenClaw Manager v0.7.1
|
||||
echo -----------------------------------
|
||||
echo.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# ================================================================
|
||||
# OpenClaw Manager v0.6.0 — Start Script (macOS / Linux)
|
||||
# OpenClaw Manager v0.7.1 — Start Script (macOS / Linux)
|
||||
#
|
||||
# Features:
|
||||
# - Auto-detect Node.js, show install instructions if missing
|
||||
@@ -22,7 +22,7 @@ CYAN='\033[0;36m'; BOLD='\033[1m'; DIM='\033[2m'; RESET='\033[0m'
|
||||
|
||||
banner() {
|
||||
echo ""
|
||||
echo -e "${CYAN}${BOLD} 🦀 OpenClaw Manager v0.6.0${RESET}"
|
||||
echo -e "${CYAN}${BOLD} 🦀 OpenClaw Manager v0.7.1${RESET}"
|
||||
echo -e "${DIM} ─────────────────────────────${RESET}"
|
||||
echo ""
|
||||
}
|
||||
|
||||