Namespace Devbox VSCode Extension
A VSCode extension that allows you to connect to Namespace devboxes via SSH using namespace:// URIs.
Features
- Handles
namespace://<devboxname> URIs
- Automatically downloads the latest devbox CLI from GitHub releases
- Calls
devbox prepare to get SSH connection details
- Integrates with the Remote-SSH extension to establish connections
Prerequisites
- VSCode with the Remote-SSH extension installed
- Internet connection to download devbox CLI and connect to devboxes
Usage
Via URI
Open a namespace:// URI in VSCode:
namespace://my-devbox-name
Via Command Palette
- Open Command Palette (Cmd/Ctrl + Shift + P)
- Run "Connect to Namespace Devbox"
- Enter the devbox name when prompted
How it works
- When a
namespace:// URI is opened, the extension extracts the devbox name
- Downloads the latest devbox CLI binary if not already cached
- Runs
devbox prepare <devboxname> which returns JSON with SSH details:
{
"ssh_endpoint": "user@host:port",
"ssh_key_path": "/path/to/ssh/key"
}
- Creates a temporary SSH config entry with the provided details
- Uses the Remote-SSH extension to connect to the devbox
Development
To build and test the extension:
cd devbox/vscode/extension
npm install
npm run compile
Then press F5 in VSCode to launch a new Extension Development Host window.
Installation
To package the extension:
npm install -g vsce
vsce package
This creates a .vsix file that can be installed in VSCode.
| |