Cursor Codespaces
A VS Code/Cursor extension that provides seamless GitHub Codespaces connectivity via GitHub CLI. Connect to your Codespaces with a single click, directly from your editor.
Features
- 🚀 One-Click Connection - Connect to any Codespace with a single click
- 📋 Custom Explorer View - Browse all your Codespaces in a dedicated sidebar view
- 🔄 Auto-Start - Automatically starts shutdown Codespaces before connecting
- ⚡ Real-Time Status - See the current state of all your Codespaces (Available, Shutdown, Starting, etc.)
- 🔐 Automatic SSH Config - Manages SSH configuration automatically
- 🎯 Smart Status Bar - Quick access button in the status bar
- 🔄 Auto-Refresh - Always shows the latest Codespace status
Requirements
- GitHub CLI (
gh) - Must be installed and authenticated
- VS Code/Cursor - Version 1.99.0 or higher
- Remote-SSH Extension - Required for connecting to Codespaces
- VS Code: Install "Remote - SSH" (ms-vscode-remote.remote-ssh) from the marketplace
- Cursor: Usually built-in, but on some platforms (e.g., Linux) you may need to install it manually
- The extension will prompt you to install it if it's missing
Installation
From VS Code Marketplace
- Open VS Code/Cursor
- Go to Extensions view (
Ctrl+Shift+X or Cmd+Shift+X on Windows/Linux, Cmd+Shift+X on Mac)
- Search for "Cursor Codespaces"
- Click "Install"
- The extension will be installed and ready to use
For Developers (Building from Source)
If you want to build from source or contribute:
git clone https://github.com/orbiktech/cursor-codespaces-extension.git
cd cursor-codespaces-extension
npm install
npm run compile
vsce package
Then install the generated .vsix file:
- Go to Extensions view
- Click the
... menu and select "Install from VSIX..."
- Select the generated
.vsix file
Usage
Method 1: Custom Explorer View (Recommended)
Open the Codespaces Explorer
- Click the "GitHub Codespaces" icon in the Activity Bar (left sidebar)
- The icon appears in the sidebar menu (see image below)
- Or use the Command Palette:
Cursor Codespaces: Show Codespaces Explorer

The GitHub Codespaces icon highlighted in the Activity Bar sidebar
View Your Codespaces
- All your Codespaces are listed with their current status
- Status indicators:
- 🟢 Green circle = Available
- 🔴 Red circle = Shutdown
- 🟡 Yellow spinning = Starting/Other states
- Note: If GitHub CLI is not installed, you'll see installation instructions with a link to download it
Connect to a Codespace
- Click on any Codespace in the list
- The extension will:
- Start the Codespace if it's shutdown (up to 5 minutes wait)
- Update SSH configuration automatically
- Open the connection in the current window
Refresh the List
- Click the refresh button (🔄) in the explorer title bar
- Or use Command Palette:
Cursor Codespaces: Refresh Explorer
- Click the "Connect to Codespace" button in the status bar (bottom right)
- Select a Codespace from the list
- The connection process will start automatically
Method 3: Command Palette
- Open Command Palette (
Ctrl+Shift+P or Cmd+Shift+P)
- Type "Connect to Codespace"
- Select
Cursor Codespaces: Connect to Codespace
- Choose a Codespace from the list
How It Works
- Authentication Check - Verifies GitHub CLI is installed and authenticated
- Codespace Selection - Lists all your Codespaces with current status
- Auto-Start - If Codespace is shutdown, starts it via GitHub API
- Status Monitoring - Waits for Codespace to become available (up to 5 minutes)
- SSH Configuration - Generates and merges SSH config automatically
- Connection - Opens the Codespace in your current window
Troubleshooting
"Remote-SSH extension is required"
Solution:
- The extension will show a prompt to install Remote-SSH when needed
- Click "Install Remote-SSH" to open the extension marketplace
- Or manually install "Remote - SSH" (ms-vscode-remote.remote-ssh) from the marketplace
- After installation, restart Cursor/VS Code and try again
"GitHub CLI (gh) is not installed"
Solution:
- If you open the Codespaces Explorer, you'll see a helpful message with a link to install GitHub CLI
- Or install directly from: https://cli.github.com/
- After installation, refresh the explorer to see your Codespaces
"GitHub CLI authentication required"
Solution: Run gh auth login in your terminal and complete the authentication flow.
"Additional GitHub scopes required"
Solution: Run gh auth refresh -h github.com -s codespace to grant the required scope.
Solution: The extension can help you fix this automatically. When prompted:
- Click "Fix Devcontainer"
- The extension will add the SSHD feature to your
.devcontainer/devcontainer.json
- Commit and rebuild your Codespace
"Codespace did not become available within 5 minutes"
Possible causes:
- Codespace is taking longer than expected to start
- Network connectivity issues
- GitHub service issues
Solution:
- Wait a bit longer and try again
- Check your Codespace status on GitHub.com
- Try refreshing the explorer and connecting again
Connection opens but workspace is empty
Solution:
- The connection might still be establishing
- Wait a few seconds for the workspace to load
- Check the Remote-SSH output panel for any errors
- Try clicking the host in the Remote-SSH explorer manually
Extension Settings
This extension currently doesn't expose any configurable settings. All functionality works out of the box with sensible defaults.
Permissions
The extension requires permission to:
- Modify
~/.ssh/config - To add Codespace SSH configurations (first time only)
- Access GitHub CLI - To list and manage Codespaces
- Execute shell commands - To run
gh CLI commands
Development
Building from Source
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension
vsce package
Project Structure
src/
├── extension.ts # Main extension entry point
├── ghService.ts # GitHub CLI interactions
├── sshConfig.ts # SSH config management
├── codespacePicker.ts # QuickPick UI for codespace selection
├── codespaceExplorer.ts # Custom explorer view
├── remoteSsh.ts # Remote-SSH integration
└── devcontainerFixer.ts # Devcontainer SSHD fixer
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Acknowledgments
- Built for Cursor
- Uses GitHub CLI for Codespace management
- Integrates with Remote-SSH extension
Made with ❤️ for the developer community