Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Standardized Output Formatting and Error Reporting for CLI Commands #1655

Open
2 tasks done
shwetd19 opened this issue Feb 8, 2025 · 1 comment
Open
2 tasks done
Labels
enhancement New feature or request

Comments

@shwetd19
Copy link

shwetd19 commented Feb 8, 2025

Why do we need this improvement?

Problem Overview

Right now, the AsyncAPI CLI's output formatting and error messages feel a bit inconsistent across different commands. This can make it harder for users to:

  • Quickly understand if a command was successful or failed, and what key information they need.
  • Troubleshoot issues when something goes wrong, since error messages aren’t always clear or actionable.
  • Use the CLI in automated scripts, as the output isn’t always predictable or easy to parse.

Proposed Solution

To make the CLI more user-friendly and script-friendly, we could standardize how output and errors are handled across all commands. Some improvements might include:

  • Consistent Output Format: Choosing a clear, structured format (like JSON, YAML, or a human-readable table) that works well for both humans and automation.
  • Clearer Error Messages: Providing more detailed and helpful error messages, including:
    • Specific error details (e.g., “Invalid file format” or “Missing required field”).
    • Suggested solutions or troubleshooting steps.
    • Links to relevant documentation.
  • Standardized Exit Codes: Using consistent exit codes so scripts can reliably interpret command results.
  • Better Logging: Considering a logging library (e.g., Winston, Zap) for more structured and configurable logging.

Would love to hear thoughts from the maintainers on this!

How will this change help?

  • Better user experience: Users can easily interpret results and errors without confusion.
  • Easier debugging: More informative error messages will help users troubleshoot issues faster.
  • Improved automation: Predictable output formats and standardized exit codes will make it easier to integrate the CLI into scripts and workflows.

Screenshots

No response

How could it be implemented/designed?

  • Standardize output format (JSON, YAML, or a structured human-readable format) for all commands.
  • Enhance error messages by including specific details, troubleshooting steps, and links to documentation.
  • Use consistent exit codes to indicate success, failure, and different types of errors.
  • Integrate a logging library (like Winston or Zap) for better structured and configurable logs.

🚧 Breaking changes

Yes

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

@shwetd19 shwetd19 added the enhancement New feature or request label Feb 8, 2025
@github-project-automation github-project-automation bot moved this to To Triage in CLI - Kanban Feb 8, 2025
Copy link
Contributor

github-actions bot commented Feb 8, 2025

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To Triage
Development

No branches or pull requests

1 participant