-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-opencode.sh
More file actions
53 lines (48 loc) · 1.7 KB
/
Copy pathinstall-opencode.sh
File metadata and controls
53 lines (48 loc) · 1.7 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
#!/usr/bin/env bash
# Install skills from somtimz/plugins into OpenCode
# OpenCode discovers skills from ~/.config/opencode/skills/
# Usage: bash install-opencode.sh [--uninstall]
set -euo pipefail
SKILL_TARGET="${OPENCODE_SKILLS_DIR:-$HOME/.config/opencode/skills}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILLS=(
plugins/ea-assistant/skills/archimate-notation
plugins/ea-assistant/skills/ea-artifact-templates
plugins/ea-assistant/skills/ea-document-ingestion
plugins/ea-assistant/skills/ea-engagement-lifecycle
plugins/ea-assistant/skills/ea-generation
plugins/ea-assistant/skills/ea-requirements-management
plugins/ea-assistant/skills/zachman-framework
plugins/ea-assistant/skills/ea-interview-ui
plugins/RAG-assistant/skills/doc-ingestion-pipeline
plugins/RAG-assistant/skills/rag-chat
plugins/ITIL-assistant/skills/itil-change-request
plugins/ITIL-assistant/skills/cab-review
)
if [[ "${1:-}" == "--uninstall" ]]; then
echo "Uninstalling skills from $SKILL_TARGET ..."
for skill_path in "${SKILLS[@]}"; do
skill_name=$(basename "$skill_path")
target="$SKILL_TARGET/$skill_name"
if [ -L "$target" ]; then
rm "$target"
echo " removed: $skill_name"
fi
done
echo "Done."
exit 0
fi
mkdir -p "$SKILL_TARGET"
echo "Installing skills into $SKILL_TARGET ..."
for skill_path in "${SKILLS[@]}"; do
skill_name=$(basename "$skill_path")
src="$SCRIPT_DIR/$skill_path"
target="$SKILL_TARGET/$skill_name"
if [ -e "$target" ] && [ ! -L "$target" ]; then
echo " skipped (exists, not a symlink): $skill_name"
continue
fi
ln -sfn "$src" "$target"
echo " linked: $skill_name → $src"
done
echo "Done. Restart OpenCode to pick up new skills."