Skip to content

Support --json output format for all commands #49

@engalar

Description

@engalar

Problem

Current table-formatted output is optimized for human reading but inefficient for programmatic/AI consumption:

  1. Truncation — Column values get truncated (...) when they exceed display width, requiring multiple follow-up queries to get full qualified names
  2. Parsing overhead — Table borders (, , ) waste tokens and require error-prone parsing
  3. No machine-readable format — No way to pipe output into other tools reliably

Proposal

Add --json (or --format json) flag to all output commands:

./mxcli -p app.mpr -c "SHOW ENTITIES IN Sales" --json
./mxcli -p app.mpr -c "DESCRIBE MICROFLOW Sales.ACT_Save" --json
./mxcli -p app.mpr -c "SHOW STRUCTURE IN Sales DEPTH 2" --json

Benefits

  • Eliminates truncation — JSON naturally includes full values
  • Zero parsing cost for AI agents — structured data directly usable
  • Composable — enables piping into jq, other tools, or batch processing scripts
  • Backward compatible — table format remains the default

Suggested output example

{
  "command": "SHOW ENTITIES IN Sales",
  "results": [
    {"qualifiedName": "Sales.Customer", "persistent": true, "attributes": 5, "associations": 2},
    {"qualifiedName": "Sales.Order", "persistent": true, "attributes": 8, "associations": 3}
  ]
}

Priority

High — this is a force multiplier for all other improvements. Without structured output, every other enhancement still requires table parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions