Skip to content

aimgr list <pattern> --format=json returns plain text when no results instead of empty JSON array #4

@hk9890

Description

@hk9890

Bug

When running aimgr list <pattern> --format=json and no installed resources match the pattern, aimgr returns a plain text message instead of valid JSON.

Steps to Reproduce

aimgr list agent --format=json

Actual Output

No installed resources match pattern 'agent'.

Expected Output

[]

Impact

Any tooling that calls aimgr list --format=json and parses the output as JSON will crash with:

Unexpected token 'N', "No resourc"... is not valid JSON

This breaks setup wizards and scripts that use the JSON output to drive further logic (e.g. package installation flows).

Fix

When --format=json is specified, always return valid JSON — use [] for empty results instead of a human-readable text message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions