Description
The list and env commands currently only output human-readable box-drawing tables with ANSI color codes. There's no way to get structured, machine-readable output for use in CI pipelines, scripts, or other tooling.
Current behavior
Outputs a colored table using box-drawing characters — great for humans, unusable for scripts.
Proposed behavior
Add a --json flag to list and env that outputs structured JSON:
{
"packages": [
{
"package": "@heroui/react",
"version": "3.0.0",
"latestVersion": "3.0.4",
"status": "stable",
"docs": "https://heroui.com"
},
{
"package": "@heroui/styles",
"version": "3.0.0",
"latestVersion": "3.0.4",
"status": "stable",
"docs": "https://heroui.com"
}
]
}
{
"packages": [...],
"environment": {
"os": "darwin",
"arch": "arm64",
"nodeVersion": "v22.0.0"
}
}
Why this matters
- CI/CD pipelines need to parse CLI output programmatically (e.g., check if packages are outdated before deploying)
- Scripts that wrap the CLI can't reliably parse colored table output
- Other tools (like MCP servers or IDE extensions) could consume this output
- It's a common pattern in modern CLIs (npm, yarn, pnpm all support
--json)
Implementation notes
The data is already structured internally as PackageComponent[] objects in src/helpers/package.ts. The change is minimal:
- Add
--json option to list and env command registration
- In the action, check for the flag and
JSON.stringify the data instead of calling outputComponents()
- When
--json is set, skip the version-check banner and colored output
Scope
Small — the data structures already exist, this is just an alternative output path.
Description
The
listandenvcommands currently only output human-readable box-drawing tables with ANSI color codes. There's no way to get structured, machine-readable output for use in CI pipelines, scripts, or other tooling.Current behavior
Outputs a colored table using box-drawing characters — great for humans, unusable for scripts.
Proposed behavior
Add a
--jsonflag tolistandenvthat outputs structured JSON:{ "packages": [ { "package": "@heroui/react", "version": "3.0.0", "latestVersion": "3.0.4", "status": "stable", "docs": "https://heroui.com" }, { "package": "@heroui/styles", "version": "3.0.0", "latestVersion": "3.0.4", "status": "stable", "docs": "https://heroui.com" } ] }{ "packages": [...], "environment": { "os": "darwin", "arch": "arm64", "nodeVersion": "v22.0.0" } }Why this matters
--json)Implementation notes
The data is already structured internally as
PackageComponent[]objects insrc/helpers/package.ts. The change is minimal:--jsonoption tolistandenvcommand registrationJSON.stringifythe data instead of callingoutputComponents()--jsonis set, skip the version-check banner and colored outputScope
Small — the data structures already exist, this is just an alternative output path.