Let a command plugin read what was piped into jp
Todo2026-10-29jp
A command plugin's stdin is the protocol channel to the host, so it can never see what was piped into jp. JP's justfile keeps ticket-add and ticket-comment only to read piped text and pass it to jp ticket as --body.
Proposal
read_stdinhost request (protocol 14). The plugin asks, andjpanswers with the piped text, or with nothing when stdin is a terminal.- Read on request, so a command that doesn't ask never waits on stdin.
- Stdin is read once; a second request gets nothing.
jp ticket addandcommentask for it when no--bodyis given, and use the piped text as the body, asjp querydoes. Likejp query, a pipe that never closes makes the command wait.jp ticket comment T-02wt0kx#1replies to comment 1, as theticket-commentrecipe accepts today.- Drop
just ticket-addandjust ticket-comment.just ticket-add bug "Title"becomesjp ticket add "Title" --label type=bug. - A
jpolder than protocol 14 isn't asked, so piped text is ignored there. The plugins are installed withjp, so that's acceptable.
Piping doesn't take away the prompts: jp decides it can prompt from stdout (crates/jp_cli/src/ctx.rs), and the prompt widgets read keys through crossterm, which opens /dev/tty when stdin isn't a terminal. So pbpaste | jp ticket add should still ask for the title. Confirm that by running it as part of this work.