-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·89 lines (78 loc) · 2.55 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·89 lines (78 loc) · 2.55 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
#!/usr/bin/env bash
# install.sh — copy the 17 skills into your agent's skills directory.
# Vendor-neutral SKILL.md skills. Works with Claude Code, opencode, Codex, Cursor, etc.
set -euo pipefail
SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/skills"
usage() {
cat <<USAGE
codex-skills-alternative installer
Usage: ./install.sh [--agent <name>] [--project] [--dry-run]
--agent <name> claude | opencode | codex | cursor | agents (default: auto-detect)
--project install into the current repo instead of your home dir
--dry-run print what would happen, copy nothing
--help show this help
With no --agent, the script installs to every detected agent (global scope).
USAGE
}
AGENT=""
PROJECT=0
DRY=0
while [ $# -gt 0 ]; do
case "$1" in
--agent) AGENT="${2:-}"; shift 2;;
--project) PROJECT=1; shift;;
--dry-run) DRY=1; shift;;
--help|-h) usage; exit 0;;
*) echo "unknown arg: $1" >&2; usage; exit 1;;
esac
done
# Resolve target dir for a given agent + scope.
target_dir() {
local agent="$1"
if [ "$PROJECT" -eq 1 ]; then
case "$agent" in
claude) echo ".claude/skills";;
opencode) echo ".opencode/skills";;
codex) echo ".codex/skills";;
cursor) echo ".cursor/skills";;
agents) echo ".agents/skills";;
esac
else
case "$agent" in
claude) echo "$HOME/.claude/skills";;
opencode) echo "$HOME/.config/opencode/skills";;
codex) echo "$HOME/.codex/skills";;
cursor) echo "$HOME/.cursor/skills";;
agents) echo "$HOME/.agents/skills";;
esac
fi
}
# Auto-detect installed agents by their config dirs.
detect_agents() {
local found=()
[ -d "$HOME/.claude" ] && found+=("claude")
[ -d "$HOME/.config/opencode" ] && found+=("opencode")
[ -d "$HOME/.codex" ] && found+=("codex")
[ -d "$HOME/.cursor" ] && found+=("cursor")
if [ ${#found[@]} -eq 0 ]; then found=("agents"); fi
printf '%s\n' "${found[@]}"
}
install_to() {
local agent="$1" dest
dest="$(target_dir "$agent")"
if [ -z "$dest" ]; then echo "skip: unknown agent '$agent'"; return; fi
echo "==> $agent -> $dest"
if [ "$DRY" -eq 1 ]; then
for d in "$SRC"/*/; do echo " would copy $(basename "$d")"; done
return
fi
mkdir -p "$dest"
cp -R "$SRC"/* "$dest"/
echo " installed $(find "$SRC" -maxdepth 1 -mindepth 1 -type d | wc -l | tr -d ' ') skills"
}
if [ -n "$AGENT" ]; then
install_to "$AGENT"
else
while IFS= read -r a; do install_to "$a"; done < <(detect_agents)
fi
echo "Done. Restart your agent if it doesn't watch the skills dir live."