Skip to content

Commit 7adb94b

Browse files
authored
fix(stack): write JSON output to stdout instead of stderr (#1191)
`stack list --json` used `console.print()` which writes to stderr via Rich. Switch to `click.echo()` so JSON goes to stdout and can be piped to `jq` or other tools, matching queue and freeze commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Depends-On: #1190
1 parent 1dda432 commit 7adb94b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mergify_cli/stack/list.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import sys
2222
import typing
2323

24+
import click
25+
2426
from mergify_cli import console
2527
from mergify_cli import utils
2628
from mergify_cli.exit_codes import ExitCode
@@ -479,6 +481,6 @@ async def stack_list(
479481
)
480482

481483
if output_json:
482-
console.print(json.dumps(output.to_dict(), indent=2))
484+
click.echo(json.dumps(output.to_dict(), indent=2))
483485
else:
484486
display_stack_list(output, verbose=verbose)

0 commit comments

Comments
 (0)