stock-ai-agent/scripts/stock.sh
2026-02-19 21:20:20 +08:00

28 lines
768 B
Bash
Executable File

#!/bin/bash
# 美股分析快捷脚本
#
# 用法:
# ./scripts/stock.sh AAPL
# ./scripts/stock.sh AAPL TSLA
# ./scripts/stock.sh # 分析配置的所有股票(会发送通知)
cd "$(dirname "$0")/.." || exit 1
if [ $# -eq 0 ]; then
# 无参数,分析配置的所有股票
echo "📊 分析配置的所有股票(将发送通知)..."
python3 -c "
import sys
sys.path.insert(0, 'backend')
from app.config import get_settings
settings = get_settings()
symbols = settings.stock_symbols.split(',')
print(' '.join(symbols))
" 2>/dev/null | xargs python3 scripts/test_stock.py
else
# 分析指定的股票
SYMBOLS="$@"
echo "📊 分析股票: $SYMBOLS(将发送通知)"
python3 scripts/test_stock.py $SYMBOLS
fi