SuperAPI AI Directory

skill-installer

Coding & development

View repository

Updated 10-15 21:11

About this skill

cc-use-exp Skill Installer (Codex)

One-click installation of the cc-use-exp AI coding assistant configuration system into Codex CLI.


Usage

$skill-installer install https://github.com/doccker/cc-use-exp/.codex/skills/cc-skill-installer

Or specify a GitHub URL (future extension):

$skill-installer install https://github.com/doccker/cc-use-exp

Execution Steps

Step 1: Check installation status

INSTALL_DIR="$HOME/.codex/.cc-use-exp"

if [ -d "$INSTALL_DIR" ]; then
  echo "⚠️  检测到已安装"
  echo ""
  echo "安装位置: $INSTALL_DIR"
  echo ""
  cd "$INSTALL_DIR"
  echo "当前版本:"
  git log -1 --pretty=format:"%h - %s (%ar)" 2>/dev/null || echo "无法获取版本信息"
  echo ""
  echo ""
  echo "是否更新到最新版本?(y/N)"
  read -r response
  if [[ ! "$response" =~ ^[Yy]$ ]]; then
    echo "❌ 取消安装"
    exit 0
  fi
  echo "🔄 更新现有安装..."
  git pull origin main
else
  echo "📦 开始安装 cc-use-exp..."
  echo ""

  # 创建安装目录
  mkdir -p "$HOME/.codex"

  # Clone 仓库
  git clone https://github.com/doccker/cc-use-exp.git "$INSTALL_DIR"

  if [ $? -ne 0 ]; then
    echo "❌ 克隆失败,请检查网络连接"
    exit 1
  fi

  cd "$INSTALL_DIR"
  echo "✓ 仓库克隆完成"
fi

Step 2: Execute the sync script

echo ""
echo "🔧 同步配置到 Codex..."
echo ""

if [ -f "./tools/sync-config.sh" ]; then
  # 只执行 Codex 部分的同步
  CC_USE_EXP_SYNC_TARGETS=codex ./tools/sync-config.sh
else
  echo "❌ 错误:找不到同步脚本"
  exit 1
fi

Step 3: Display installation result

echo ""
echo "✅ 安装完成!"
echo ""
echo "📝 已同步配置到:"
echo "  - ~/.codex/AGENTS.md(受管区块)"
echo "  - ~/.codex/rules/"
echo "  - ~/.codex/instructions/"
echo "  - ~/.codex/*.config.toml(profiles)"
echo "  - ~/.agents/skills/"
echo ""
echo "🔄 配置已生效,无需重启"
echo ""
echo "💡 后续操作:"
echo "  - 更新配置:重新运行 \$skill-installer install"
echo "  - 查看状态:\$cc-status"
echo "  - 卸载:手动删除 $INSTALL_DIR 和上述配置"
echo ""
echo "📖 文档:https://github.com/doccker/cc-use-exp"

Error Handling

Network error:

if ! git clone ...; then
  echo "❌ 网络错误,请检查:"
  echo "  1. 网络连接是否正常"
  echo "  2. 是否可以访问 GitHub"
  echo "  3. 是否需要配置代理"
  exit 1
fi

Permission error:

if [ ! -w "$HOME/.codex" ]; then
  echo "❌ 权限错误:无法写入 ~/.codex/"
  echo "请检查目录权限"
  exit 1
fi

Notes

  • Installation location:~/.codex/.cc-use-exp/
  • Configuration synced to:~/.codex/、~/.agents/skills/
  • AGENTS.md Merge using managed blocks, profiles use separate *.config.toml files, will not overwrite user custom configurations
  • Supports repeated installation (automatically detects and prompts for updates)

Rule Provenance

> 📋 本回复遵循:`skill-installer` - cc-use-exp Codex 安装器