Pixel Office Skill
Launch and manage the Pixel Office web UI where agents appear as animated pixel-art characters that walk, sit, and interact with furniture in real time.
Activation
Activate when user says:
- - "打开像素办公室"
- "open pixel office"
- "像素办公室"
- "pixel office"
What This Skill Does
- 1. Detects the operating system (macOS/Windows)
- Checks if git is installed
- Downloads/clones the OpenClaw Dashboard project if not already present
- Installs dependencies (npm install)
- Starts the development server in background
- Returns the access URL to the user
Installation Directory
- - macOS/Linux: INLINECODE0
- Windows: INLINECODE1
Prerequisites
- - Node.js 18+ must be installed
- OpenClaw config at
~/.openclaw/openclaw.json (or %USERPROFILE%\.openclaw\openclaw.json on Windows)
Workflow
Step 1: Check if already running and stop it
CODEBLOCK0
If already running:
- - Stop the service first (ensure clean restart)
macOS/Linux:
CODEBLOCK1
Windows (PowerShell):
CODEBLOCK2
Windows (cmd):
CODEBLOCK3
Then proceed to Step 1.5.
Step 1.5: Check for updates (if project exists)
If project exists, check if there's a newer version:
If git is available:
CODEBLOCK4
If update available:
- - Inform user: "检测到新版本,正在更新..."
- Pull latest code: INLINECODE4
- Reinstall dependencies: INLINECODE5
- Continue to Step 5 (start service)
If up to date:
- - Continue to Step 5 (start service)
If git is NOT available:
- - Inform user: "检测到项目无 git 管理,正在重新下载最新版本..."
- Remove old project directory:
# macOS/Linux
rm -rf ~/projects/OpenClaw-bot-review
# Windows (PowerShell)
Remove-Item -Recurse -Force "$env:USERPROFILE\projects\OpenClaw-bot-review"
- - Go to Step 3 (download project via ZIP)
Step 2: Check if project exists
CODEBLOCK6
If exists, skip to Step 4.
Step 3: Download project
Option A: With git (preferred)
CODEBLOCK7
Option B: Without git (fallback)
macOS/Linux:
CODEBLOCK8
Windows (PowerShell):
CODEBLOCK9
Windows (cmd with curl - Windows 10+):
CODEBLOCK10
Step 4: Install dependencies (if needed)
Check if node_modules exists. If not:
CODEBLOCK11
Step 5: Start the server
macOS/Linux:
CODEBLOCK12
Windows (PowerShell):
CODEBLOCK13
Windows (cmd):
CODEBLOCK14
Step 6: Wait for server to be ready
Poll http://localhost:3000 until it responds (max 30 seconds).
CODEBLOCK15
Step 7: Return access URLs (required)
You MUST return both:
First, actually detect the machine's LAN IPv4 address. Do not guess it.
macOS/Linux:
CODEBLOCK16
Windows (PowerShell):
CODEBLOCK17
Rules:
- - You MUST execute an IP detection command before composing the final reply.
- Do NOT guess or fabricate the LAN IP.
- Do NOT omit the LAN URL just because localhost works.
- You MUST include both the local URL and the LAN URL in the final reply.
- If LAN IP detection fails, you MUST still include the local URL and explicitly say:
- 局域网访问地址:获取失败
- and briefly mention that LAN IP detection failed.
- - Do NOT end with only a localhost URL.
Return message format:
CODEBLOCK18
If LAN IP detection fails, use:
CODEBLOCK19
Stopping the Server
When user asks to stop:
macOS/Linux:
CODEBLOCK20
Windows (PowerShell):
CODEBLOCK21
Windows (cmd):
CODEBLOCK22
Error Handling
- - Node.js not found: Tell user to install Node.js 18+ from https://nodejs.org/
- Port 3000 already in use: Check if it's the dashboard (return URL) or another service (suggest using a different port with
PORT=3001 npm run dev) - OpenClaw config not found: Warn that dashboard may not work properly without INLINECODE9
- Download failed: Suggest checking internet connection or manually downloading from GitHub
- npm install failed: Suggest running
npm cache clean --force and retrying
Notes
- - The server runs in background and persists until stopped or system reboot
- Dashboard reads config directly from
~/.openclaw/openclaw.json - no database needed - Supports auto-refresh, dark/light theme, i18n (Chinese/English)
- Includes pixel-art office animation for fun visualization
Platform Detection
CODEBLOCK23
Git Detection
CODEBLOCK24
Detection logic:
- 1. Run
git --version at the beginning - Store result (available/not available)
- Use this result throughout the workflow
If git not available:
- - Always use ZIP download method
- Always force re-download when project exists (to get latest version)
- Clean up old directory before downloading
Implementation Tips
- 1. Always stop old service first - ensures clean restart with latest code
- Check git availability at the start - determines update strategy
- With git: Check for updates and pull if needed
- Without git: Force re-download ZIP to ensure latest version
- No user confirmation needed - auto-update and restart for best UX
- Use background process management to avoid blocking
- Provide clear feedback at each step ("已停止旧服务", "检测到新版本,正在更新...", "正在重新下载最新版本...")
- Handle both PowerShell and cmd on Windows
- Clean up temporary files (zip archives)
- Log errors for debugging but keep user messages simple
- Always ensure latest code - either via git pull or re-download
Pixel Office 技能
启动并管理 Pixel Office 网页界面,代理角色以动画像素艺术角色形式呈现,可实时行走、坐下并与家具互动。
激活条件
当用户说出以下内容时激活:
- - 打开像素办公室
- open pixel office
- 像素办公室
- pixel office
技能功能
- 1. 检测操作系统(macOS/Windows)
- 检查是否安装了 git
- 如果项目不存在,下载/克隆 OpenClaw Dashboard 项目
- 安装依赖(npm install)
- 在后台启动开发服务器
- 向用户返回访问地址
安装目录
- - macOS/Linux:~/projects/OpenClaw-bot-review/
- Windows:%USERPROFILE%\projects\OpenClaw-bot-review\
前置条件
- - 必须安装 Node.js 18+
- OpenClaw 配置文件位于 ~/.openclaw/openclaw.json(Windows 上为 %USERPROFILE%\.openclaw\openclaw.json)
工作流程
步骤 1:检查是否已在运行并停止
bash
检查端口 3000 上是否有进程在运行
macOS/Linux
lsof -ti:3000
Windows
netstat -ano | findstr :3000
如果已在运行:
macOS/Linux:
bash
lsof -ti:3000 | xargs kill -9 2>/dev/null
echo 已停止旧服务
Windows(PowerShell):
powershell
Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess | Stop-Process -Force
Write-Host 已停止旧服务
Windows(cmd):
cmd
for /f tokens=5 %a in (netstat -ano ^| findstr :3000) do taskkill /F /PID %a
echo 已停止旧服务
然后继续执行步骤 1.5。
步骤 1.5:检查更新(如果项目已存在)
如果项目已存在,检查是否有新版本:
如果安装了 git:
bash
macOS/Linux
cd ~/projects/OpenClaw-bot-review
git fetch origin main 2>/dev/null
LOCAL=$(git rev-parse HEAD 2>/dev/null)
REMOTE=$(git rev-parse origin/main 2>/dev/null)
if [ $LOCAL != $REMOTE ]; then
echo update_available
else
echo uptodate
fi
Windows(PowerShell)
cd $env:USERPROFILE\projects\OpenClaw-bot-review
git fetch origin main 2>$null
$local = git rev-parse HEAD 2>$null
$remote = git rev-parse origin/main 2>$null
if ($local -ne $remote) { update
available } else { upto_date }
如果有更新:
- - 通知用户:检测到新版本,正在更新...
- 拉取最新代码:git pull origin main
- 重新安装依赖:npm install
- 继续执行步骤 5(启动服务)
如果已是最新:
如果未安装 git:
- - 通知用户:检测到项目无 git 管理,正在重新下载最新版本...
- 删除旧项目目录:
bash
# macOS/Linux
rm -rf ~/projects/OpenClaw-bot-review
# Windows(PowerShell)
Remove-Item -Recurse -Force $env:USERPROFILE\projects\OpenClaw-bot-review
步骤 2:检查项目是否存在
bash
macOS/Linux
test -d ~/projects/OpenClaw-bot-review && echo exists || echo not found
Windows(PowerShell)
Test-Path $env:USERPROFILE\projects\OpenClaw-bot-review
如果存在,跳到步骤 4。
步骤 3:下载项目
选项 A:使用 git(推荐)
bash
macOS/Linux
mkdir -p ~/projects
cd ~/projects
git clone https://github.com/xmanrui/OpenClaw-bot-review.git
Windows(PowerShell)
New-Item -ItemType Directory -Force -Path $env:USERPROFILE\projects
cd $env:USERPROFILE\projects
git clone https://github.com/xmanrui/OpenClaw-bot-review.git
选项 B:不使用 git(备用方案)
macOS/Linux:
bash
mkdir -p ~/projects
cd ~/projects
curl -L https://github.com/xmanrui/OpenClaw-bot-review/archive/refs/heads/main.zip -o openclaw-dashboard.zip
unzip openclaw-dashboard.zip
mv OpenClaw-bot-review-main OpenClaw-bot-review
rm openclaw-dashboard.zip
Windows(PowerShell):
powershell
New-Item -ItemType Directory -Force -Path $env:USERPROFILE\projects
cd $env:USERPROFILE\projects
Invoke-WebRequest -Uri https://github.com/xmanrui/OpenClaw-bot-review/archive/refs/heads/main.zip -OutFile openclaw-dashboard.zip
Expand-Archive -Path openclaw-dashboard.zip -DestinationPath .
Rename-Item -Path OpenClaw-bot-review-main -NewName OpenClaw-bot-review
Remove-Item openclaw-dashboard.zip
Windows(使用 curl 的 cmd - Windows 10+):
cmd
mkdir %USERPROFILE%\projects 2>nul
cd /d %USERPROFILE%\projects
curl -L https://github.com/xmanrui/OpenClaw-bot-review/archive/refs/heads/main.zip -o openclaw-dashboard.zip
tar -xf openclaw-dashboard.zip
ren OpenClaw-bot-review-main OpenClaw-bot-review
del openclaw-dashboard.zip
步骤 4:安装依赖(如果需要)
检查 node_modules 是否存在。如果不存在:
bash
macOS/Linux
cd ~/projects/OpenClaw-bot-review
npm install
Windows
cd %USERPROFILE%\projects\OpenClaw-bot-review
npm install
步骤 5:启动服务器
macOS/Linux:
bash
cd ~/projects/OpenClaw-bot-review
npm run dev > /dev/null 2>&1 &
Windows(PowerShell):
powershell
cd $env:USERPROFILE\projects\OpenClaw-bot-review
Start-Process -NoNewWindow -FilePath npm -ArgumentList run, dev
Windows(cmd):
cmd
cd /d %USERPROFILE%\projects\OpenClaw-bot-review
start /B npm run dev
步骤 6:等待服务器就绪
轮询 http://localhost:3000 直到响应(最长 30 秒)。
bash
macOS/Linux
for i in {1..30}; do
curl -s http://localhost:3000 > /dev/null && break
sleep 1
done
Windows(PowerShell)
for ($i=0; $i -lt 30; $i++) {
try {
Invoke-WebRequest -Uri http://localhost:3000 -UseBasicParsing -TimeoutSec 1 | Out-Null
break
} catch {
Start-Sleep -Seconds 1
}
}
步骤 7:返回访问地址(必需)
你必须返回两个地址:
首先,实际检测机器的局域网 IPv4 地址。不要猜测。
macOS/Linux:
bash
(ipconfig getifaddr en0 || ipconfig getifaddr en1 || hostname -I | awk {print $1}) 2>/dev/null
Windows(PowerShell):
powershell
(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Ethernet,Wi-Fi | Select-Object -First 1).IPAddress
规则:
- - 在编写最终回复前,你必须执行 IP 检测命令。
- 不要猜测或伪造局域网 IP。
- 不要因为 localhost 可用就省略局域网地址。
- 在最终回复中必须同时包含本地地址和局域网地址。
- 如果局域网 IP 检测失败,你仍必须包含本地地址,并明确说明:
- 局域网访问地址:获取失败
- 并简要说明局域网 IP 检测失败。
返回消息格式:
✅ Pixel Office 已启动!
访问地址: