Files
aitbc/cli/click_cli.py
aitbc 718b04571a
Some checks failed
CLI Tests / test-cli (push) Has started running
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m9s
Documentation Validation / validate-docs (push) Failing after 9s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Successful in 2s
Security Scanning / security-scan (push) Successful in 29s
Standardize command module docstrings and clean up imports
- Update all command module docstrings to consistent format ending with "for AITBC CLI"
- Remove unused imports (json, httpx, pydantic) from multiple command modules
- Reorder imports to group utils imports together
- Change sys.path in click_cli.py from /opt/aitbc to /opt/aitbc/cli
- Fix relative imports in cross_chain.py and ipfs.py to use .config
2026-05-08 11:17:33 +02:00

86 lines
2.2 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/cli to Python path for commands and utils
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()