forked from labring/seakills
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
169 lines (141 loc) · 4.07 KB
/
install.sh
File metadata and controls
169 lines (141 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/env bash
set -euo pipefail
VERSION="1.1.1"
REPO="FullAgent/fulling-deploy"
# Canonical install location — single source of truth
CANONICAL_DIR="$HOME/.agents/skills"
VERSION_FILE="$CANONICAL_DIR/fulling-deploy/.version"
SKILLS=(
"fulling-deploy"
"dockerfile-skill"
"cloud-native-readiness"
)
# --- Flags ---
case "${1:-}" in
--version|-v)
if [ -f "$VERSION_FILE" ]; then
echo "fulling-deploy $(cat "$VERSION_FILE") (installed)"
else
echo "fulling-deploy not installed"
fi
echo "installer $VERSION"
exit 0
;;
--help|-h)
cat <<EOF
Fulling Deploy Installer v${VERSION}
Usage:
install.sh Install or update skills
install.sh --version Show installed version
install.sh --help Show this help
Install:
curl -fsSL https://raw.githubusercontent.com/${REPO}/main/install.sh | bash
Supports: Claude Code, Gemini CLI, Codex, and other .agents-compatible tools.
EOF
exit 0
;;
esac
# --- Detect installed AI agents ---
# Each entry: "display_name|skills_dir"
AGENTS=()
# Claude Code: ~/.claude/skills
CLAUDE_HOME="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
if [ -d "$CLAUDE_HOME" ]; then
AGENTS+=("Claude Code|$CLAUDE_HOME/skills")
fi
# Gemini CLI: ~/.gemini/skills
if [ -d "$HOME/.gemini" ]; then
AGENTS+=("Gemini CLI|$HOME/.gemini/skills")
fi
# Codex: ~/.codex/skills (or $CODEX_HOME/skills)
CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
if [ -d "$CODEX_HOME" ]; then
AGENTS+=("Codex|$CODEX_HOME/skills")
fi
# --- Detect install vs update ---
if [ -f "$VERSION_FILE" ]; then
OLD_VERSION=$(cat "$VERSION_FILE")
echo "Updating Fulling Deploy: ${OLD_VERSION} → ${VERSION}"
else
echo "Installing Fulling Deploy v${VERSION}..."
fi
echo ""
# --- Download repo ---
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
echo "Downloading..."
if command -v git &>/dev/null; then
git clone --depth 1 "https://github.com/${REPO}.git" "$tmp/repo" 2>/dev/null
else
curl -fsSL "https://github.com/${REPO}/archive/main.tar.gz" | tar -xz -C "$tmp"
mv "$tmp"/fulling-deploy-main "$tmp/repo"
fi
echo ""
# --- Step 1: Install to canonical location ~/.agents/skills/ ---
echo "Installing skills..."
mkdir -p "$CANONICAL_DIR"
for skill in "${SKILLS[@]}"; do
src="$tmp/repo/skills/$skill"
dest="$CANONICAL_DIR/$skill"
if [ ! -d "$src" ]; then
echo " ✗ $skill — not found, skipping"
continue
fi
rm -rf "$dest"
cp -R "$src" "$dest"
echo " ✓ $skill"
done
# Post-install: make scripts executable
chmod +x "$CANONICAL_DIR/fulling-deploy/scripts/"*.mjs 2>/dev/null || true
echo "$VERSION" > "$VERSION_FILE"
echo ""
# --- Step 2: Link to each detected agent ---
if [ ${#AGENTS[@]} -eq 0 ]; then
echo "No AI coding tools detected."
echo "Skills installed to: $CANONICAL_DIR"
echo "Manually symlink to your tool's skills directory if needed."
else
echo "Linking to detected agents..."
for entry in "${AGENTS[@]}"; do
agent_name="${entry%%|*}"
agent_dir="${entry##*|}"
# Skip if agent dir is the canonical dir itself
if [ "$agent_dir" = "$CANONICAL_DIR" ]; then
continue
fi
mkdir -p "$agent_dir"
agent_ok=true
for skill in "${SKILLS[@]}"; do
canonical_skill="$CANONICAL_DIR/$skill"
target="$agent_dir/$skill"
[ ! -d "$canonical_skill" ] && continue
# Remove old copy/link
rm -rf "$target"
# Try symlink first, fallback to copy
if ln -sfn "$canonical_skill" "$target" 2>/dev/null; then
: # symlink created
else
cp -R "$canonical_skill" "$target"
fi
done
if [ "$agent_ok" = true ]; then
echo " ✓ $agent_name → $agent_dir"
fi
done
fi
# --- Done ---
echo ""
echo "Fulling Deploy v${VERSION} ready."
echo ""
echo "Installed to: $CANONICAL_DIR (canonical)"
for entry in "${AGENTS[@]}"; do
agent_name="${entry%%|*}"
agent_dir="${entry##*|}"
[ "$agent_dir" = "$CANONICAL_DIR" ] && continue
echo " → $agent_name: $agent_dir (symlinked)"
done
echo ""
echo "Usage:"
echo " /fulling-deploy # process current project"
echo " /fulling-deploy <github-url> # process remote repo"
echo ""