cli: add JSON output to get and list commands, and JSON and raw output to message poll
メンテナーはふだん 2 日以内に返信
@shAn-kor がすでに取り組んでいます。
2026年10月24日 から。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 5.3k
- フォーク
- 548
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 194
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iggy のほかの issue
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
good first issue java test
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
good first issue javascript test
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
bug triaged tui ux wontfix
難易度 2/5 半日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bevyengine/bevy#26642 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信