-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup-env.sh
More file actions
executable file
·49 lines (41 loc) · 1.41 KB
/
setup-env.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.41 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
#!/bin/bash
# Setup script to securely configure environment variables for argus
set -e
echo "🔐 Argus Environment Setup"
echo "=============================="
echo ""
# Check if .env exists
if [ ! -f ".env" ]; then
echo "📝 Creating .env file from template..."
cp .env.example .env
echo "✅ Created .env file"
echo ""
echo "⚠️ Please edit .env and add your API keys:"
echo " nano .env"
echo " # or"
echo " code .env"
echo ""
exit 0
fi
# Load .env file
echo "📂 Loading environment variables from .env..."
export $(cat .env | grep -v '^#' | grep -v '^$' | xargs)
# Validate required keys
if [ -z "$ANTHROPIC_API_KEY" ] || [ "$ANTHROPIC_API_KEY" = "your_api_key_here" ]; then
echo "❌ ANTHROPIC_API_KEY is not set in .env"
echo " Please edit .env and add your Anthropic API key"
echo " Get it from: https://console.anthropic.com/settings/keys"
exit 1
fi
echo "✅ ANTHROPIC_API_KEY is set (${#ANTHROPIC_API_KEY} chars)"
# Optional: Check if OpenAI key is set
if [ -n "$OPENAI_API_KEY" ] && [ "$OPENAI_API_KEY" != "your_openai_key_here" ]; then
echo "✅ OPENAI_API_KEY is set (${#OPENAI_API_KEY} chars)"
fi
echo ""
echo "✅ Environment configured successfully!"
echo ""
echo "To use these variables in your current shell, run:"
echo " source setup-env.sh"
echo " # or"
echo " export \$(cat .env | grep -v '^#' | grep -v '^\$' | xargs)"