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:
dongsheng123132
2026-04-13 17:47:03 +08:00
parent c4c9e829f4
commit c6e87b8183
4 changed files with 148 additions and 14 deletions

View File

@@ -30,6 +30,9 @@
.faq { background: #16213e; border-radius: 12px; padding: 20px; margin: 20px 0; } .faq { background: #16213e; border-radius: 12px; padding: 20px; margin: 20px 0; }
.faq h3 { color: #e94560; margin-bottom: 8px; font-size: 15px; } .faq h3 { color: #e94560; margin-bottom: 8px; font-size: 15px; }
.faq p { color: #aaa; font-size: 14px; margin-bottom: 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; } img.guide-img { width: 100%; border-radius: 8px; margin: 10px 0; }
</style> </style>
</head> </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> <p style="margin-top: 12px;"><strong>Device ID</strong>(如 <code style="background:#0f3460; padding:2px 8px; border-radius:4px;">desktop-a3f2</code>)发给技术支持即可。</p>
</div> </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 --> <!-- Safety -->
<div class="step" style="border: 1px solid #1b5e20;"> <div class="step" style="border: 1px solid #1b5e20;">
<h2 style="color: #4caf50;">安全说明</h2> <h2 style="color: #4caf50;">安全说明</h2>
@@ -181,6 +214,10 @@
document.querySelectorAll('[id^="cmd-"][id$="-wrap"]').forEach(c => c.classList.remove('active')); document.querySelectorAll('[id^="cmd-"][id$="-wrap"]').forEach(c => c.classList.remove('active'));
const cmdName = name === 'win' ? 'win' : name === 'mac' ? 'mac' : 'linux'; const cmdName = name === 'win' ? 'win' : name === 'mac' ? 'mac' : 'linux';
document.getElementById('cmd-' + cmdName + '-wrap').classList.add('active'); 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) { function copyCmd(id) {

View File

@@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
# ============================================================ # ============================================================
# U-Claw Remote Agent (macOS / Linux) # 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 set -e
@@ -12,12 +14,54 @@ TIMEOUT_HOURS=2
AGENT_DIR="/tmp/uclaw" AGENT_DIR="/tmp/uclaw"
AGENT_PATH="$AGENT_DIR/agent" 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:]') OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$OS" in case "$OS" in
darwin) DOWNLOAD_URL="https://u-claw.org/downloads/agent" ;; darwin)
linux) DOWNLOAD_URL="https://u-claw.org/downloads/agent-linux" ;; case "$ARCH" in
*) echo " [FAIL] Unsupported OS: $OS"; exit 1 ;; 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 esac
# Generate device ID # Generate device ID
@@ -39,10 +83,13 @@ echo " 3. Allow remote command execution for support"
echo " 4. Press Ctrl+C or close terminal to disconnect" echo " 4. Press Ctrl+C or close terminal to disconnect"
echo "" echo ""
printf " Continue? (y/N) " printf " Continue? (y/N) "
read -r confirm if read -r confirm < /dev/tty 2>/dev/null; then
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
echo " Cancelled." echo " Cancelled."
exit 0 exit 0
fi
else
echo "y (auto)"
fi fi
echo "" echo ""

BIN
website/downloads/agent-mac-intel Executable file

Binary file not shown.

View File

@@ -380,12 +380,46 @@ bash ~/.uclaw/start.command
<div class="tip"><strong>改模型?</strong>编辑 <code>~/.uclaw/data/.openclaw/openclaw.json</code>,改完自动生效(热加载)</div> <div class="tip"><strong>改模型?</strong>编辑 <code>~/.uclaw/data/.openclaw/openclaw.json</code>,改完自动生效(热加载)</div>
<h2>卸载</h2> <h2 style="color:var(--red)">一键卸载</h2>
<pre><code># Mac / Linux <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 rm -rf ~/.uclaw
# Windows (PowerShell) # 3. 确认干净
Remove-Item -Recurse -Force "$env:USERPROFILE\.uclaw"</code></pre> 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)">WindowsPowerShell 管理员)</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> <h2>与其他安装方式对比</h2>
<table> <table>
@@ -1844,7 +1878,7 @@ docker compose up -d</code></pre>
<p style="color:var(--dim);font-size:1.05em;margin-bottom:24px">安装遇到问题?模型配不好?技能不生效?扫码加微信,专业工程师远程帮你搞定。</p> <p style="color:var(--dim);font-size:1.05em;margin-bottom:24px">安装遇到问题?模型配不好?技能不生效?扫码加微信,专业工程师远程帮你搞定。</p>
<div class="card" style="border-color:var(--green)"> <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> <p>轻量快速,单文件无依赖,一行命令即可上线:</p>
<h4>WindowsPowerShell</h4> <h4>WindowsPowerShell</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> <p style="margin-top:8px"><a href="agent.html" style="color:var(--cyan);font-weight:bold">📖 不会操作?查看图文教程 →</a></p>
</div> </div>
<div class="card" style="border-color:var(--red)">
<h3 style="margin-top:0;color:var(--red)">一键卸载 — 彻底清理 Agent</h3>
<p>维护完成后想彻底清理?一行命令搞定:</p>
<h4>WindowsPowerShell</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)"> <div class="card" style="border-color:var(--border)">
<h3 style="margin-top:0;color:var(--dim)">方式二SSH 深度远程(高级)</h3> <h3 style="margin-top:0;color:var(--dim)">方式二SSH 深度远程(高级)</h3>
<p style="color:var(--dim)">需要文件传输、完整终端等深度操作时使用:</p> <p style="color:var(--dim)">需要文件传输、完整终端等深度操作时使用:</p>