Skip to content

feat: add tw view <url> router command#42

Merged
scottlovegrove merged 1 commit intomainfrom
scottl/view-by-url
Feb 19, 2026
Merged

feat: add tw view <url> router command#42
scottlovegrove merged 1 commit intomainfrom
scottl/view-by-url

Conversation

@scottlovegrove
Copy link
Collaborator

Summary

  • Adds tw view <url> top-level command that classifies a Twist URL and routes to the appropriate subcommand (thread view, conversation view, or msg view)
  • Adds classifyTwistUrl() helper to src/lib/refs.ts with priority: message > conversation > comment > thread
  • All target command flags (e.g. --json, --raw, --full) pass through transparently

Test plan

  • classifyTwistUrl unit tests (8 cases: thread, comment, conversation, message, workspace-only, channel-only, non-Twist, invalid)
  • View routing tests (6 cases: thread, comment→thread, conversation, message, unrecognized Twist URL, non-Twist URL)
  • Build passes (npm run build)
  • All 181 tests pass (npm test)
  • Lint clean (npm run lint)
  • Manual: tw view https://twist.com/a/1585/msg/1292001/m/107734984
  • Manual: tw view <url> --json and tw view --json <url> both work

🤖 Generated with Claude Code

@scottlovegrove scottlovegrove self-assigned this Feb 18, 2026
@doistbot doistbot requested a review from pauloslund February 18, 2026 15:13
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 introduces a new tw view <url> command that intelligently routes Twist URLs to the correct subcommand, significantly enhancing the CLI's navigation capabilities. The implementation includes a classifyTwistUrl() helper for robust URL classification, and all tests for this new functionality are passing, indicating a high quality and well-tested addition. No issues were flagged during the review.

Share FeedbackReview Logs

Base automatically changed from rename-msg-to-conversation to main February 19, 2026 09:49
Classifies Twist URLs and routes to the appropriate subcommand
(thread, conversation, or msg view), removing the need to know
the entity type before viewing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scottlovegrove scottlovegrove merged commit b5263fa into main Feb 19, 2026
2 checks passed
@scottlovegrove scottlovegrove deleted the scottl/view-by-url branch February 19, 2026 09:50
github-actions bot pushed a commit that referenced this pull request Feb 19, 2026
# [2.1.0](v2.0.0...v2.1.0) (2026-02-19)

### Features

* add `tw view <url>` router command ([#42](#42)) ([b5263fa](b5263fa))
@github-actions
Copy link

🎉 This PR is included in version 2.1.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.

1 participant