-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·63 lines (51 loc) · 1.22 KB
/
setup.sh
File metadata and controls
executable file
·63 lines (51 loc) · 1.22 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
#!/usr/bin/env bash
set -euo pipefail
# Project Template Setup
# Usage: ./setup.sh <project-name>
PROJECT_NAME="${1:-}"
if [ -z "$PROJECT_NAME" ]; then
echo "Usage: ./setup.sh <project-name>"
echo ""
echo "Example:"
echo " ./setup.sh my-app # Creates ~/my-app"
exit 1
fi
DEST="$HOME/$PROJECT_NAME"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -d "$DEST" ]; then
echo "Error: $DEST already exists"
exit 1
fi
echo "Creating project: $PROJECT_NAME"
# Copy template
cp -r "$SCRIPT_DIR" "$DEST"
# Clean up template artifacts
cd "$DEST"
rm -rf .git .beads setup.sh
# Initialize git
git init
git add -A
git commit -m "chore: initialize from project template"
# Initialize beads
if command -v bd &>/dev/null; then
bd init
bd hooks install
echo ""
echo "Beads initialized with git hooks."
else
echo ""
echo "Warning: 'bd' not found. Install beads and run:"
echo " cd $DEST && bd init && bd hooks install"
fi
if command -v openspec &>/dev/null; then
echo ""
echo "OpenSpec detected. Optional next step in your new project:"
echo " cd $DEST && openspec update"
fi
echo ""
echo "Project '$PROJECT_NAME' is ready at $DEST"
echo ""
echo "Next steps:"
echo " cd $DEST"
echo " claude"
echo " > /brain-dump"