DoHyun468/claw-hwp / plugins/claw-hwp/skills/hwp
hwp
Unverifiedscripts/launcher/preview-mac.command
View on GitHub#!/bin/bash
# claw-hwp local preview launcher (macOS)
# Place this next to a .hwp/.hwpx file and double-click. Or pass a file path.
set -e
cd "$(dirname "$0")"
FILE="${1:-}"
if [ -z "$FILE" ]; then
FILE=$(ls -t *.hwp *.hwpx 2>/dev/null | head -1)
fi
if [ -z "$FILE" ] || [ ! -f "$FILE" ]; then
echo "❌ No .hwp/.hwpx file found next to this script."
echo " Drop one in the same folder, or pass a path as argument."
read -p "Press Enter to close..."
exit 1
fi
FILE_ABS="$(cd "$(dirname "$FILE")" && pwd)/$(basename "$FILE")"
if ! command -v node >/dev/null 2>&1; then
echo "❌ Node.js 18+ required. Install from https://nodejs.org/"
read -p "Press Enter to close..."
exit 1
fi
SERVER=$(find "$HOME/.claude/plugins/cache" -path '*/claw-hwp/*/skills/hwp/scripts/preview-server.js' 2>/dev/null | sort -V | tail -1)
if [ -z "$SERVER" ]; then
CACHE="$HOME/.claw-hwp-launcher"
SERVER="$CACHE/scripts/preview-server.js"
if [ ! -f "$SERVER" ]; then
echo "⏬ First run — downloading preview server (~5MB) from GitHub..."
mkdir -p "$CACHE"
curl -fsSL https://codeload.github.com/DoHyun468/claw-hwp/tar.gz/main \
| tar -xz -C "$CACHE" --strip-components=5 \
claw-hwp-main/plugins/claw-hwp/skills/hwp/scripts \
|| { echo "❌ Download failed."; read -p "Press Enter to close..."; exit 1; }
fi
fi
if ! curl -fsS -o /dev/null http://127.0.0.1:3737/__heartbeat 2>/dev/null; then
echo "🚀 Starting preview server..."
node "$SERVER" >/tmp/claw-hwp-preview.log 2>&1 &
disown 2>/dev/null || true
for i in 1 2 3 4 5 6 7 8; do
sleep 0.3
curl -fsS -o /dev/null http://127.0.0.1:3737/__heartbeat 2>/dev/null && break
done
fi
URL_PATH=$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1]))" "$FILE_ABS" 2>/dev/null \
|| printf '%s' "$FILE_ABS" | sed 's/ /%20/g')
URL="http://localhost:3737/?path=$URL_PATH"
echo "✅ Opening $URL"
open "$URL"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |