v5.3.2 is out. Since 5.3.1, a failed connect no longer shows “Connected”. Read the release · CHANGELOG

Home / Guides

GitHub Codespaces in Cursor: a step-by-step setup

Short answer: Install the GitHub CLI, run gh auth login -s codespace, install Antigravity Codespaces Pro from Open VSX, let it use Cursor's bundled anysphere.remote-ssh, run Codespaces: Setup Doctor, then press Alt+C and pick a codespace.

This guide takes you from a fresh Cursor install to an open codespace. It takes about ten minutes, most of it waiting for installs.

What do you need before you start?

  • Cursor installed and up to date.
  • A GitHub account that can create codespaces, with at least one codespace or a repository to create one from.
  • An OpenSSH client. On Windows 10 and 11 it is usually present; check with ssh -V.

Step 1: How do I install the GitHub CLI?

install gh
# Windows
winget install --id GitHub.cli --source winget
# macOS
brew install gh

On Linux, use GitHub's official package repositories as described in the gh install guide. Restart Cursor afterwards so it sees the new PATH.

Step 2: How do I sign in with the codespace scope?

sign in
gh auth login -s codespace
gh auth status   # should list 'codespace' under Token scopes

Step 3: How do I install the extension?

Open the Extensions view, search for Antigravity Codespaces and install the one published by nirbhay-hiwse. Or use the command line:

install extension
cursor --install-extension nirbhay-hiwse.antigravity-codespaces

Step 4: Which Remote-SSH should I use?

Cursor bundles its own Remote SSH (anysphere.remote-ssh). The extension detects it and uses it, so there is nothing to install. Cursor's extension catalogue is backed by Open VSX, as Cursor's documentation explains.

Step 5: How do I run Setup Doctor?

Open the Command Palette and run Codespaces: Setup Doctor. Fix anything it marks in red; each item has a button.

Step 6: How do I connect?

Press Alt+C, choose a codespace, and a new window opens inside it. If it is stopped, turn it on from the Cloud Hub first.

If search in Cursor does not find the extension, download the .vsix from the latest release and use Extensions: Install from VSIX….

What if it does not connect?

  • Exit code 255: run gh auth status; usually the scope is missing or the codespace is stopped.
  • Exit code 127: the platform is wrong; Setup Doctor sets it to Linux.
  • Anything else: see Errors and alerts.

Other editors: Windsurf and the Remote-SSH comparison.

Frequently asked questions

Which scope does the GitHub CLI need?

The codespace scope. Run gh auth login -s codespace, then check that gh auth status lists codespace under Token scopes.

What does exit code 255 mean?

Usually the codespace scope is missing or the codespace is stopped. Run gh auth status to check.

What does exit code 127 mean?

The platform is wrong. Codespaces run Linux, and Setup Doctor sets the platform to Linux.

Found something wrong or out of date? Open an issue or edit the source of this page in a pull request.