Files
grok-build-hud/scripts/install.sh
T
Redredchen01 e32e0df209 Make Chinese README primary; ship English as README.en.md
Restructure docs so README.md is full Chinese documentation with TOC.
English content moves to README.en.md; drop README.zh-CN.md. Align
CONTRIBUTING, install script, package/plugin descriptions, and skill links.
2026-07-17 16:32:20 +08:00

59 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# One-shot installer for grok-build-hud (run from repo root or via: npm run setup)
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
need() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "error: missing dependency: $1" >&2
if [[ "$1" == "tmux" ]]; then
echo " macOS: brew install tmux" >&2
elif [[ "$1" == "node" ]]; then
echo " install Node.js 18+ from https://nodejs.org" >&2
fi
exit 1
fi
}
need node
need npm
if ! command -v tmux >/dev/null 2>&1; then
echo "warn: tmux not found — same-window HUD needs tmux (brew install tmux)" >&2
fi
NODE_MAJOR="$(node -p "process.versions.node.split('.')[0]")"
if [[ "$NODE_MAJOR" -lt 18 ]]; then
echo "error: Node.js 18+ required (found $(node -v))" >&2
exit 1
fi
echo "==> 安装依赖"
npm install
echo "==> 编译"
npm run build
echo "==> 链接 CLI 到 PATH (npm link)"
npm link
echo "==> 安装 dashboardhooks + tmux + shims"
node bin/grok-build-hud.js --install-dashboard
node bin/grok-build-hud.js --theme auto
node bin/grok-build-hud.js --preset full
echo ""
VER="$(node -e "import('node:fs').then(fs=>console.log(JSON.parse(fs.readFileSync('package.json','utf8')).version))" 2>/dev/null || echo 0.3.0)"
echo "完成。grok-build-hud v${VER}"
echo ""
echo " 启动 Grok + 底部 HUD grok"
echo " 看当前状态一次: grok-hud status"
echo " 设定(语言/预设): grok-hud settings"
echo " 主题跟随 Grok grok-build-hud --theme auto"
echo " 停止后台刷新: grok-hud stop"
echo ""
echo "文档(中文):README.md"
echo "English: README.en.md"
echo "若提示 command not found,把下面加入 PATH 后重开终端:"
echo " export PATH=\"\$(npm prefix -g)/bin:\$HOME/.local/bin:\$PATH\""