forked from buildermethods/agent-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
180 lines (163 loc) · 6.9 KB
/
setup.sh
File metadata and controls
180 lines (163 loc) · 6.9 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
#!/bin/bash
# Agent OS Setup Script
# This script installs Agent OS files to your system
set -e # Exit on error
# Initialize flags
OVERWRITE_INSTRUCTIONS=false
OVERWRITE_STANDARDS=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--overwrite-instructions)
OVERWRITE_INSTRUCTIONS=true
shift
;;
--overwrite-standards)
OVERWRITE_STANDARDS=true
shift
;;
-h|--help)
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --overwrite-instructions Overwrite existing instruction files"
echo " --overwrite-standards Overwrite existing standards files"
echo " -h, --help Show this help message"
echo ""
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
echo "🚀 Agent OS Setup Script"
echo "========================"
echo ""
# Base URL for raw GitHub content
BASE_URL="https://raw.githubusercontent.com/buildermethods/agent-os/main"
# Create directories
echo "📁 Creating directories..."
mkdir -p "$HOME/.agent-os/standards"
mkdir -p "$HOME/.agent-os/instructions"
# Download standards files
echo ""
echo "📥 Downloading standards files to ~/.agent-os/standards/"
# tech-stack.md
if [ -f "$HOME/.agent-os/standards/tech-stack.md" ] && [ "$OVERWRITE_STANDARDS" = false ]; then
echo " ⚠️ ~/.agent-os/standards/tech-stack.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/standards/tech-stack.md" "${BASE_URL}/standards/tech-stack.md"
if [ -f "$HOME/.agent-os/standards/tech-stack.md" ] && [ "$OVERWRITE_STANDARDS" = true ]; then
echo " ✓ ~/.agent-os/standards/tech-stack.md (overwritten)"
else
echo " ✓ ~/.agent-os/standards/tech-stack.md"
fi
fi
# code-style.md
if [ -f "$HOME/.agent-os/standards/code-style.md" ] && [ "$OVERWRITE_STANDARDS" = false ]; then
echo " ⚠️ ~/.agent-os/standards/code-style.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/standards/code-style.md" "${BASE_URL}/standards/code-style.md"
if [ -f "$HOME/.agent-os/standards/code-style.md" ] && [ "$OVERWRITE_STANDARDS" = true ]; then
echo " ✓ ~/.agent-os/standards/code-style.md (overwritten)"
else
echo " ✓ ~/.agent-os/standards/code-style.md"
fi
fi
# best-practices.md
if [ -f "$HOME/.agent-os/standards/best-practices.md" ] && [ "$OVERWRITE_STANDARDS" = false ]; then
echo " ⚠️ ~/.agent-os/standards/best-practices.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/standards/best-practices.md" "${BASE_URL}/standards/best-practices.md"
if [ -f "$HOME/.agent-os/standards/best-practices.md" ] && [ "$OVERWRITE_STANDARDS" = true ]; then
echo " ✓ ~/.agent-os/standards/best-practices.md (overwritten)"
else
echo " ✓ ~/.agent-os/standards/best-practices.md"
fi
fi
# Download instruction files
echo ""
echo "📥 Downloading instruction files to ~/.agent-os/instructions/"
# plan-product.md
if [ -f "$HOME/.agent-os/instructions/plan-product.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = false ]; then
echo " ⚠️ ~/.agent-os/instructions/plan-product.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/instructions/plan-product.md" "${BASE_URL}/instructions/plan-product.md"
if [ -f "$HOME/.agent-os/instructions/plan-product.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = true ]; then
echo " ✓ ~/.agent-os/instructions/plan-product.md (overwritten)"
else
echo " ✓ ~/.agent-os/instructions/plan-product.md"
fi
fi
# create-spec.md
if [ -f "$HOME/.agent-os/instructions/create-spec.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = false ]; then
echo " ⚠️ ~/.agent-os/instructions/create-spec.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/instructions/create-spec.md" "${BASE_URL}/instructions/create-spec.md"
if [ -f "$HOME/.agent-os/instructions/create-spec.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = true ]; then
echo " ✓ ~/.agent-os/instructions/create-spec.md (overwritten)"
else
echo " ✓ ~/.agent-os/instructions/create-spec.md"
fi
fi
# execute-tasks.md
if [ -f "$HOME/.agent-os/instructions/execute-tasks.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = false ]; then
echo " ⚠️ ~/.agent-os/instructions/execute-tasks.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/instructions/execute-tasks.md" "${BASE_URL}/instructions/execute-tasks.md"
if [ -f "$HOME/.agent-os/instructions/execute-tasks.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = true ]; then
echo " ✓ ~/.agent-os/instructions/execute-tasks.md (overwritten)"
else
echo " ✓ ~/.agent-os/instructions/execute-tasks.md"
fi
fi
# analyze-product.md
if [ -f "$HOME/.agent-os/instructions/analyze-product.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = false ]; then
echo " ⚠️ ~/.agent-os/instructions/analyze-product.md already exists - skipping"
else
curl -s -o "$HOME/.agent-os/instructions/analyze-product.md" "${BASE_URL}/instructions/analyze-product.md"
if [ -f "$HOME/.agent-os/instructions/analyze-product.md" ] && [ "$OVERWRITE_INSTRUCTIONS" = true ]; then
echo " ✓ ~/.agent-os/instructions/analyze-product.md (overwritten)"
else
echo " ✓ ~/.agent-os/instructions/analyze-product.md"
fi
fi
echo ""
echo "✅ Agent OS base installation complete!"
echo ""
echo "📍 Files installed to:"
echo " ~/.agent-os/standards/ - Your development standards"
echo " ~/.agent-os/instructions/ - Agent OS instructions"
echo ""
if [ "$OVERWRITE_INSTRUCTIONS" = false ] && [ "$OVERWRITE_STANDARDS" = false ]; then
echo "💡 Note: Existing files were skipped to preserve your customizations"
echo " Use --overwrite-instructions or --overwrite-standards to update specific files"
else
echo "💡 Note: Some files were overwritten based on your flags"
if [ "$OVERWRITE_INSTRUCTIONS" = false ]; then
echo " Existing instruction files were preserved"
fi
if [ "$OVERWRITE_STANDARDS" = false ]; then
echo " Existing standards files were preserved"
fi
fi
echo ""
echo "Next steps:"
echo ""
echo "1. Customize your coding standards in ~/.agent-os/standards/"
echo ""
echo "2. Install commands for your AI coding assistant(s):"
echo ""
echo " - Using Claude Code? Install the Claude Code commands with:"
echo " curl -sSL https://raw.githubusercontent.com/buildermethods/agent-os/main/setup-claude-code.sh | bash"
echo ""
echo " - Using Cursor? Install the Cursor commands with:"
echo " curl -sSL https://raw.githubusercontent.com/buildermethods/agent-os/main/setup-cursor.sh | bash"
echo ""
echo " - Using something else? See instructions at https://buildermethods.com/agent-os"
echo ""
echo "Learn more at https://buildermethods.com/agent-os"
echo ""