-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·103 lines (89 loc) · 2.17 KB
/
install.sh
File metadata and controls
executable file
·103 lines (89 loc) · 2.17 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
#!/bin/bash
set -e
PLATFORM="$1"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMMAND_DIR="$SCRIPT_DIR/command"
print_usage() {
echo "Usage: $0 <platform>"
echo ""
echo "Platforms:"
echo " opencode Install for OpenCode (~/.config/opencode/command/)"
echo " claude-code Install for Claude Code (~/.claude/commands/)"
echo ""
echo "Example:"
echo " $0 opencode"
}
if [ -z "$PLATFORM" ]; then
echo "Error: Platform argument required"
echo ""
print_usage
exit 1
fi
case "$PLATFORM" in
opencode)
DEST_DIR="$HOME/.config/opencode/command"
PLATFORM_NAME="OpenCode"
;;
claude-code)
DEST_DIR="$HOME/.claude/commands"
PLATFORM_NAME="Claude Code"
;;
*)
echo "Error: Unknown platform '$PLATFORM'"
echo ""
print_usage
exit 1
;;
esac
echo "Installing Agent Learning System for $PLATFORM_NAME..."
echo ""
if [ ! -d "$COMMAND_DIR" ]; then
echo "Error: Command directory not found at $COMMAND_DIR"
exit 1
fi
if [ ! -d "$DEST_DIR" ]; then
echo "Creating directory: $DEST_DIR"
mkdir -p "$DEST_DIR"
fi
INSTALLED=0
SKIPPED=0
for file in "$COMMAND_DIR"/*.md; do
if [ ! -f "$file" ]; then
continue
fi
filename=$(basename "$file")
dest="$DEST_DIR/$filename"
if [ -L "$dest" ]; then
current_target=$(readlink "$dest")
if [ "$current_target" = "$file" ]; then
echo " ✓ $filename (already installed)"
((SKIPPED++))
continue
else
echo " → $filename (updating symlink)"
rm "$dest"
fi
elif [ -e "$dest" ]; then
echo " ⚠ $filename (file exists, skipping)"
((SKIPPED++))
continue
else
echo " + $filename"
fi
ln -s "$file" "$dest"
((INSTALLED++))
done
echo ""
echo "Installation complete!"
echo " Installed: $INSTALLED commands"
if [ $SKIPPED -gt 0 ]; then
echo " Skipped: $SKIPPED commands"
fi
echo ""
echo "Commands installed to: $DEST_DIR"
echo ""
echo "Next steps:"
echo " 1. Add '**/.tmp/**' to your project's .gitignore"
echo " 2. Start a new session with your AI agent"
echo " 3. Use /learning-recall to load previous learnings"
echo " 4. Use /learning-summarise and /learning-store when you teach the agent something new"