-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·59 lines (50 loc) · 1.47 KB
/
install.sh
File metadata and controls
executable file
·59 lines (50 loc) · 1.47 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
#!/usr/bin/env bash
set -euo pipefail
REPO_URL="${REPO_URL:-https://github.com/GloriaGuo/opencli-skill.git}"
TARGET="${1:-codex}"
CWD="$(pwd)"
resolve_target_dir() {
case "$1" in
codex)
printf '%s\n' "${CODEX_HOME:-$HOME/.codex}/skills/opencli"
;;
claude|claude-code)
printf '%s\n' "$HOME/.claude/skills/opencli"
;;
openclaw|openclaw-shared)
printf '%s\n' "$HOME/.openclaw/skills/opencli"
;;
openclaw-workspace)
printf '%s\n' "$CWD/skills/opencli"
;;
*)
cat <<'EOF' >&2
Usage: ./install.sh [codex|claude|openclaw|openclaw-workspace]
Targets:
codex Install into ${CODEX_HOME:-$HOME/.codex}/skills/opencli
claude Install into ~/.claude/skills/opencli
openclaw Install into ~/.openclaw/skills/opencli
openclaw-workspace Install into ./skills/opencli
EOF
exit 1
;;
esac
}
TARGET_DIR="$(resolve_target_dir "$TARGET")"
PARENT_DIR="$(dirname "$TARGET_DIR")"
mkdir -p "$PARENT_DIR"
if [[ -d "$TARGET_DIR/.git" ]]; then
echo "Updating existing install at $TARGET_DIR"
git -C "$TARGET_DIR" pull --ff-only
else
echo "Cloning $REPO_URL to $TARGET_DIR"
git clone "$REPO_URL" "$TARGET_DIR"
fi
cat <<EOF
Installed OpenCLI skill to:
$TARGET_DIR
Next steps:
1. Ensure OpenCLI is installed: npm install -g @jackwener/opencli
2. Run: opencli doctor
3. Trigger the skill with: Use \$opencli to inspect the installed OpenCLI surface and run a read-first workflow.
EOF