-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
55 lines (47 loc) · 1.83 KB
/
install.sh
File metadata and controls
55 lines (47 loc) · 1.83 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
#!/usr/bin/env bash
set -e
REPO_RAW="https://raw.githubusercontent.com/elitex45/dualcode/main"
OPENCODE_DIR="$HOME/.config/opencode"
CLAUDE_MD="$HOME/.claude/CLAUDE.md"
SHELL_RC="$HOME/.zshrc"
[[ "$SHELL" == *"bash"* ]] && SHELL_RC="$HOME/.bashrc"
echo "Installing dualcode..."
mkdir -p "$OPENCODE_DIR"
curl -fsSL "$REPO_RAW/AGENTS.md" -o "$OPENCODE_DIR/AGENTS.md"
echo "✓ Installed AGENTS.md to $OPENCODE_DIR/AGENTS.md"
mkdir -p "$HOME/.claude"
touch "$CLAUDE_MD"
if grep -q "dualcode" "$CLAUDE_MD"; then
echo "✓ CLAUDE.md already contains dualcode protocol, skipping"
else
printf "\n---\n" >> "$CLAUDE_MD"
curl -fsSL "$REPO_RAW/CLAUDE-append.md" >> "$CLAUDE_MD"
echo "✓ Appended dualcode protocol to $CLAUDE_MD"
fi
if grep -q "create-project()" "$SHELL_RC" 2>/dev/null; then
echo "✓ create-project already exists in $SHELL_RC, skipping"
else
printf '\n# dualcode: create new project with linked AGENTS.md\n' >> "$SHELL_RC"
printf 'create-project() {\n' >> "$SHELL_RC"
printf ' if [ -z "$1" ]; then\n' >> "$SHELL_RC"
printf ' echo "Usage: create-project <folder-name>"\n' >> "$SHELL_RC"
printf ' return 1\n' >> "$SHELL_RC"
printf ' fi\n' >> "$SHELL_RC"
printf ' mkdir -p "$1"\n' >> "$SHELL_RC"
printf ' cd "$1"\n' >> "$SHELL_RC"
printf ' ln -s "%s/AGENTS.md" ./AGENTS.md\n' "$OPENCODE_DIR" >> "$SHELL_RC"
printf ' echo "✓ Created $1 with linked AGENTS.md"\n' >> "$SHELL_RC"
printf '}\n' >> "$SHELL_RC"
echo "✓ Added create-project to $SHELL_RC"
echo " Run: source $SHELL_RC (or restart terminal)"
fi
echo ""
echo "✓ dualcode installed successfully."
echo ""
echo "Usage:"
echo " 1. Open Claude Code in any project folder"
echo " 2. Discuss what you want to build"
echo " 3. Say 'dualcode' to trigger planning and execution"
echo ""
echo "To start a new project:"
echo " create-project <folder-name>"