cli: add JSON output to get and list commands, and JSON and raw output to message poll
Maintainer thường phản hồi trong vòng 2 ngày
@shAn-kor đang làm issue này rồi.
Từ ngày 24/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 49/100
Hướng nghiên cứu
Start with core/cli/src/commands/binary_system/stats.rs for existing output options, core/cli/src/commands/binary_message/poll_messages.rs for poll formatting, and core/cli/src/main.rs for the execution line. Then locate get/list command definitions and tests; the issue does not enumerate them. Done when all get/list commands support the requested JSON output and message poll meets the output, encoding, stdout, and acceptance requirements.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
- Only
iggy statscan print JSON or TOML (-o json|toml,core/cli/src/commands/binary_system/stats.rs:243-244). All other get and list commands print tables, and the list commands use another flag,-l, --list-mode table|list. #749 asked for JSON output in 2024 and was closed afterstatsonly (#756). iggy message pollprints a table and converts each payload withString::from_utf8_lossy(core/cli/src/commands/binary_message/poll_messages.rs:141). Invalid UTF-8 prints as U+FFFD, and a payload with\nspans two rows.--output-filewrites whole messages, but no option prints the payloads alone.- The
Executing ...line goes to stdout (core/cli/src/main.rs:428-432), soiggy stats -o json | jq .fails.-qhides this line, but it also hides the output of all commands exceptstatsandpat create. #772 asked to move the logs to stderr.
Proposal
- Add
-o, --output <table|list|json>to every get and list command, and keep-l, --list-modefor the list commands. Use the JSON shapes of the HTTP API, because the server response types already implementSerialize. - In the context commands, mask passwords and tokens, as
context showdoes. - Add
--output <table|json|raw>tomessage poll, with no short form, because-ois--offsetthere.jsonwrites one JSON object per message per line. Write the message ID as a string, because JavaScript and many JSON tools round 128-bit numbers.--payload-encoding <base64|hex|utf8>sets the payload format, and the default isbase64.utf8fails on a payload that is not valid UTF-8.rawwrites only the payload bytes, each followed by\n.
- In JSON and raw mode, write only the output to stdout.
Notes
- TOML cannot hold a top-level array, so the list commands cannot print TOML.
Acceptance
jqcan parse the output of every get and list command with-o json, and ofmessage poll --output json.- For non-empty, single-line UTF-8 payloads,
message poll --output raw | message sendsends the same payloads again.
- Ngôn ngữ chính
- Rust
- Star
- 5.3k
- Fork
- 548
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 194
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/iggy
-
go good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
go good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 2 ngày
-
go good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue java test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue javascript test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
marketing
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
S: Untriaged T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
libnyanpasu/clash-nyanpasu#6537 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 62/100
tauri-apps/tao#1445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P3
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
nearai/compose-manager#95 ·
Maintainer thường phản hồi trong vòng 1 ngày