Files
aitbc/cli/click_cli.py
aitbc 149fbb0abe
Some checks failed
CLI Tests / test-cli (push) Failing after 11s
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 10s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 2s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 27s
Security Scanning / security-scan (push) Has been cancelled
Package Tests / Python package - aitbc-core (push) Successful in 13s
Package Tests / Python package - aitbc-crypto (push) Successful in 9s
Package Tests / Python package - aitbc-sdk (push) Successful in 11s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 27s
Python Tests / test-python (push) Failing after 1m25s
Delegate Click commands to click_cli and add agent subcommands
- Route Click commands (agent, ipfs, oracle, etc.) to click_cli module
- Add zk, knowledge, bounty, dispute subcommands to agent group
- Add AI test submission, power trading, and reputation commands
- Add cross-chain transfer and listing commands
- Add monitor start/stop/status/alerts commands
- Add swarm create/discover/add/distribute/status commands
- Update main() to check command type and delegate appropriately
- Fix genesis CLI
2026-05-08 10:43:53 +02:00

89 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 to Python path for shared modules
sys.path.insert(0, str(Path("/opt/aitbc")))
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
# Import commands with dependencies (may fail if dependencies not installed)
# cross_chain requires tabulate - not available in click_cli
CROSS_CHAIN_AVAILABLE = False
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)
# Register commands with dependencies conditionally
if CROSS_CHAIN_AVAILABLE:
aitbc_click.add_command(cross_chain.cross_chain)
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()