-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathspectra
More file actions
executable file
·112 lines (100 loc) · 3.15 KB
/
spectra
File metadata and controls
executable file
·112 lines (100 loc) · 3.15 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
################################################################################
# SPECTRA Launcher - Main entry point
################################################################################
#
# Default: launch the main web console.
# Compatibility: preserve legacy install/repair/bootstrap paths.
#
# Usage: ./spectra [COMMAND]
#
################################################################################
set -euo pipefail
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
print_error() {
echo -e "${RED}✗${NC} $1" >&2
}
print_success() {
echo -e "${GREEN}✓${NC} $1"
}
print_status() {
echo -e "${BLUE}▶${NC} $1"
}
# Handle command line arguments
COMMAND="${1:-web}"
if [[ $# -gt 0 && "${1:0:1}" == "-" ]]; then
COMMAND="web"
elif [[ $# -gt 0 ]]; then
shift
fi
case "$COMMAND" in
"web"|"gui"|"ui"|"")
HOST="${SPECTRA_HOST:-127.0.0.1}"
PORT="${SPECTRA_PORT:-5000}"
exec python3 -m spectra_app.spectra_gui_launcher --host "$HOST" --port "$PORT" "$@"
;;
"semantic-tui")
exec python3 -m tgarchive.ui.tui_caas "$@"
;;
"semantic-discovery")
exec python3 -m tgarchive.osint.caas.discovery_ops "$@"
;;
"process-queue")
exec python3 -m tgarchive.osint.caas.cli process-queue "$@"
;;
"docs"|"documentation")
exec python3 "$SCRIPT_DIR/webapp.py" "$@"
;;
"tui"|"run"|"launch")
exec "$SCRIPT_DIR/scripts/launch/spectra-launch.sh"
;;
"bootstrap")
exec "$SCRIPT_DIR/bootstrap"
;;
"install")
exec bash "$SCRIPT_DIR/scripts/install/install-spectra.sh"
;;
"repair")
exec bash "$SCRIPT_DIR/scripts/install/repair-installation.sh"
;;
"help"|"-h"|"--help")
cat << 'EOF'
SPECTRA - Telegram Network Discovery & Archiving System
Usage: ./spectra [COMMAND]
Commands:
web Launch the main web console (default)
semantic-tui Launch the semantic-intelligence TUI
semantic-discovery Run CAAS-aware semantic discovery
process-queue Process the semantic intelligence queue
docs Launch the documentation console
tui Launch the legacy TUI
bootstrap Auto-setup and launch SPECTRA
install Install/update SPECTRA
repair Repair broken SPECTRA installation
help Show this help message
Examples:
./spectra # Launch the main web console
./spectra semantic-tui # Launch semantic TUI
./spectra process-queue --loop # Keep processing queue
./spectra docs # Open the documentation launcher
./spectra install # Install or update
./spectra repair # Repair a broken installation
For more options, see:
- Makefile (use: make help)
- README.md (see: Quick Start section)
- docs/INSTALLATION_GUIDE.md
EOF
;;
*)
print_error "Unknown command: $1"
echo "Use './spectra help' for usage information"
exit 1
;;
esac