Files
aitbc/cli/click_cli.py
aitbc 60460f76da
Some checks failed
CLI Tests / test-cli (push) Failing after 10s
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m6s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 4s
Security Scanning / security-scan (push) Successful in 15s
Update click_cli.py path configuration and fix config module import
- Add /opt/aitbc to sys.path for shared modules access
- Update comment to reflect both paths being added
- Change config.py import from local to aitbc_cli.config
- Rename Config to CLIConfig in import statement
2026-05-08 11:28:14 +02:00

87 lines
2.3 KiB
Python
Executable File

#!/usr/bin/env python3
"""
AITBC Click-Based CLI Entry Point
Separate entry point for Click-based commands (not parser/handler architecture)
"""
import sys
from pathlib import Path
# Add /opt/aitbc and /opt/aitbc/cli to Python path for shared modules
sys.path.insert(0, str(Path("/opt/aitbc")))
sys.path.insert(0, str(Path("/opt/aitbc/cli")))
import click
# Import Click-based command groups
from commands import oracle
from commands import agent
from commands import ipfs
from commands import swarm
from commands import arbitrage
from commands import validator
from commands import plugin
from commands import database
from commands import island
from commands import edge
from commands import ai
from commands import cross_chain
# Import commands with dependencies (may fail if dependencies not installed)
try:
from commands import monitor
MONITOR_AVAILABLE = True
except ImportError:
MONITOR_AVAILABLE = False
try:
from commands import governance
GOVERNANCE_AVAILABLE = True
except ImportError:
GOVERNANCE_AVAILABLE = False
try:
from commands import staking
STAKING_AVAILABLE = True
except ImportError:
STAKING_AVAILABLE = False
try:
from commands import compliance
COMPLIANCE_AVAILABLE = True
except ImportError:
COMPLIANCE_AVAILABLE = False
@click.group()
@click.version_option(version="2.1.0")
def aitbc_click():
"""AITBC Click-based CLI - Separate entry point for Click commands"""
pass
# Register command groups
aitbc_click.add_command(oracle.oracle)
aitbc_click.add_command(agent.agent)
aitbc_click.add_command(ipfs.ipfs)
aitbc_click.add_command(swarm.swarm)
aitbc_click.add_command(arbitrage.arbitrage)
aitbc_click.add_command(validator.validator)
aitbc_click.add_command(plugin.plugin)
aitbc_click.add_command(database.database)
aitbc_click.add_command(island.island)
aitbc_click.add_command(edge.edge)
aitbc_click.add_command(ai.ai_group)
aitbc_click.add_command(cross_chain.cross_chain)
# Register commands with dependencies conditionally
if MONITOR_AVAILABLE:
aitbc_click.add_command(monitor.monitor)
if GOVERNANCE_AVAILABLE:
aitbc_click.add_command(governance.governance)
if STAKING_AVAILABLE:
aitbc_click.add_command(staking.staking)
if COMPLIANCE_AVAILABLE:
aitbc_click.add_command(compliance.compliance)
if __name__ == "__main__":
aitbc_click()