- Hermes: config.yaml external_dirs 直接索引 ~/Code/skills/hermes/ - Cursor: setup.sh 一次性创建 symlink 到 ~/.cursor/rules/ - git pull 即生效,无需反复同步 - sync.sh → setup.sh(一次性) [小糯]
40 lines
1016 B
Bash
40 lines
1016 B
Bash
#!/bin/bash
|
|
# 一次性 setup:配置 skills 索引(无需重复运行)
|
|
# Hermes: 通过 external_dirs 直接索引 hermes/
|
|
# Cursor: symlink cursor/*.mdc → ~/.cursor/rules/
|
|
# 之后 git pull 即生效
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
echo "🔧 Skills 索引配置"
|
|
echo "========================"
|
|
|
|
# Cursor rules symlink
|
|
CURSOR_SOURCE="$SCRIPT_DIR/cursor"
|
|
CURSOR_TARGET="$HOME/.cursor/rules"
|
|
|
|
if [ -d "$CURSOR_SOURCE" ]; then
|
|
mkdir -p "$CURSOR_TARGET"
|
|
count=0
|
|
for f in "$CURSOR_SOURCE"/*.mdc; do
|
|
[ -f "$f" ] || continue
|
|
ln -sf "$f" "$CURSOR_TARGET/$(basename "$f")"
|
|
echo " 🔗 $(basename "$f")"
|
|
count=$((count + 1))
|
|
done
|
|
echo ""
|
|
echo "Cursor rules: $count 个 symlink → $CURSOR_TARGET"
|
|
fi
|
|
|
|
echo ""
|
|
echo "========================"
|
|
echo "✅ 完成"
|
|
echo ""
|
|
echo "⚠️ Hermes 需手动配置 config.yaml:"
|
|
echo " skills:"
|
|
echo " external_dirs: [\"~/Code/skills/hermes\"]"
|
|
echo ""
|
|
echo "之后更新只需: cd ~/Code/skills && git pull"
|