The only thing missing in Sprites right now is a simple way to open a VS Code instance connected to it. I imagine running code . inside a Sprite machine within a directory—just like I do on my local terminal—and having it open a VS Code instance on my local machine with everything set up similar to the GitHub Codespaces experience, but much faster.
code-server runs a web-based VS Code instance and yes, it works, but it’s not my local VS Code instance. It’s close, but not quite.
If Sprites are able to forward ports to the host machine, I’d think it should be pretty simple to have it working with the VS Code Remote SSH extension (or maybe a custom one developed by the Sprites team).
I mean, it comes with all languages, frameworks and agents CLIs. It’s only missing being able to connect to a Sprite from VS Code.
Ok, I got it working! code-server is not official by Microsoft, it’s based on the open source version of VS Code which comes with limitations.
On the other hand, Microsoft offer its own “Code Server” and Tunnels.
All that’s needed is to run the curl + tar commands and then
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz
./code tunnel
And then you can connect remotely from your local VS Code instance.
So my suggestion would be to already provide the code CLI via a shim as you already do with the other CLI tools so simply creating a new sprite and then doing `code tunnel` would allow for quickly connecting to it from the host’s VS Code.
The tunnel command requires GitHub/Microsoft authentication and routes all your traffic through Azure. If you want to skip that, you can run ./code serve-web on the Sprite, then run sprite proxy 8000 on your local machine.
The serve-web command will give you a URL like http://127.0.0.1:8000?tkn=<uuid> where you can access a VS code interface.