-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·63 lines (51 loc) · 1.81 KB
/
install.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.81 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
#!/bin/bash
# GStack for OpenCode Installation Script
# Robust version with error handling and backup
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "🚀 ${GREEN}Installing GStack for OpenCode...${NC}"
# Check for OpenCode
if ! command -v opencode &> /dev/null; then
echo -e "${RED}❌ OpenCode not found. Please install it first:${NC}"
echo " npm install -g opencode"
exit 1
fi
# Get directories
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_DIR="${HOME}/.config/opencode"
# Function to safely copy files
safe_copy() {
local src_dir="$1"
local dest_dir="$2"
local label="$3"
echo -e "📦 ${YELLOW}Installing ${label}...${NC}"
mkdir -p "${dest_dir}"
# Backup existing if any
if [ -d "${dest_dir}" ] && [ "$(ls -A "${dest_dir}" 2>/dev/null)" ]; then
# Optional: could add backup logic here if needed
:
fi
cp -v "${src_dir}/"*.md "${dest_dir}/" 2>/dev/null || true
}
# Install components
safe_copy "${SCRIPT_DIR}/agents" "${CONFIG_DIR}/agents" "agents"
safe_copy "${SCRIPT_DIR}/commands" "${CONFIG_DIR}/commands" "commands"
safe_copy "${SCRIPT_DIR}/skills" "${CONFIG_DIR}/skills" "skills"
echo -e "\n✅ ${GREEN}GStack for OpenCode installed successfully!${NC}"
echo -e "\n${YELLOW}Available commands:${NC}"
echo " /plan-ceo - CEO perspective review"
echo " /plan-eng - Engineering manager review"
echo " /design - UI/UX review"
echo " /review - Code review"
echo " /security - Security audit"
echo " /qa - QA testing"
echo " /docs - Documentation review"
echo " /ship - Release preparation"
echo -e "\nStart OpenCode in your project directory and try:"
echo " cd your-project"
echo " opencode"
echo " /plan-ceo 'your feature idea'"