Last active
July 1, 2026 02:25
-
-
Save matsubo/61f99643df9bd5c41cc690aca1e5348e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| WORKER_URL="${MINEDIA_MCP_URL:-https://cloudflare-mcp-gateway.yuki-matsukura.workers.dev}" | |
| SKILLS_DIR="$HOME/.claude/skills" | |
| MANIFEST="$SKILLS_DIR/.minedia-manifest" | |
| TMP_TARBALL="$(mktemp)" | |
| trap 'rm -f "$TMP_TARBALL"' EXIT | |
| # 1. cloudflared 存在チェック | |
| if ! command -v cloudflared >/dev/null 2>&1; then | |
| echo "ERROR: cloudflared が見つかりません。" >&2 | |
| echo " https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/ からインストールしてください。" >&2 | |
| exit 1 | |
| fi | |
| # 2. Google Workspace SSO ログイン | |
| echo "Google Workspace にログインします(ブラウザが開きます)..." | |
| cloudflared access login "$WORKER_URL" | |
| TOKEN="$(cloudflared access token -app="$WORKER_URL")" | |
| if [ -z "$TOKEN" ]; then | |
| echo "ERROR: トークン取得に失敗しました。" >&2 | |
| exit 1 | |
| fi | |
| mkdir -p "$SKILLS_DIR" | |
| # 3. manifest と tarball を取得 | |
| curl -fsSL -H "cf-access-token: $TOKEN" "$WORKER_URL/skills/manifest.txt" -o "$MANIFEST" | |
| curl -fsSL -H "cf-access-token: $TOKEN" "$WORKER_URL/skills/skills.tar.gz" -o "$TMP_TARBALL" | |
| # 4. 展開(同名スキルは上書き。旧スキルの自動削除はしない) | |
| tar xzf "$TMP_TARBALL" -C "$SKILLS_DIR" | |
| echo "" | |
| echo "✅ スキルをインストールしました: $(wc -l < "$MANIFEST" | tr -d ' ') 件" | |
| echo " 配置先: $SKILLS_DIR" | |
| echo " Claude Code を再起動してください。" | |
| # 5. UC2 MCP 接続(UC2 実装後にコメント解除) | |
| # claude mcp add --transport http minedia-gw "$WORKER_URL/mcp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment