Use a GitHub Codespace for this repo, then attach Cursor with Remote - SSH using the GitHub CLI (gh codespace ssh). Authentication is handled by GitHub and gh.
The devcontainer includes the sshd feature so Codespaces SSH works as documented by GitHub.
After the Codespace starts, run task setup REPO=org/repo PR=123 to bootstrap a codecollection. See the README for full details.
Further reading
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
}Rebuild the devcontainer after changing features.
Install GitHub CLI (gh). If gh codespace ssh misbehaves, update to a recent gh release.
gh codespace list
gh codespace ssh -c YOUR_CODESPACE_NAME --Use your codespace name from the list. Shell user is runwhen.
gh codespace ssh -c YOUR_CODESPACE_NAME --config >> ~/.ssh/codespacesEdit the new Host block:
- Remove
IdentityFile …/codespaces.auto - In
ProxyCommand, remove-i …/codespaces.auto; keepgh cs ssh … --stdio --(end with--only)
Example:
Host cs.YOUR_CODESPACE_NAME.remote-updates
User runwhen
ProxyCommand ... gh cs ssh -c YOUR_CODESPACE_NAME --stdio -- -i ~/.ssh/codespaces.auto
IdentityFile ~/.ssh/codespaces.auto
...After editing, ProxyCommand should end with --stdio -- and there should be no IdentityFile for codespaces.auto.
Bulk cleanup example:
sed -i.bak \
-e 's|IdentityFile .*/\.ssh/codespaces\.auto||g' \
-e 's|-i .*/\.ssh/codespaces\.auto||g' \
~/.ssh/codespacesIn Cursor: Remote-SSH: Connect to Host… → select that host → Open Folder → /workspaces/codecollection-devtools (the devcontainer workspace root). After task setup, the codecollection/ symlink gives you direct access to codebundles.
- Run
gh codespace ssh -c YOUR_CODESPACE_NAME --again if the connection or auth state seems off. - SSH permission errors should not occur — the image and
postCreateCommandset/home/runwhen(755),.ssh(700), andauthorized_keys(600) automatically.
Stop or delete codespaces in GitHub when you no longer need them.
The sshd feature listens on port 2222 inside the container by default. This repo’s devcontainer.json forwards 3000 (logs) only; local workflows typically use Dev Containers: Reopen in Container. For SSH from the host, publish port 2222 and follow the feature docs (for example key-based login).
.devcontainer/devcontainer.json- Repository README — Getting started
- sshd feature README