Skip to content

[BUG] diff command does not respect --output flag in CLI version 3.1.1 #207

@lfvJonas

Description

@lfvJonas

Describe the bug.

When using the asyncapi diff command with the --output flag in version @asyncapi/cli@3.1.1, the output is printed to the terminal but not written to the specified file. This occurs even when using --no-error to suppress breaking change errors.

There is no error message, and the command appears to run successfully, but the output file is not created or modified.

Expected behavior

The --output flag should cause the diff result to be written to the specified file. If the file does not exist, it should be created. If it does exist, it should be overwritten or updated accordingly.

Screenshots

Image

How to Reproduce

  1. Create two AsyncAPI files with small differences (e.g., asyncapi-1.yaml and asyncapi-2.yaml).

  2. Run the following command: asyncapi diff asyncapi-1.yaml asyncapi-2.yaml -f yaml --output output.yml

Observe that:

  • The diff is printed to the console.
  • No output.yml file is created or updated.

🖥️ Device Information [optional]

AsyncAPI CLI: @asyncapi/cli@3.1.1
Node.js: v22.15.0
OS: Ubuntu 24.04

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions