-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·196 lines (169 loc) · 6 KB
/
install.sh
File metadata and controls
executable file
·196 lines (169 loc) · 6 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/bin/sh
# Orchestra Installer Script
# Usage: curl -sSL https://raw.githubusercontent.com/coopermaruyama/orchestra/main/install.sh | sh
# or: wget -qO- https://raw.githubusercontent.com/coopermaruyama/orchestra/main/install.sh | sh
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Detect OS
OS="$(uname -s)"
ARCH="$(uname -m)"
echo "${BLUE}🎼 Orchestra Installer${NC}"
echo "===================================="
echo ""
# Check for required tools
check_command() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "${RED}❌ Error: $1 is required but not installed.${NC}"
echo "Please install $1 and try again."
exit 1
fi
}
# Check Python
check_python() {
if command -v python3 >/dev/null 2>&1; then
PYTHON_CMD="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_CMD="python"
else
echo "${RED}❌ Error: Python is required but not installed.${NC}"
echo "Please install Python 3.8+ and try again."
exit 1
fi
# Check Python version
PYTHON_VERSION=$($PYTHON_CMD -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
if [ "$MAJOR" -lt 3 ] || ([ "$MAJOR" -eq 3 ] && [ "$MINOR" -lt 8 ]); then
echo "${RED}❌ Error: Python 3.8+ is required (found $PYTHON_VERSION)${NC}"
exit 1
fi
echo "✅ Found Python $PYTHON_VERSION"
}
# Check for required commands
check_command git
check_command curl
check_python
# Check for pipx first
HAS_PIPX=0
if command -v pipx >/dev/null 2>&1; then
echo "✅ Found pipx (recommended)"
HAS_PIPX=1
elif ! $PYTHON_CMD -m pip --version >/dev/null 2>&1; then
echo "${RED}❌ Error: pip is required but not installed.${NC}"
echo "Installing pip..."
curl -sSL https://bootstrap.pypa.io/get-pip.py | $PYTHON_CMD
fi
# Create temporary directory
TEMP_DIR=$(mktemp -d)
trap "rm -rf $TEMP_DIR" EXIT
echo ""
echo "📦 Downloading Orchestra..."
# Clone the repository
cd "$TEMP_DIR"
if ! git clone --depth 1 https://github.com/coopermaruyama/orchestra.git >/dev/null 2>&1; then
echo "${RED}❌ Error: Failed to download Orchestra${NC}"
echo "Please check your internet connection and try again."
exit 1
fi
cd orchestra
echo "🔧 Installing Orchestra..."
# Install with pipx or pip
if [ "$HAS_PIPX" = "1" ]; then
echo "📦 Using pipx for isolated installation..."
if pipx install . >/dev/null 2>&1; then
echo "${GREEN}✅ Orchestra installed successfully with pipx!${NC}"
elif pipx install --force . >/dev/null 2>&1; then
echo "${GREEN}✅ Orchestra updated successfully with pipx!${NC}"
else
echo "${YELLOW}⚠️ pipx install failed, falling back to pip...${NC}"
HAS_PIPX=0
fi
fi
if [ "$HAS_PIPX" = "0" ]; then
echo "📦 Using pip for installation..."
if $PYTHON_CMD -m pip install --user . >/dev/null 2>&1; then
echo "${GREEN}✅ Orchestra installed successfully!${NC}"
else
echo "${YELLOW}⚠️ User install failed, trying with --break-system-packages...${NC}"
if $PYTHON_CMD -m pip install --user --break-system-packages . >/dev/null 2>&1; then
echo "${GREEN}✅ Orchestra installed successfully!${NC}"
else
echo "${RED}❌ Error: Failed to install Orchestra${NC}"
echo "Please try manual installation:"
echo " git clone https://github.com/coopermaruyama/orchestra.git"
echo " cd orchestra"
echo " pip install ."
exit 1
fi
fi
fi
# Check if orchestra is in PATH
if ! command -v orchestra >/dev/null 2>&1; then
echo ""
echo "${YELLOW}⚠️ Orchestra installed but not in PATH${NC}"
echo ""
if [ "$HAS_PIPX" = "1" ]; then
# pipx specific instructions
echo "Run the following command:"
echo ""
echo " ${GREEN}pipx ensurepath${NC}"
echo ""
echo "Then restart your terminal or reload your shell configuration."
else
# pip specific instructions
# Detect shell and provide instructions
if [ -n "$BASH_VERSION" ]; then
SHELL_RC="$HOME/.bashrc"
SHELL_NAME="bash"
elif [ -n "$ZSH_VERSION" ]; then
SHELL_RC="$HOME/.zshrc"
SHELL_NAME="zsh"
else
SHELL_RC="$HOME/.profile"
SHELL_NAME="sh"
fi
# Find where pip installed the script
USER_BASE=$($PYTHON_CMD -m site --user-base)
USER_BIN="$USER_BASE/bin"
if [ -f "$USER_BIN/orchestra" ]; then
echo "Add the following to your $SHELL_RC:"
echo ""
echo " export PATH=\"\$PATH:$USER_BIN\""
echo ""
echo "Then reload your shell:"
echo " source $SHELL_RC"
echo ""
echo "Or for immediate use, run:"
echo " export PATH=\"\$PATH:$USER_BIN\""
fi
fi
fi
echo ""
echo "${BLUE}🎼 Orchestra Installation Complete!${NC}"
echo ""
echo "Next steps:"
echo "1. ${YELLOW}Enable all extensions:${NC}"
echo " ${GREEN}orchestra enable${NC}"
echo ""
echo "2. ${YELLOW}Or enable specific extensions:${NC}"
echo " ${GREEN}orchestra enable task${NC} # Task focus & tracking"
echo " ${GREEN}orchestra enable timemachine${NC} # Conversation checkpoints"
echo " ${GREEN}orchestra enable tester${NC} # Automated testing"
echo ""
echo "3. ${YELLOW}Use in Claude Code:${NC}"
echo " ${GREEN}/task start${NC} # Start a focused task"
echo " ${GREEN}/timemachine list${NC} # View checkpoints"
echo " ${GREEN}/tester calibrate${NC} # Set up testing"
echo ""
if [ "$HAS_PIPX" = "0" ]; then
echo "💡 ${YELLOW}Tip:${NC} For better Python app isolation, install pipx:"
echo " ${GREEN}$PYTHON_CMD -m pip install --user pipx${NC}"
echo ""
fi
echo "For more info: https://github.com/coopermaruyama/orchestra"
echo ""