feat: add one-click uninstall + Intel Mac support
- agent.sh: add --uninstall flag, detect arm64/x86_64 for macOS - agent.html: add uninstall section with tab switching - guide.html: replace simple uninstall with full one-click uninstall blocks in both oneclick-install and remote-support sections - downloads: add agent-mac-intel binary for Intel Mac users
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
.faq { background: #16213e; border-radius: 12px; padding: 20px; margin: 20px 0; }
|
||||
.faq h3 { color: #e94560; margin-bottom: 8px; font-size: 15px; }
|
||||
.faq p { color: #aaa; font-size: 14px; margin-bottom: 15px; }
|
||||
.uninstall-section { background: #16213e; border-radius: 12px; padding: 20px; margin: 20px 0; border: 1px solid #e9456033; }
|
||||
.uninstall-section h2 { color: #f0ad4e; margin-bottom: 12px; font-size: 18px; }
|
||||
.uninstall-section p { color: #ccc; margin-bottom: 10px; }
|
||||
img.guide-img { width: 100%; border-radius: 8px; margin: 10px 0; }
|
||||
</style>
|
||||
</head>
|
||||
@@ -130,6 +133,36 @@
|
||||
<p style="margin-top: 12px;">把 <strong>Device ID</strong>(如 <code style="background:#0f3460; padding:2px 8px; border-radius:4px;">desktop-a3f2</code>)发给技术支持即可。</p>
|
||||
</div>
|
||||
|
||||
<!-- Uninstall -->
|
||||
<div class="uninstall-section">
|
||||
<h2>一键卸载</h2>
|
||||
<p>如需彻底清理 Agent(停止进程 + 删除文件),复制对应命令运行:</p>
|
||||
|
||||
<div id="uninstall-win-wrap" class="tab-content active">
|
||||
<div class="cmd" id="uninstall-win" onclick="copyCmd('uninstall-win')">
|
||||
irm https://u-claw.org/agent.ps1 | iex -Args '--uninstall'
|
||||
<button class="copy-btn" onclick="event.stopPropagation(); copyCmd('uninstall-win')">复制</button>
|
||||
</div>
|
||||
<p class="note">或者直接关闭 PowerShell 窗口,Agent 也会自动停止并清理</p>
|
||||
</div>
|
||||
|
||||
<div id="uninstall-mac-wrap" class="tab-content">
|
||||
<div class="cmd" id="uninstall-mac" onclick="copyCmd('uninstall-mac')">
|
||||
curl -fsSL https://u-claw.org/agent.sh | bash -s -- --uninstall
|
||||
<button class="copy-btn" onclick="event.stopPropagation(); copyCmd('uninstall-mac')">复制</button>
|
||||
</div>
|
||||
<p class="note">会停止 Agent 进程并删除 /tmp/uclaw 目录</p>
|
||||
</div>
|
||||
|
||||
<div id="uninstall-linux-wrap" class="tab-content">
|
||||
<div class="cmd" id="uninstall-linux" onclick="copyCmd('uninstall-linux')">
|
||||
curl -fsSL https://u-claw.org/agent.sh | bash -s -- --uninstall
|
||||
<button class="copy-btn" onclick="event.stopPropagation(); copyCmd('uninstall-linux')">复制</button>
|
||||
</div>
|
||||
<p class="note">会停止 Agent 进程并删除 /tmp/uclaw 目录</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Safety -->
|
||||
<div class="step" style="border: 1px solid #1b5e20;">
|
||||
<h2 style="color: #4caf50;">安全说明</h2>
|
||||
@@ -181,6 +214,10 @@
|
||||
document.querySelectorAll('[id^="cmd-"][id$="-wrap"]').forEach(c => c.classList.remove('active'));
|
||||
const cmdName = name === 'win' ? 'win' : name === 'mac' ? 'mac' : 'linux';
|
||||
document.getElementById('cmd-' + cmdName + '-wrap').classList.add('active');
|
||||
|
||||
// Update uninstall commands
|
||||
document.querySelectorAll('[id^="uninstall-"][id$="-wrap"]').forEach(c => c.classList.remove('active'));
|
||||
document.getElementById('uninstall-' + cmdName + '-wrap').classList.add('active');
|
||||
}
|
||||
|
||||
function copyCmd(id) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# U-Claw Remote Agent (macOS / Linux)
|
||||
# Usage: curl -fsSL https://u-claw.org/agent.sh | bash
|
||||
# Usage:
|
||||
# Install & run: curl -fsSL https://u-claw.org/agent.sh | bash
|
||||
# Uninstall: curl -fsSL https://u-claw.org/agent.sh | bash -s -- --uninstall
|
||||
# ============================================================
|
||||
|
||||
set -e
|
||||
@@ -12,12 +14,54 @@ TIMEOUT_HOURS=2
|
||||
AGENT_DIR="/tmp/uclaw"
|
||||
AGENT_PATH="$AGENT_DIR/agent"
|
||||
|
||||
# Detect OS
|
||||
# ---- Uninstall mode ----
|
||||
if [ "${1:-}" = "--uninstall" ]; then
|
||||
echo ""
|
||||
echo " =========================================="
|
||||
echo " U-Claw Agent — Uninstall"
|
||||
echo " =========================================="
|
||||
echo ""
|
||||
# Kill running agent processes
|
||||
if pgrep -f "$AGENT_PATH" >/dev/null 2>&1; then
|
||||
echo " [1/2] Stopping running agent..."
|
||||
pkill -f "$AGENT_PATH" 2>/dev/null || true
|
||||
sleep 1
|
||||
echo " [OK] Agent stopped"
|
||||
else
|
||||
echo " [1/2] No running agent found"
|
||||
fi
|
||||
# Remove files
|
||||
if [ -d "$AGENT_DIR" ]; then
|
||||
echo " [2/2] Removing $AGENT_DIR ..."
|
||||
rm -rf "$AGENT_DIR"
|
||||
echo " [OK] Removed"
|
||||
else
|
||||
echo " [2/2] Nothing to remove ($AGENT_DIR not found)"
|
||||
fi
|
||||
echo ""
|
||||
echo " Uninstall complete. All clean!"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ---- Detect OS & architecture ----
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH=$(uname -m)
|
||||
|
||||
case "$OS" in
|
||||
darwin) DOWNLOAD_URL="https://u-claw.org/downloads/agent" ;;
|
||||
linux) DOWNLOAD_URL="https://u-claw.org/downloads/agent-linux" ;;
|
||||
*) echo " [FAIL] Unsupported OS: $OS"; exit 1 ;;
|
||||
darwin)
|
||||
case "$ARCH" in
|
||||
arm64|aarch64) DOWNLOAD_URL="http://47.107.130.152/downloads/agent" ;;
|
||||
x86_64|amd64) DOWNLOAD_URL="http://47.107.130.152/downloads/agent-mac-intel" ;;
|
||||
*) echo " [FAIL] Unsupported Mac architecture: $ARCH"; exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
linux)
|
||||
DOWNLOAD_URL="http://47.107.130.152/downloads/agent-linux"
|
||||
;;
|
||||
*)
|
||||
echo " [FAIL] Unsupported OS: $OS"; exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Generate device ID
|
||||
@@ -39,11 +83,14 @@ echo " 3. Allow remote command execution for support"
|
||||
echo " 4. Press Ctrl+C or close terminal to disconnect"
|
||||
echo ""
|
||||
printf " Continue? (y/N) "
|
||||
read -r confirm
|
||||
if read -r confirm < /dev/tty 2>/dev/null; then
|
||||
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
|
||||
echo " Cancelled."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "y (auto)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Download agent
|
||||
|
||||
BIN
website/downloads/agent-mac-intel
Executable file
BIN
website/downloads/agent-mac-intel
Executable file
Binary file not shown.
@@ -380,12 +380,46 @@ bash ~/.uclaw/start.command
|
||||
|
||||
<div class="tip"><strong>改模型?</strong>编辑 <code>~/.uclaw/data/.openclaw/openclaw.json</code>,改完自动生效(热加载)</div>
|
||||
|
||||
<h2>卸载</h2>
|
||||
<pre><code># Mac / Linux
|
||||
<h2 style="color:var(--red)">一键卸载</h2>
|
||||
<p style="color:var(--dim);margin-bottom:16px">不想用了?一行命令彻底清理,不留残余。</p>
|
||||
|
||||
<div class="card" style="border-color:var(--red)">
|
||||
<h3 style="margin-top:0;color:var(--red)">Mac / Linux</h3>
|
||||
<pre><code>curl -fsSL https://u-claw.org/uninstall.sh | bash</code></pre>
|
||||
<p style="color:var(--dim);margin-top:8px">或者手动执行:</p>
|
||||
<pre><code># 1. 停止 OpenClaw(如果正在运行)
|
||||
pkill -f openclaw 2>/dev/null
|
||||
|
||||
# 2. 删除安装目录(包含所有数据)
|
||||
rm -rf ~/.uclaw
|
||||
|
||||
# Windows (PowerShell)
|
||||
Remove-Item -Recurse -Force "$env:USERPROFILE\.uclaw"</code></pre>
|
||||
# 3. 确认干净
|
||||
ls ~/.uclaw 2>/dev/null || echo "已完全卸载 ✓"</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border-color:var(--red)">
|
||||
<h3 style="margin-top:0;color:var(--red)">Windows(PowerShell 管理员)</h3>
|
||||
<pre><code>irm https://u-claw.org/uninstall.ps1 | iex</code></pre>
|
||||
<p style="color:var(--dim);margin-top:8px">或者手动执行:</p>
|
||||
<pre><code># 1. 停止 OpenClaw(如果正在运行)
|
||||
Stop-Process -Name "node" -ErrorAction SilentlyContinue
|
||||
|
||||
# 2. 删除安装目录(包含所有数据)
|
||||
Remove-Item -Recurse -Force "$env:USERPROFILE\.uclaw"
|
||||
|
||||
# 3. 确认干净
|
||||
if (-not (Test-Path "$env:USERPROFILE\.uclaw")) { Write-Host "已完全卸载 ✓" }</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tip" style="border-color:var(--yellow);background:rgba(250,204,21,.06)">
|
||||
<strong>卸载前请注意:</strong>
|
||||
<ul style="margin-top:8px;color:var(--dim)">
|
||||
<li>如果有重要对话记录,先备份 <code>~/.uclaw/data/</code> 目录</li>
|
||||
<li>卸载会删除:OpenClaw 核心、Node.js 运行时、所有技能、模型配置、对话记录</li>
|
||||
<li>不影响系统上其他 Node.js 安装(U-Claw 用的是独立运行时)</li>
|
||||
<li>想重装?再跑一次一键安装命令即可</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h2>与其他安装方式对比</h2>
|
||||
<table>
|
||||
@@ -1844,7 +1878,7 @@ docker compose up -d</code></pre>
|
||||
<p style="color:var(--dim);font-size:1.05em;margin-bottom:24px">安装遇到问题?模型配不好?技能不生效?扫码加微信,专业工程师远程帮你搞定。</p>
|
||||
|
||||
<div class="card" style="border-color:var(--green)">
|
||||
<h3 style="margin-top:0;color:var(--green)">方式一:Agent 远程控制(推荐)</h3>
|
||||
<h3 style="margin-top:0;color:var(--green)">一键安装 — Agent 远程控制(推荐)</h3>
|
||||
<p>轻量快速,单文件无依赖,一行命令即可上线:</p>
|
||||
|
||||
<h4>Windows(PowerShell)</h4>
|
||||
@@ -1857,6 +1891,22 @@ docker compose up -d</code></pre>
|
||||
<p style="margin-top:8px"><a href="agent.html" style="color:var(--cyan);font-weight:bold">📖 不会操作?查看图文教程 →</a></p>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border-color:var(--red)">
|
||||
<h3 style="margin-top:0;color:var(--red)">一键卸载 — 彻底清理 Agent</h3>
|
||||
<p>维护完成后想彻底清理?一行命令搞定:</p>
|
||||
|
||||
<h4>Windows(PowerShell)</h4>
|
||||
<pre><code>irm https://u-claw.org/agent.ps1 | iex -Args '--uninstall'</code></pre>
|
||||
|
||||
<h4>Mac / Linux</h4>
|
||||
<pre><code>curl -fsSL https://u-claw.org/agent.sh | bash -s -- --uninstall</code></pre>
|
||||
|
||||
<p style="color:var(--dim);margin-top:12px">会停止正在运行的 Agent 进程并删除所有下载的文件。</p>
|
||||
<div class="tip" style="border-color:var(--yellow);background:rgba(250,204,21,.06);margin-top:12px">
|
||||
<strong>其实通常不需要手动卸载:</strong>关闭终端窗口 Agent 就会自动停止并清理文件;2 小时后自动断开;文件在临时目录,系统重启也会清理。
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border-color:var(--border)">
|
||||
<h3 style="margin-top:0;color:var(--dim)">方式二:SSH 深度远程(高级)</h3>
|
||||
<p style="color:var(--dim)">需要文件传输、完整终端等深度操作时使用:</p>
|
||||
|
||||
Reference in New Issue
Block a user