Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016DvdRZkyCy9NJpHYDdPqmS
31 lines
1.4 KiB
Bash
Executable File
31 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install the launchd jobs (caffeinate, nightly research, market-open execution).
|
|
set -euo pipefail
|
|
PROJ="/Users/aryan/Documents/GitHub/trading-agent"
|
|
LA="$HOME/Library/LaunchAgents"
|
|
mkdir -p "$LA" "$PROJ/state/logs"
|
|
chmod +x "$PROJ/scripts/nightly.sh" "$PROJ/scripts/execute.sh"
|
|
|
|
for p in caffeinate nightly market_open; do
|
|
cp "$PROJ/launchd/ai.tradingagent.$p.plist" "$LA/"
|
|
launchctl unload "$LA/ai.tradingagent.$p.plist" 2>/dev/null || true
|
|
launchctl load "$LA/ai.tradingagent.$p.plist"
|
|
echo "loaded ai.tradingagent.$p"
|
|
done
|
|
|
|
cat <<'EOF'
|
|
|
|
── ONE-TIME MANUAL STEP (needs sudo) ─────────────────────────────
|
|
Wake the Mac nightly at 23:55 CT so the 00:00 job can fire:
|
|
|
|
sudo pmset repeat wakeorpoweron MTWRFSU 23:55:00
|
|
|
|
── REQUIREMENTS for overnight runs ───────────────────────────────
|
|
• plugged into AC power
|
|
• lid OPEN (caffeinate can't beat clamshell sleep on a laptop)
|
|
• logged in (lock screen is fine; logged out = jobs won't run)
|
|
• oMLX running with a model available (it auto-starts on login)
|
|
• .env populated with Alpaca paper + Finnhub keys
|
|
──────────────────────────────────────────────────────────────────
|
|
EOF
|