Structure and organization #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive, modular command-line interface (CLI) for the Handler A2A protocol client, using
rich-clickfor enhanced usability and structured command grouping. It adds new CLI modules for authentication, messaging, agent card operations, server management, and session handling, each with clear commands and shared utilities. The configuration and error handling are centralized for consistency and maintainability.Key changes include:
1. New Modular CLI Architecture
src/a2a_handler/cli/__init__.py, organizing commands into submodules (auth,card,message,server,session,task) and usingrich-clickfor improved help and formatting. Adds global options for verbose and debug logging.pyproject.tomlto ignore linting errors in the new CLI module structure.2. Enhanced CLI User Experience
src/a2a_handler/cli/_config.pyfor configuringrich-click, grouping commands and options for clarity in help output, and applying consistent styles.3. New CLI Command Implementations
authcommands for setting, showing, and clearing agent authentication credentials.cardcommands for retrieving and validating agent cards, including output formatting and validation result display.messagecommands for sending and streaming messages to agents, supporting session continuation, inline authentication, and push notifications.servercommands to start local agent and webhook servers with configurable options.sessioncommands for listing, showing, and clearing saved session state.4. Shared Utilities and Error Handling
src/a2a_handler/cli/_helpers.pywith reusable functions for HTTP client creation and robust error handling across CLI commands.These changes make the CLI more modular, user-friendly, and maintainable, providing a solid foundation for further feature development.