Files
AirCoding/AirPlan/docs/spec/AirPlanV2/scripts/install.sh
AirCoding ae44be31d5 chore: push all design docs, V2 plan specs, and current working state
Includes AirPlan design documents, AircOding-alpha1-plan, AirPlanV2,
AirPlan-ParaV2, AirPlan-Para V1 reference docs, and all working code
changes across packages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-12 17:12:29 +08:00

78 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
# AirPlan V2 安装脚本
# 自动安装依赖并配置 Claude Code 插件
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_NAME="airplan-v2"
SKILLS_DIR="$HOME/.claude/skills"
echo "=========================================="
echo "AirPlan V2 安装脚本"
echo "=========================================="
# 检查 Python 版本
echo "[1/6] 检查 Python 版本..."
python3 --version || { echo "错误: 需要 Python 3"; exit 1; }
# 检查必要工具
echo "[2/6] 检查必要工具..."
command -v git >/dev/null 2>&1 || { echo "错误: 需要 git"; exit 1; }
# 创建 skills 目录
echo "[3/6] 配置插件目录..."
mkdir -p "$SKILLS_DIR"
# 创建符号链接或克隆
if [ -L "$SKILLS_DIR/$PLUGIN_NAME" ]; then
echo "插件已存在: $SKILLS_DIR/$PLUGIN_NAME"
elif [ -d "$SKILLS_DIR/$PLUGIN_NAME" ]; then
echo "插件目录已存在,更新中..."
cd "$SKILLS_DIR/$PLUGIN_NAME"
git pull origin master
else
echo "从远程克隆插件..."
git clone http://git.airlongdian.fun/admin/AirPlan-V2.git "$SKILLS_DIR/$PLUGIN_NAME"
fi
# 验证安装
echo "[4/6] 验证安装..."
if [ ! -f "$SKILLS_DIR/$PLUGIN_NAME/.claude-plugin/plugin.json" ]; then
echo "错误: plugin.json 不存在"
exit 1
fi
if [ ! -f "$SKILLS_DIR/$PLUGIN_NAME/skills/airplan/SKILL.md" ]; then
echo "错误: SKILL.md 不存在"
exit 1
fi
# 检查依赖
echo "[5/6] 检查依赖..."
# 检查系统依赖(可选)
command -v xvfb-run >/dev/null 2>&1 && echo " - xvfb-run: ✓" || echo " - xvfb-run: ✗ (可选,用于无头 GUI 测试)"
command -v ffmpeg >/dev/null 2>&1 && echo " - ffmpeg: ✓" || echo " - ffmpeg: ✗ (可选,用于视频处理)"
command -v cmake >/dev/null 2>&1 && echo " - cmake: ✓" || echo " - cmake: ✗ (可选,用于 C++ 项目构建)"
echo "[6/6] 安装完成!"
echo ""
echo "=========================================="
echo "使用方法:"
echo " /arc - 架构规划"
echo " /eng - 调度引擎"
echo " /do - 任务执行"
echo " /dbg - 调试模式"
echo " /xdb - GUI 验证"
echo " /sdb - 静态分析"
echo " /ndb - 网络调试"
echo " /ctx - 上下文管理"
echo " /dep - 部署"
echo " /tst - 测试"
echo " /sec - 安全扫描"
echo " /rvr - 需求审查"
echo "=========================================="
# 提示重启 Claude Code
echo ""
echo "提示: 请重启 Claude Code 以加载新插件"