removed frontend command from the cli

This commit is contained in:
SwiftyOS
2023-09-19 15:08:26 +02:00
parent fa265fdf25
commit cc7476656f
2 changed files with 0 additions and 46 deletions

View File

@@ -181,23 +181,3 @@ Displays the details of the 'TestWriteFile' benchmark test.
``` ```
Displays the results of the benchmark tests on 'my_agent'. Displays the results of the benchmark tests on 'my_agent'.
### 5. Frontend Command
```sh
./run frontend
```
**Output**:
```
Agent is running.
Launching frontend
... (more details about the launch process)
```
Launches the frontend, with debugging and service details mentioned.
---
Remember to start an agent before launching the frontend and that the `agents stop` command terminates any process on port 8000.

26
cli.py
View File

@@ -569,32 +569,6 @@ def benchmark_tests_details(test_name):
print(f"IOError: file could not be read: {data_file}") print(f"IOError: file could not be read: {data_file}")
continue continue
@cli.command()
def frontend():
"""Starts the frontend"""
import os
import socket
import subprocess
try:
output = subprocess.check_output(["lsof", "-t", "-i", ":8000"])
if output:
click.echo("Agent is running.")
else:
click.echo("Error: Agent is not running. Please start an agent first.")
except subprocess.CalledProcessError as e:
click.echo("Error: Unexpected error occurred.")
return
frontend_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "frontend")
run_file = os.path.join(frontend_dir, "run")
if os.path.exists(frontend_dir) and os.path.isfile(run_file):
subprocess.Popen(["./run"], cwd=frontend_dir)
click.echo("Launching frontend")
else:
click.echo("Error: Frontend directory or run file does not exist.")
@cli.group() @cli.group()
def arena(): def arena():
"""Commands to enter the arena""" """Commands to enter the arena"""