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.
- π 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
- GitHub CLI (
gh) - Must be installed and authenticated- Install from: https://cli.github.com/
- Authenticate with:
gh auth login - Required scope:
codespace
- 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
- Open VS Code/Cursor
- Go to Extensions view (
Ctrl+Shift+XorCmd+Shift+Xon Windows/Linux,Cmd+Shift+Xon Mac) - Search for "Cursor Codespaces"
- Click "Install"
- The extension will be installed and ready to use
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 packageThen install the generated .vsix file:
- Go to Extensions view
- Click the
...menu and select "Install from VSIX..." - Select the generated
.vsixfile
-
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
- Open Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Type "Connect to Codespace"
- Select
Cursor Codespaces: Connect to Codespace - Choose a Codespace from the list
- 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
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
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
Solution: Run gh auth login in your terminal and complete the authentication flow.
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
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
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
This extension currently doesn't expose any configurable settings. All functionality works out of the box with sensible defaults.
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
ghCLI commands
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension
vsce packagesrc/
βββ 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
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: GitHub Wiki
- Built for Cursor
- Uses GitHub CLI for Codespace management
- Integrates with Remote-SSH extension
Made with β€οΈ for the developer community
