feat: consistency pass for --json across tw react/unreact, comment view, conversation with#176
Merged
scottlovegrove merged 4 commits intomainfrom Apr 16, 2026
Merged
Conversation
All other mutating commands (thread/conversation/comment/msg/away) already
emit JSON on --json; react and unreact were the only outliers. Useful for
scripting flows like "react on thread when CI passes."
Output is a minimal status object ({ targetType, targetId, emoji, action })
since the API returns void, matching the pattern in thread/delete.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matches the behavior of tw thread view and tw msg view, both of which support --ndjson on single-item views by wrapping the item in a 1-element array. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tw conversation with declared --json and --ndjson but fell back to a plain-text "No 1:1 conversation found" message when no match existed, breaking JSON consumers. Route the empty case through the shared helper so --json emits [] and --ndjson emits nothing, matching how the helper already handles non-empty results. Also hardens listConversationsWithUser so other callers benefit if they pass an empty array with --json. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Picks up the react/unreact --json and comment view --ndjson entries added in the preceding commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
Apr 16, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
This PR does a great job completing a consistency pass across the CLI by adding missing --json and --ndjson support to the react, unreact, comment view, and conversation with commands. These additions ensure structured output behaves predictably across the tool, making it much more robust for automated scripting. No issues were flagged during the review.
doist-release-bot bot
added a commit
that referenced
this pull request
Apr 16, 2026
## [2.31.0](v2.30.0...v2.31.0) (2026-04-16) ### Features * consistency pass for --json across tw react/unreact, comment view, conversation with ([#176](#176)) ([5db95cc](5db95cc))
Contributor
|
🎉 This PR is included in version 2.31.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #175 — audits every command for missing
--json/--ndjsonsupport and closes three gaps:tw react/tw unreact— emitted plain text only; the only mutating commands without--json. Adds--jsonthat outputs{ targetType, targetId, emoji, action }(anddryRun: truefor dry-run).tw comment view— declared--jsonbut not--ndjson, even thoughtw thread viewandtw msg viewboth do. Adds--ndjsonmatching the single-item-wrapped-in-array pattern those siblings use.tw conversation with— declared--json/--ndjsonbut the not-found branch fell back to a plain-English message, breaking JSON consumers. Routes the empty case throughlistConversationsWithUserso--jsonemits[]and--ndjsonemits nothing.Each gap is its own commit so they can be reviewed independently. A final commit regenerates
skills/twist-cli/SKILL.md.Test plan
npm testpasses (448 tests, +5 new)npm run type-check,npm run lint:check, pre-push test hook all cleannpm run sync:skillclean; SKILL.md regeneratedtw react thread <id> +1 --json | jq .returns{ action: "added", ... }tw unreact thread <id> +1 --json --dry-run | jq .dryRunreturnstrueand the API is not calledtw comment view <id> --ndjsonemits a single NDJSON linetw conversation with <user> --jsonwhen no DM exists returns[]🤖 Generated with Claude Code