-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·124 lines (113 loc) · 3.68 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·124 lines (113 loc) · 3.68 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
#!/usr/bin/env bash
# IntelliKit Agent Skills Installer
# Downloads each tool's SKILL.md into a skills dir. Use --target to pick agent (agents/codex/cursor/claude/github).
# Usage: curl -sSL <install script URL> | bash -s -- [OPTIONS]
# or: ./install.sh [OPTIONS]
# CLI options override env (INTELLIKIT_RAW_URL). Use args when piping so overrides reach bash.
set -e
INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/AMDResearch/intellikit/main/install/skills/install.sh"
# Env default (--base-url overrides); use args when piping to bash so overrides apply
BASE_URL="${INTELLIKIT_RAW_URL:-https://raw.githubusercontent.com/AMDResearch/intellikit/main}"
TOOLS=(metrix accordo nexus linex kerncap)
DRY_RUN=false
GLOBAL=false
TARGET="agents"
print_usage() {
echo "IntelliKit Agent Skills Installer"
echo ""
echo "Usage:"
echo " curl -sSL ${INSTALL_SCRIPT_URL} | bash -s -- [OPTIONS]"
echo " ./install.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --target <name> Where to install: agents (default), codex, cursor, claude, github"
echo " agents -> .agents/skills or ~/.agents/skills"
echo " codex -> .codex/skills or ~/.codex/skills"
echo " cursor -> .cursor/skills or ~/.cursor/skills"
echo " claude -> .claude/skills or ~/.claude/skills"
echo " github -> .github/agents/skills or ~/.github/agents/skills"
echo " --global Use user-level dir (e.g. ~/.cursor/skills) instead of project-level"
echo " --base-url <url> Base URL for raw files (default from INTELLIKIT_RAW_URL or main branch)"
echo " --dry-run Show what would be downloaded without making changes"
echo " --help, -h Show this help message and exit"
echo ""
echo "Examples:"
echo " curl -sSL ${INSTALL_SCRIPT_URL} | bash -s -- --target cursor --dry-run"
echo " curl -sSL ${INSTALL_SCRIPT_URL} | bash -s -- --target claude --global"
}
require_arg() {
local opt="$1"
local val="$2"
if [[ -z "${val}" || "${val}" == -* ]]; then
echo "Missing or invalid value for ${opt}" >&2
exit 1
fi
}
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run) DRY_RUN=true; shift ;;
--global) GLOBAL=true; shift ;;
--help|-h) print_usage; exit 0 ;;
--base-url)
require_arg "$1" "${2:-}"
BASE_URL="$2"; shift 2
;;
--target)
require_arg "$1" "${2:-}"
TARGET="$2"; shift 2
;;
*)
echo "Unknown option: $1" >&2
echo "" >&2
print_usage >&2
exit 1
;;
esac
done
# Resolve SKILLS_ROOT from target and global
case "$TARGET" in
agents|codex|cursor|claude)
if [[ "$GLOBAL" == true ]]; then
SKILLS_ROOT="${HOME}/.${TARGET}/skills"
else
SKILLS_ROOT="${PWD}/.${TARGET}/skills"
fi
;;
github)
if [[ "$GLOBAL" == true ]]; then
SKILLS_ROOT="${HOME}/.github/agents/skills"
else
SKILLS_ROOT="${PWD}/.github/agents/skills"
fi
;;
*)
echo "Unknown target: $TARGET (use: agents, codex, cursor, claude, github)" >&2
exit 1
;;
esac
if [[ "$DRY_RUN" != true ]]; then
mkdir -p "$SKILLS_ROOT"
fi
for tool in "${TOOLS[@]}"; do
url="${BASE_URL}/${tool}/skill/SKILL.md"
dest_dir="${SKILLS_ROOT}/${tool}"
dest_file="${dest_dir}/SKILL.md"
if [[ "$DRY_RUN" == true ]]; then
echo "Would download: $url -> $dest_file"
continue
fi
mkdir -p "$dest_dir"
if curl -sSLf -o "$dest_file" "$url"; then
echo "Installed: $dest_file"
else
echo "Failed to download: $url" >&2
exit 1
fi
done
if [[ "$DRY_RUN" != true ]]; then
echo ""
echo "IntelliKit skills are in ${SKILLS_ROOT}:"
for tool in "${TOOLS[@]}"; do
echo " ${SKILLS_ROOT}/${tool}/SKILL.md"
done
fi