Skip to content

feat: add Remote-SSH config hints for editor access#197

Merged
skulidropek merged 2 commits intoProverCoderAI:mainfrom
skulidropek:issue-196
Mar 25, 2026
Merged

feat: add Remote-SSH config hints for editor access#197
skulidropek merged 2 commits intoProverCoderAI:mainfrom
skulidropek:issue-196

Conversation

@skulidropek
Copy link
Contributor

@skulidropek skulidropek commented Mar 25, 2026

Summary

  • add a shared SSH access helper that derives both terminal SSH commands and Remote-SSH config snippets from the same runtime topology
  • surface editor-friendly access details during create/clone output and in docker-git ps/status summaries
  • cover the new access formatting with focused lib tests

Why

Issue #196 showed that nested inline SSH commands are brittle for Cursor and VS Code Remote-SSH. This change makes docker-git emit a stable inner SSH target, a deterministic ~/.ssh/config block, and the workspace path editors should open.

Mathematical Guarantees

Invariants

  • terminal SSH command and editor SSH config are derived from the same resolved runtime topology
  • localhost targets always use the configured SSH port, while in-container IP targets always switch to port 22
  • generated Remote-SSH aliases are deterministic and shell-safe for a given container name

Result Target

  • the desired end state is one stable SSH endpoint/alias per project that works across terminal, Cursor, VS Code, and similar Remote-SSH clients
  • for editors, the desired user-facing UX is one single command: docker-git editor-open
  • that command should resolve the current project alias and open the configured editor automatically, instead of forcing the user to remember code vs cursor invocations

Follow-up CLI

  • this PR stops at deterministic output and config snippets
  • the next logical step is a dedicated CLI flow with two layers:
    • low-level: docker-git ssh-config --install
    • end-user: docker-git editor-open

Example Output

create/clone output

SSH access: ssh -i /home/user/.ssh/id_ed25519 -tt -Y -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2223 dev@localhost
Remote-SSH host: dg-go-login-ozon-pr-56
Terminal shortcut: ssh dg-go-login-ozon-pr-56
Remote workspace: /home/dev/workspaces/hatsunemikustars/go-login-ozon/pr-56
VS Code/Cursor: Connect to Host... -> dg-go-login-ozon-pr-56

Add to ~/.ssh/config:
Host dg-go-login-ozon-pr-56
  HostName localhost
  User dev
  Port 2223
  LogLevel ERROR
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  IdentityFile /home/user/.ssh/id_ed25519
  IdentitiesOnly yes

status output

Project: /home/dev/.docker-git/hatsunemikustars/go-login-ozon/pr-56
SSH access: ssh -i /home/user/.ssh/id_ed25519 -tt -Y -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2223 dev@localhost
Remote-SSH host: dg-go-login-ozon-pr-56
Terminal shortcut: ssh dg-go-login-ozon-pr-56
Remote workspace: /home/dev/workspaces/hatsunemikustars/go-login-ozon/pr-56
name                     status          ports                 image
...                      ...             ...                   ...

single-command editor UX target

docker-git editor-open

Expected behavior:

Resolved SSH alias: dg-go-login-ozon-pr-56
Configured editor: code
Opening: code --folder-uri "vscode-remote://ssh-remote+dg-go-login-ozon-pr-56//home/dev/workspaces/hatsunemikustars/go-login-ozon/pr-56"

Equivalent low-level command under the hood:

code --folder-uri "vscode-remote://ssh-remote+dg-go-login-ozon-pr-56//home/dev/workspaces/hatsunemikustars/go-login-ozon/pr-56"

If the configured editor is Cursor, the same docker-git editor-open command should instead launch:

cursor --folder-uri "vscode-remote://ssh-remote+dg-go-login-ozon-pr-56//home/dev/workspaces/hatsunemikustars/go-login-ozon/pr-56"

Notes

  • for cross-host editor usage, docker-git now prints the inner container target plus an explicit note that the first hop should be added with the user's own ProxyJump or ProxyCommand

Verification

  • pnpm --filter ./packages/lib typecheck
  • pnpm exec vitest run tests/usecases/connection-info.test.ts tests/usecases/ssh-access.test.ts in packages/lib
  • pnpm --filter ./packages/app typecheck
  • pnpm --filter ./packages/lib lint

Closes #196

@skulidropek skulidropek merged commit a406743 into ProverCoderAI:main Mar 25, 2026
12 checks passed
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.

Разоабрться с подключением по SSH к Cursor, VS code

1 participant