-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_project.sh
More file actions
executable file
·47 lines (40 loc) · 1.4 KB
/
init_project.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.4 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
#!/usr/bin/env bash
# Initialize agent-memory in a target project.
# Usage: ./init_project.sh /path/to/project
#
# What it does:
# 1. Copies .agent-memory-rules.md, CLAUDE.md, AGENTS.md
# 2. Copies mem0_mcp_server.py, seed_memories.py, generate_configs.py
# 3. Runs generate_configs.py (requires OPENROUTER_API_KEY)
# 4. Prints next steps
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET="${1:?Usage: $0 /path/to/project}"
if [[ ! -d "$TARGET" ]]; then
echo "❌ Directory not found: $TARGET"
exit 1
fi
TARGET="$(cd "$TARGET" && pwd)"
echo "🔧 Initializing agent-memory in: $TARGET"
echo ""
# Copy universal brain + loaders
for f in .agent-memory-rules.md CLAUDE.md AGENTS.md mem0_mcp_server.py seed_memories.py generate_configs.py; do
cp "$SCRIPT_DIR/$f" "$TARGET/"
echo " ✅ $f"
done
# Generate agent configs
if [[ -n "${OPENROUTER_API_KEY:-}" ]]; then
echo ""
echo "⚙️ Generating agent MCP configs..."
cd "$TARGET"
python3 generate_configs.py
echo ""
else
echo ""
echo "⚠️ OPENROUTER_API_KEY not set — skipping config generation."
echo " Run: OPENROUTER_API_KEY=sk-or-v1-... python3 $TARGET/generate_configs.py"
fi
echo ""
echo "📋 Next: Seed memories"
echo " Edit $TARGET/seed_memories.py to add project-specific memories, then:"
echo " OPENROUTER_API_KEY=sk-or-v1-... python3 $TARGET/seed_memories.py"