-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·71 lines (61 loc) · 1.9 KB
/
init.sh
File metadata and controls
executable file
·71 lines (61 loc) · 1.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
#!/bin/bash
# Agent initialization script for local development
# Generates .mcp.json files from templates using credentials from .env
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Ruby Agent Initialization ==="
echo ""
# Check for .env
if [ ! -f .env ]; then
if [ -f .env.example ]; then
echo "Creating .env from .env.example..."
cp .env.example .env
echo ""
echo "ERROR: Please edit .env and add your credentials before running init.sh again"
echo " Required credentials are listed in .env.example"
exit 1
else
echo "ERROR: No .env.example found"
exit 1
fi
fi
# Source credentials
echo "Loading credentials from .env..."
set -a
source .env
set +a
# Verify required credentials are set
MISSING=""
for var in TWITTER_API_KEY HEYGEN_API_KEY CLOUDINARY_API_KEY GEMINI_API_KEY BLOTATO_API_KEY GOFILE_API_TOKEN; do
if [ -z "${!var}" ]; then
MISSING="$MISSING $var"
fi
done
if [ -n "$MISSING" ]; then
echo ""
echo "WARNING: The following credentials are not set:$MISSING"
echo " Some features may not work without them."
echo ""
fi
# Generate .mcp.json from template
if [ -f .mcp.json.template ]; then
echo "Generating .mcp.json..."
envsubst < .mcp.json.template > .mcp.json
echo " ✓ Created .mcp.json"
else
echo "WARNING: No .mcp.json.template found"
fi
# Generate .claude/agents/.mcp.json from template
if [ -f .claude/agents/.mcp.json.template ]; then
echo "Generating .claude/agents/.mcp.json..."
envsubst < .claude/agents/.mcp.json.template > .claude/agents/.mcp.json
echo " ✓ Created .claude/agents/.mcp.json"
fi
echo ""
echo "=== Initialization Complete ==="
echo ""
echo "Agent initialized successfully!"
echo "Run 'claude' to start the agent"
echo ""
echo "Note: .mcp.json and .env are gitignored and will not be committed."