File size: 1,352 Bytes
223ef32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""

Simple script to run the Streamlit cybersecurity agent web app.

"""

import subprocess
import sys
import os
from pathlib import Path


def main():
    """Run the Streamlit app."""
    # Get the directory where this script is located
    script_dir = Path(__file__).parent
    app_path = script_dir / "app.py"

    if not app_path.exists():
        print(f"Error: app.py not found at {app_path}")
        sys.exit(1)

    print("Starting Cybersecurity Agent Web App...")
    print("=" * 50)
    print("The app will open in your default web browser.")
    print("If it doesn't open automatically, go to: http://localhost:8501")
    print("=" * 50)
    print()

    try:
        # Run streamlit with the app
        subprocess.run(
            [
                sys.executable,
                "-m",
                "streamlit",
                "run",
                str(app_path),
                "--server.port",
                "8501",
                "--server.address",
                "localhost",
            ],
            check=True,
        )
    except subprocess.CalledProcessError as e:
        print(f"Error running Streamlit: {e}")
        sys.exit(1)
    except KeyboardInterrupt:
        print("\nApp stopped by user.")
        sys.exit(0)


if __name__ == "__main__":
    main()