Skip to content

Improve lenient reference handling across CLI commands#38

Merged
gnapse merged 2 commits intomainfrom
ernesto/lenient-id-inputs
Feb 20, 2026
Merged

Improve lenient reference handling across CLI commands#38
gnapse merged 2 commits intomainfrom
ernesto/lenient-id-inputs

Conversation

@gnapse
Copy link
Collaborator

@gnapse gnapse commented Feb 17, 2026

Summary

  • Harden reference parsing in src/lib/refs.ts (trim-aware parsing, strict numeric IDs, clearer error messaging, and resolveChannelId).
  • Allow search --channel and search --conversation to consume comma-separated refs (bare IDs, id: refs, and Twist URLs).
  • Route react/unreact and thread reply --notify through shared ref parsing for more forgiving, consistent ID handling.
  • Add and update tests in src/__tests__/lib/refs.test.ts, src/__tests__/search.test.ts, src/__tests__/thread.test.ts, and new src/__tests__/react.test.ts, and sync SKILL_CONTENT docs.

What You Can Do Now

# Mix id: refs and URLs for search filters
tw search "AI" --channel "id:772552,https://twist.com/a/1585/ch/1220"
tw search "status" --conversation "id:907792,https://twist.com/a/1585/msg/2287"

# React/unreact using URLs directly
tw react thread "https://twist.com/a/1585/ch/772552/t/5928839" +1
tw unreact message "https://twist.com/a/1585/msg/907792/m/107740052" heart

# Use id: refs in notify lists
tw thread reply 5928839 "Looks good" --notify id:123,456 --dry-run

Inspiration

Validation: npm test and npm run type-check pass.

@doistbot doistbot requested a review from rfgamaral February 17, 2026 19:07
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR significantly improves the robustness and consistency of reference handling across several CLI commands by hardening reference parsing in src/lib/refs.ts and enabling comma-separated references in search commands. The changes also route react/unreact and thread reply --notify through shared parsing logic, contributing to a more forgiving and consistent user experience. No issues were flagged during the review, indicating a well-executed and thoroughly tested set of improvements.

Share FeedbackReview Logs

@scottlovegrove scottlovegrove force-pushed the ernesto/lenient-id-inputs branch from ff368ea to 346fa06 Compare February 19, 2026 09:53
@gnapse gnapse merged commit bbf3a9b into main Feb 20, 2026
2 checks passed
@gnapse gnapse deleted the ernesto/lenient-id-inputs branch February 20, 2026 00:55
github-actions bot pushed a commit that referenced this pull request Feb 20, 2026
# [2.2.0](v2.1.0...v2.2.0) (2026-02-20)

### Features

* Improve lenient reference handling across CLI commands ([#38](#38)) ([bbf3a9b](bbf3a9b))
@github-actions
Copy link

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants