Files
aitbc/cli/templates/parser_template.py
aitbc 340d781f02
Some checks failed
CLI Tests / test-cli (push) Has been cancelled
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Python Tests / test-python (push) Failing after 1m34s
feat: add stub implementations for CLI commands to support graceful degradation
Added stub data returns and error handling across multiple CLI handlers to prevent
training script failures when services are unavailable:

- AI handlers: Return stub job data instead of sys.exit on errors, fix coordinator_url
  parameter handling, wrap task_data in proper structure for job submission
- Agent SDK: Add complete stub implementation for create/register/list/status/capabilities
- System handlers: Add graceful fall
2026-05-04 16:49:35 +02:00

17 lines
910 B
Python

"""{{COMMAND_NAME}} command registration for the unified CLI."""
import argparse
from parser_context import ParserContext
def register(subparsers: argparse._SubParsersAction, ctx: ParserContext) -> None:
"""Register {{COMMAND_NAME}} command with the CLI."""
{{COMMAND_NAME}}_parser = subparsers.add_parser("{{COMMAND_NAME}}", help="{{COMMAND_DESCRIPTION}}")
{{COMMAND_NAME}}_parser.set_defaults(handler=lambda parsed, parser={{COMMAND_NAME}}_parser: parser.print_help())
{{COMMAND_NAME}}_subparsers = {{COMMAND_NAME}}_parser.add_subparsers(dest="{{COMMAND_NAME}}_action")
# Add subcommands
{{COMMAND_NAME}}_action_parser = {{COMMAND_NAME}}_subparsers.add_parser("action", help="Action description")
{{COMMAND_NAME}}_action_parser.add_argument("--option", help="Option description")
{{COMMAND_NAME}}_action_parser.set_defaults(handler=ctx.handle_{{COMMAND_NAME}}_action)