Delegate Click commands via subprocess instead of direct import
Some checks failed
CLI Tests / test-cli (push) Failing after 13s
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m16s
Multi-Node Stress Testing / stress-test (push) Successful in 4s
Node Failover Simulation / failover-test (push) Successful in 6s
Security Scanning / security-scan (push) Successful in 1m16s

- Changed Click command delegation from importing aitbc_click() to subprocess call
- Runs click_cli.py as separate process using sys.executable
- Passes through command line arguments via sys.argv[1:]
- Returns subprocess exit code to caller
This commit is contained in:
aitbc
2026-05-08 10:49:14 +02:00
parent 149fbb0abe
commit ceacbd1d8d

View File

@@ -3194,9 +3194,11 @@ def main(argv=None):
# Check if this is a Click command
if argv and argv[0] in CLICK_COMMANDS:
# Delegate to Click CLI
from cli.click_cli import aitbc_click
aitbc_click()
# Delegate to Click CLI by calling click_cli.py as a module
import subprocess
click_cli_path = Path("/opt/aitbc/cli/click_cli.py")
result = subprocess.run([sys.executable, str(click_cli_path)] + sys.argv[1:])
return result.returncode
elif len(argv) > 0 and argv[0] == "genesis":
# Run genesis CLI subprocess
genesis_path = Path(__file__).parent.parent / "genesis" / "genesis_cli.py"