-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget.sh
More file actions
executable file
·159 lines (140 loc) · 5.19 KB
/
get.sh
File metadata and controls
executable file
·159 lines (140 loc) · 5.19 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
#!/usr/bin/env bash
# cue — one-line installer
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/opencue/claude-code-skills/main/get.sh | bash
# curl -fsSL https://raw.githubusercontent.com/opencue/claude-code-skills/main/get.sh | bash -s -- --yes
#
# Environment variables:
# CUE_DIR — where to clone (default: ~/Documents/cue)
# CUE_BRANCH — git branch to clone (default: main)
set -euo pipefail
CUE_DIR="${CUE_DIR:-$HOME/Documents/cue}"
CUE_BRANCH="${CUE_BRANCH:-main}"
CUE_REPO="https://github.com/opencue/claude-code-skills.git"
# Colors
if [ -t 2 ] && [ -t 1 ]; then
ORANGE='\033[38;5;208m'
GREEN='\033[38;5;82m'
CYAN='\033[38;5;81m'
DIM='\033[2m'
BOLD='\033[1m'
RED='\033[38;5;196m'
YELLOW='\033[38;5;220m'
RESET='\033[0m'
BG='\033[48;5;235m'
else
ORANGE='' GREEN='' CYAN='' DIM='' BOLD='' RED='' YELLOW='' RESET='' BG=''
fi
say() { printf '%s\n' "$*" >&2; }
ok() { say " ${GREEN}✓${RESET} $*"; }
warn() { say " ${YELLOW}⚠${RESET} $*"; }
err() { say " ${RED}✗${RESET} $*"; }
die() { err "$*"; exit 1; }
step() { say ""; say "${ORANGE}━━━ $1 ━━━${RESET}"; }
# Banner
say ""
say "${ORANGE} ██████╗██╗ ██╗███████╗${RESET}"
say "${ORANGE} ██╔════╝██║ ██║██╔════╝${RESET}"
say "${ORANGE} ██║ ██║ ██║█████╗ ${RESET}"
say "${ORANGE} ██║ ██║ ██║██╔══╝ ${RESET}"
say "${ORANGE} ╚██████╗╚██████╔╝███████╗${RESET}"
say "${ORANGE} ╚═════╝ ╚═════╝ ╚══════╝${RESET}"
say ""
say " ${BOLD}Agent Profile Manager${RESET} for Claude Code & Codex"
say " ${DIM}https://github.com/opencue/claude-code-skills${RESET}"
say " ${DIM}npm: cue-ai${RESET}"
say ""
# Step 1: Prerequisites
step "Step 1/4 — checking prerequisites"
if ! command -v git >/dev/null 2>&1; then
die "git is required. Install it first:
macOS: xcode-select --install
Ubuntu: sudo apt install git
Fedora: sudo dnf install git"
fi
ok "git $(git --version | cut -d' ' -f3)"
if ! command -v bun >/dev/null 2>&1; then
say " ${DIM}Installing bun...${RESET}"
curl -fsSL https://bun.sh/install | bash >/dev/null 2>&1
export PATH="$HOME/.bun/bin:$PATH"
if ! command -v bun >/dev/null 2>&1; then
die "bun install failed. Install manually: https://bun.sh"
fi
ok "bun installed ($(bun --version))"
else
ok "bun $(bun --version)"
fi
# Step 2: Clone/update repo
step "Step 2/4 — installing cue"
if [ -d "$CUE_DIR/.git" ]; then
say " ${DIM}Updating existing install at ${CUE_DIR}...${RESET}"
cd "$CUE_DIR"
git pull --ff-only origin "$CUE_BRANCH" 2>/dev/null || true
ok "repo updated"
else
say " ${DIM}Cloning to ${CUE_DIR}...${RESET}"
git clone --depth 1 --branch "$CUE_BRANCH" "$CUE_REPO" "$CUE_DIR" 2>/dev/null
ok "cloned"
fi
# Step 3: Install dependencies
step "Step 3/4 — installing dependencies"
cd "$CUE_DIR"
bun install --frozen-lockfile 2>/dev/null || bun install 2>/dev/null
ok "dependencies installed"
# Verify binary
if "$CUE_DIR/bin/cue" --version >/dev/null 2>&1; then
ok "cue $($CUE_DIR/bin/cue --version) works"
else
die "cue binary check failed"
fi
# Step 4: Set up PATH + shims
step "Step 4/4 — setting up PATH"
SHIM_DIR="$HOME/.local/bin"
mkdir -p "$SHIM_DIR"
# Symlink cue
if [ -L "$SHIM_DIR/cue" ] || [ -f "$SHIM_DIR/cue" ]; then
rm -f "$SHIM_DIR/cue"
fi
ln -s "$CUE_DIR/bin/cue" "$SHIM_DIR/cue"
ok "cue → $SHIM_DIR/cue"
# Claude shim
cat > "$SHIM_DIR/claude" << 'SHIM'
#!/usr/bin/env bash
exec "$(dirname "$(readlink -f "$0")")/cue" launch claude "$@"
SHIM
chmod +x "$SHIM_DIR/claude"
ok "claude shim → $SHIM_DIR/claude"
# Check PATH
if echo "$PATH" | tr ':' '\n' | grep -qx "$SHIM_DIR"; then
ok "$SHIM_DIR is on PATH"
else
warn "$SHIM_DIR is NOT on PATH"
say " ${DIM}Add to your shell rc:${RESET}"
say " ${CYAN}export PATH=\"\$HOME/.local/bin:\$PATH\"${RESET}"
fi
# Done!
say ""
say "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
say "${GREEN} ✓ cue installed successfully!${RESET}"
say "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
say ""
say " ${BOLD}Get started:${RESET}"
say ""
say " ${CYAN}cd ~/your-project${RESET}"
say " ${CYAN}cue init${RESET} ${DIM}# set up a profile${RESET}"
say " ${CYAN}claude${RESET} ${DIM}# launch with profile${RESET}"
say ""
say " ${BOLD}Useful commands:${RESET}"
say ""
say " ${CYAN}cue list${RESET} ${DIM}# show profiles${RESET}"
say " ${CYAN}cue optimizer${RESET} ${DIM}# visual dashboard${RESET}"
say " ${CYAN}cue marketplace search \"X\"${RESET} ${DIM}# find MCPs/skills${RESET}"
say " ${CYAN}cue --help${RESET} ${DIM}# all commands${RESET}"
say ""
say " ${BOLD}Shell hook${RESET} (auto-switch profile on cd):"
say ""
say " ${CYAN}echo 'eval \"\$(cue shell hook)\"' >> ~/.bashrc${RESET}"
say ""
say " ${DIM}Docs: $CUE_DIR/README.md${RESET}"
say ""