What I like about devcontainer is being able to have my whole development environment in my editor, with the IDE recognizing the language and the runtime I'm using, without installing anything on the host machine, since everything "runs" in containers. The IDE (VS Code) "talks" to the container and your development environment through a dedicated extension. I already wrote about this: Reproducing the devcontainer DX, but securely with SBX, where I used the VS Code Remote-SSH extension (or its Zed Editor equivalent) together with the SSH access feature of sbx.
But actually, you can do it without SSH 😮 🤔. Indeed, if your editor has the extension for your language, and your runtime (what will run inside sbx) also provides the LSP server (Language Server Protocol), you have everything you need.
I wanted to validate this using Zed Editor and a language that is not installed on my machine: Grain, on the occasion of the recent release of v0.7.3 Farro. To make it short, Grain is a functional language whose compilation target is WebAssembly.
The Grain Kit for SBX #
So I started by creating and publishing a Grain kit for sbx; you'll find the source code here: sbx-kits/grain-toolchain (always check the content of what you want to use).
Now, using it couldn't be simpler: create a sbxenv.yaml file in your working directory, with the following content:
schemaVersion: "1"
name: grain-dev-env
agent: shell
workspace: .
kits:
- docker.io/k33g/grain-toolchain-kit:0.7.3
✋ I used agent: shell because I don't need an AI agent for this project.
And now you just have to run:
sbx env run --force
And now you have a fully functional Grain environment:
Now destroy the sbx sandbox with the following command:
sbx env rm --force
All that's left is to set up our project with Zed Editor.
Grain and Zed Editor #
So, unfortunately, there is no Grain extension for Zed (no official one, at least). Never mind, I prepared one for you here: zed-extensions/zed-grain, 🦀 however, you'll need Rust to install it.
Grain Extension for Zed
Installation is simple:
- Clone the extension repository.
- Open the extensions page with
cmd-shift-x(macOS) orctrl-shift-x(Linux/Windows), or through the "Zed > Extensions" menu.zed - Click the Install Dev Extension button.Even simpler , you can also run the
zed: install dev extensionaction from the command palette.zed - In the dialog, select the root folder of the extension, the one containing
extension.toml.zed - Zed builds the extension from this folder. It shows up in the extensions list.
Now let's set up our project.
Zed Project Settings
We are in the working directory (the same one where the sbxenv.yaml file is), so create a .zed subfolder that will contain two files:
tasks.jsonsettings.json
The tasks
Here is the content of .zed/tasks.json:
[
{
"label": "Create shell sandbox (sbx)",
"command": "sbx",
"args": ["env", "create", "--force"],
"use_new_terminal": true,
"allow_concurrent_runs": true,
"reveal": "always",
"hide": "on_success"
},
{
"label": "Remove shell sandbox (sbx)",
"command": "sbx",
"args": ["env", "rm", "--force"],
"use_new_terminal": true,
"allow_concurrent_runs": true,
"reveal": "always",
"hide": "on_success"
},
{
"label": "Shell local",
"command": "zsh",
"use_new_terminal": true,
"allow_concurrent_runs": true
}
]
This file provides Zed commands to:
- Create an
sbxsandbox with the Grain runtime:"Create shell sandbox (sbx)" - Remove it: "Remove shell sandbox (sbx)"
- And also open a local shell (the host one, not the sandbox): Shell local
To call these commands, just open the command palette with cmd-shift-p (macOS) or ctrl-shift-p (Linux/Windows), select task: spawn in the list of commands, and then select the task to run.
Zed settings for the project
Here is the content of .zed/settings.json:
// Project settings for Zed.
// The Grain LSP runs inside the sbx sandbox "grain-dev-env"
// (which has the grain-toolchain kit).
{
"lsp": {
"grain-lsp": {
"binary": {
"path": "sbx",
"arguments": [
"exec", "-i",
"-w", "/Users/k33g/kDrive/Rickub/webassembly/grain-1st-steps/demo",
"grain-dev-env",
"grain", "lsp"
]
}
}
},
// Zed's integrated terminal opens a shell inside the sandbox.
"terminal": {
"shell": {
"with_arguments": {
"program": "sbx",
"args": [
"exec", "-it",
"-w", "/Users/k33g/kDrive/Rickub/webassembly/grain-1st-steps/demo",
"grain-dev-env",
"bash", "-l"
]
}
}
}
}
So we defined:
- A
"grain-lsp"entry in"lsp"to specify how to call the Grain LSP server with thegrain lspcommand, usingsbx execto run it inside the sandbox (it's important to set the absolute path of your working folder:/Users/k33g/kDrive/Rickub/webassembly/grain-1st-steps/demo, of course adapt it to your case). - And a
"terminal"entry to specify that the default terminal we open in Zed Editor will be thesbxshell.
And now we can start coding in Grain!
Get started with Grain in Zed Editor #
Launch Zed in your working folder with the zed . command:
➜ demo git:(main) ✗ pwd
/Users/k33g/kDrive/Rickub/webassembly/grain-1st-steps/demo
➜ demo git:(main) ✗ zed .
Once Zed is launched, you can run the task to create the sandbox:
And then, every time you open a terminal, you are in the sbx shell:
And now, when you start coding in Grain, you can see the LSP server at work:
If the LSP server isn't working, just restart it:
And of course, you can build and run your Grain code:
And if you install WasmEdge in the sandbox:
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
source $HOME/.wasmedge/env
wasmedge --version
You'll also be able to use it to run the hello.wasm module:
There you go! That's all for today. You've seen that it's pretty easy to set up, and since it's easy to mix kits, you can easily add other tools and toolchains. And of course, you can adapt what I did for any other language. Happy coding! 🤓
Find the demo code here: demo
Written by
Keep reading
Reproducing the devcontainer DX, but securely with SBX
Connect VS Code over SSH to an sbx sandbox built from kits, for a devcontainer-like workflow with microVM isolation, secrets protection and network policies.
Oct 17, 2026
Zed Editor + Docker Agent + ACP, but in a sandbox: running the agent with sbx
Run Docker Agent inside a Docker sandbox (sbx) and connect Zed to it over ACP, keeping llmman local while isolating the agent from your machine.
Oct 4, 2026
Improving the Developer Experience with SBX Kits
Improve the developer experience with sbx kits: reusable sandbox customizations for Go, Node.js, and code-server extensions.
May 1, 2026 From other blogs