Skip to content

feat(remote): IDE-agnostic --open ssh mode with Tailscale wait - #234

Merged
gerchowl merged 3 commits into
feature/230-tailscale-key-injectionfrom
feature/231-ide-agnostic-wrappers
Mar 7, 2026
Merged

gerchowl merged 3 commits into
feature/230-tailscale-key-injectionfrom
feature/231-ide-agnostic-wrappers

Conversation

@gerchowl

@gerchowl gerchowl commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds --open ssh mode to devc-remote.sh that decouples the script from any specific IDE. After compose up, it polls the local tailnet for the container, then prints connection commands for any client.

What changed

  • --open ssh: waits up to 60s for the container to appear on the tailnet, then outputs:
    Connect via:
      ssh root@fd5-devc-sdsc
      ssh [email protected]
    
    Cursr:  cursr --remote ssh-remote+root@fd5-devc-sdsc /workspace/fd5
    VS Code: code --remote ssh-remote+root@fd5-devc-sdsc /workspace/fd5
    
  • read_workspace_folder(): extracted from open_editor(), reused by both devcontainer-protocol and SSH modes
  • wait_for_tailscale(): polls tailscale status --json locally, matches container by devcontainer.json name field
  • main() refactored: clean case/esac dispatch for cursr/code/ssh/none

--open modes summary

Mode Behavior
cursr (default) Open Cursr via devcontainer protocol URI
code Open VS Code via devcontainer protocol URI
ssh Wait for Tailscale, print connection commands
none Infra only, no IDE

Test plan

  • BATS: --open ssh skips editor detection
  • BATS: --open invalid rejects with updated error message
  • BATS: wait_for_tailscale and read_workspace_folder defined
  • All 37 tests pass
  • Manual: test with real Tailscale container on remote host

Part of

Epic: #232
Closes: #231
Stacked on: #233 (Tailscale key injection)

gerchowl and others added 3 commits March 6, 2026 22:28
…output

- Add --open ssh: waits for container to appear on tailnet (polls up to
  60s), then prints connection commands for ssh, Cursor, and VS Code
- Extract read_workspace_folder() helper from open_editor()
- Add wait_for_tailscale() that discovers the container via local
  tailscale status --json, matching devcontainer.json name field
- Refactor main() to use case/esac for cleaner mode dispatch
- Add BATS tests for --open ssh and new function definitions

Refs: #231
Default --open mode is now 'auto' instead of hardcoding 'cursor'.
Detection chain: TERM_PROGRAM env var → CLI availability → ssh fallback.
Terminal apps (WezTerm, iTerm, tmux) resolve directly to ssh mode.

Refs: #231
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The PR title check was false-positiving on legitimate references to
.cursor/, .claude/ directories and CLAUDE.md. Add allow_patterns to
agent-blocklist.toml that strip path-like occurrences before matching.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

Refs: #231
@gerchowl
gerchowl merged commit 9930815 into feature/230-tailscale-key-injection Mar 7, 2026
1 of 2 checks passed
@gerchowl
gerchowl deleted the feature/231-ide-agnostic-wrappers branch March 7, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant