Feature: CLI main() error handling paths
  As a developer
  I want to cover the error-handling branches in cleveragents.cli.main
  So that convert_exit_code(), subcommand import failure, and config validation are exercised

  @coverage
  Scenario: invalid --config-path that is a directory is rejected
    When I run CLI with arguments ["--config-path", "/tmp", "version"]
    Then the main cli exit code should be 1
    And the main cli output contains "is not a file"

  @coverage
  Scenario: unknown command returns exit code 2
    When I run CLI with arguments ["this_is_not_a_command"]
    Then the main cli exit code should be 2
    And the main cli output contains "Invalid command 'this_is_not_a_command'"

  # These tests call convert_exit_code and _print_basic_help directly
  @coverage
  Scenario: convert_exit_code(None) returns 0
    When the main exit-code converter is called with the value "None"
    Then the main convert_exit_code result is "0"

  @coverage
  Scenario: convert_exit_code(int -1) returns -1 for negative codes
    When the main exit-code converter is called with the value "-1"
    Then the main convert_exit_code result is "-1"

  @coverage
  Scenario: convert_exit_code(string "abc") returns 1 for unparseable
    When the main exit-code converter is called with the value "abc"
    Then the main convert_exit_code result is "1"

  @coverage
  Scenario: _print_basic_help prints without error
    When I call the main _print_basic_help
    Then the main _print_basic_help completes ok
