40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Usage: ./bootstrap.sh [claude|opencode|codex|aider] [-f]
|
|
# Fetches bootstrap files from: https://trickey.us
|
|
|
|
TOOL=$1
|
|
FORCE=$2
|
|
BASE_URL="https://trickey.us/raw/branch/main"
|
|
FILES=("CLAUDE.md" "AGENT.md" "CONVENTIONS.md")
|
|
|
|
if [[ -z "$TOOL" ]]; then
|
|
echo "Usage: $0 [claude|opencode|codex|aider] [-f]"
|
|
exit 1
|
|
fi
|
|
|
|
case $TOOL in
|
|
claude|opencode|codex|aider)
|
|
echo "🚀 Bootstrapping $TOOL project using git.trickey.us..."
|
|
|
|
for FILE in "${FILES[@]}"; do
|
|
# Safety check: skip if exists unless -f is used
|
|
if [[ -f "$FILE" && "$FORCE" != "-f" ]]; then
|
|
echo "⏭️ Skipping $FILE (already exists). Use -f to overwrite."
|
|
continue
|
|
fi
|
|
|
|
# Fetch from the flat structure at the root of /AI/skills
|
|
curl -fsSL "$BASE_URL/$FILE" -o "$FILE" \
|
|
&& echo "✅ $([[ "$FORCE" == "-f" ]] && echo "Overwrote" || echo "Fetched") $FILE" \
|
|
|| echo "⚠️ Skipping $FILE (not found at source)"
|
|
done
|
|
|
|
echo "✨ Done! Files are ready in $(pwd)"
|
|
;;
|
|
*)
|
|
echo "❌ Error: Unsupported tool '$TOOL'"
|
|
exit 1
|
|
;;
|
|
esac
|