WSL2 support: bring-up script + comprehensive documentation (#9, #4)#16
Conversation
- #9: Add scripts/wsl-cyd-up.sh — one-command WSL2 bring-up helper Checks for usbipd, attaches CYD via hardware-id, verifies dialout permissions, starts vibe-bridge, execs serial_bridge. Handles missing device, permission errors, bridge already running. - Add `just wsl-up` recipe to Justfile for easy invocation. - #4: Add comprehensive WSL2 section to README documenting: - Windows prerequisites (usbipd-win, bind the device) - Quick start (just wsl-up) - Auto-reconnect on replug behavior - Troubleshooting (permissions, replug, bridge startup) Treats the full replug solution as documented existing behavior (usbipd auto-attach, serial_bridge auto-reconnect on new device). Users can upgrade to systemd services/supervised bring-up separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NbHMpmG4SriZqFfsVXvW53
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a WSL2 bring-up helper script (scripts/wsl-cyd-up.sh) that detects, binds, and attaches a USB-serial device into WSL, validates permissions, starts a bridge server, and launches serial_bridge. Adds a ChangesWSL2 Bring-up Script and Documentation
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Just as Justfile (wsl-up)
participant Script as wsl-cyd-up.sh
participant Windows as usbipd.exe
participant Bridge as vibe-bridge/serial_bridge
User->>Just: just wsl-up
Just->>Script: bash scripts/wsl-cyd-up.sh
Script->>Windows: check device present, bind/attach --wsl
Windows-->>Script: /dev/ttyUSB0 available
Script->>Script: verify read/write permissions
Script->>Bridge: start vibe-bridge on :5151 (if not running)
Script->>Bridge: exec serial_bridge --port /dev/ttyUSB0
Possibly related issues
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review of PR #16 surfaced three confirmed bugs: - scripts/wsl-cyd-up.sh: 'usbipd list' does not accept --hardware-id, so the presence check always failed and the script exited before doing anything. Filter 'usbipd list' output with grep instead. Also detect a running bridge by checking the listening port (:5151) via ss, rather than a dummy-token curl against auth-required /state (which never matched and wasted a 10s timeout every run, and could spawn a second bridge on the bound port). - Rewrote the helper with set -euo pipefail, repo-root resolution, an explicit bind step, and clearer permission guidance. - README: 'usbipd attach' is one-shot, not auto-attach-by-default; corrected the replug section and documented --auto-attach for persistence. Verified: the script now detects the live CYD (1a86:7523) and reaches the bind/attach steps instead of dying at the presence check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Description
WSL2 support: one-command bring-up script and comprehensive documentation.
Changes
feature: one-command WSL2 bring-up helper script (attach + bridge + serial_bridge) #9 — WSL2 bring-up script (
scripts/wsl-cyd-up.sh). One-command setup for running the bridge under WSL2:1a86:7523)./dev/ttyUSB0permissions (dialout group).vibe-bridgeif not already running.serial_bridge --port /dev/ttyUSB0.just wsl-uprecipe to Justfile for easy invocation.WSL2 support (umbrella): usbipd-win passthrough — bridge in WSL, COM ports invisible #4 — Comprehensive WSL2 documentation in README:
just wsl-up).serial_bridgeauto-reconnect).The script treats existing
serial_bridgeauto-reconnect behavior as the foundation and documents it. Users can optionally upgrade to systemd services or supervised bring-up for production deployments.Type of Change
Component
Testing
Closes #4
Closes #9
🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
just wsl-upcommand for Windows + WSL users.Documentation