-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-env.fish
More file actions
executable file
·41 lines (35 loc) · 1.39 KB
/
setup-env.fish
File metadata and controls
executable file
·41 lines (35 loc) · 1.39 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
#!/usr/bin/env fish
# CodeThreat CLI Environment Setup Script for Fish Shell
# Source this file to set up environment variables for CLI usage
echo "🔧 Setting up CodeThreat CLI environment..."
# Load from .env file if it exists
if test -f ".env"
echo "📁 Loading environment from .env file..."
for line in (cat .env | grep -v '^#' | grep -v '^$')
set -l key_value (string split '=' $line)
if test (count $key_value) -ge 2
set -gx $key_value[1] (string join '=' $key_value[2..-1])
end
end
end
# Set API key if not already set
if test -z "$CT_API_KEY"
echo "⚠️ CT_API_KEY not set. Please set it manually:"
echo " set -gx CT_API_KEY 'your_api_key_here'"
else
echo "✅ CT_API_KEY is set"
end
# Display current configuration
echo ""
echo "🎯 Current CLI Configuration:"
echo " Server URL: "(set -q CT_SERVER_URL; and echo $CT_SERVER_URL; or echo "https://app.codethreat.com")
echo " API Key: "(test -n "$CT_API_KEY"; and echo "Set"; or echo "Not set")
echo " Organization: "(set -q CT_ORG_ID; and echo $CT_ORG_ID; or echo "Not set")
echo " Verbose: "(set -q CT_VERBOSE; and echo $CT_VERBOSE; or echo "false")
echo ""
echo "🚀 CLI is ready! Try: codethreat --help"
echo ""
echo "💡 To use in new terminals:"
echo " source setup-env.fish"
echo " # or"
echo " set -gx CT_API_KEY 'your_key'; set -gx CT_SERVER_URL 'http://localhost:3000'"