VS Code extension for authoring and debugging Dalec specs.
Warning
Early Development: This extension is not production ready yet and may change significantly.
- π Auto-detects Dalec spec files (YAML with
#syntax=...header) - β¨ Schema-powered completions, hover, and validation via Red Hat YAML extension
- π BuildKit debugging support with
dalec-buildxdebug type βΆοΈ CodeLens actions for quick "Debug" and "Build" commands- π― Queries available targets from the Dalec frontend via
docker buildx build --call targets - π Smart context handlingβonly prompts when specs reference build contexts
- Install the extension (via
.vsixor Extension Manager) - Open a Dalec spec (any
.yml/.yamlfile starting with#syntax=...) - Run your first build using CodeLens or Command Palette
- View results in the integrated terminal
All commands are available via the Command Palette (Cmd/Ctrl + Shift + P):
| Command | Description |
|---|---|
Dalec: Build Current Spec |
Builds the currently opened Dalec spec using docker buildx build |
Dalec: Debug Current Spec |
Launches a BuildKit debug session for the current spec |
Dalec: Rerun Last Action |
Re-executes the last build or debug action with the same parameters |
Command Palette (Cmd/Ctrl + Shift + P)
Right-click Context Menu
Builds the currently opened Dalec spec using docker buildx build.
Requirements
- File must be a valid Dalec YAML spec (starts with
#syntax=...) - Docker with Buildx must be installed and running
How to use
- Open a Dalec spec file
- Either:
- Click the "Dalec: Build" CodeLens at the top of the file, or
- Open Command Palette (
Cmd/Ctrl + Shift + P) βDalec: Build Current Spec
- Select a target when prompted (targets are queried from the Dalec frontend via
docker buildx build --call targets) - Provide build context path if prompted (only when spec uses
contextsources)
Output
- Build runs in the integrated terminal
- Errors and logs appear in terminal output
Launches a BuildKit debug session for the current spec.
Requirements
- Same as Build, plus:
- Set
DALEC_ENABLE_DEBUG=1environment variable before launching VS Code
How to use
- Open a Dalec spec file
- Either:
- Click the "Dalec: Debug" CodeLens, or
- Open Command Palette β
Dalec: Build Current Spec(with debug environment enabled)
- Select a target and provide context if prompted
- Debug session starts with breakpoint support
Re-executes the previous build or debug action with the same target, spec file, and context settings.
How to use
- After running a build or debug command at least once
- Open Command Palette (
Cmd/Ctrl + Shift + P) βDalec: Rerun Last Action - The previous action is re-executed with the same parameters
Note: This is useful for quick iterationβchange your spec and immediately re-run without re-selecting the target.
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. Open/create a Dalec YAML spec β
β β β
β 2. Edit your spec (completions & validation) β
β β β
β 3. Run "Dalec: Build Spec" β
β β β
β 4. Fix any build errors β
β β β
β 5. Re-run build β iterate until success β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
Example scenarios:
| Goal | Action |
|---|---|
| Quick iteration on a spec | Use CodeLens "Build" button after each change |
| Debug a failing build step | Use "Debug Spec" to step through BuildKit execution |
| Test multiple targets | Run "Build Spec" and select different targets from the picker |
The extension activates for YAML files that match:
#syntax=ghcr.io/project-dalec/dalec/frontend:latest
# or
# syntax=ghcr.io/azure/dalec/frontend:latestFiles without this header are not recognized as Dalec specs.
For development:
cd dalec-vscode-extension
npm install
npm run compile
code --extensionDevelopmentPath=$(pwd)For testing:
- Build with
npx vsce package - Install
.vsixvia VS Code Extension Manager
Add to .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Dalec: Buildx Debug",
"type": "dalec-buildx",
"request": "launch",
"target": "frontend",
"specFile": "${file}",
"context": "${workspaceFolder}"
}
]
}- Docker with Buildx installed
- Red Hat YAML extension (auto-prompted)
| Issue | Solution |
|---|---|
| No CodeLens appearing | Ensure file starts with #syntax=... on the first line |
| Target picker is empty | Check Docker is running; extension queries targets via docker buildx build --call targets |
| Debug commands missing | Set DALEC_ENABLE_DEBUG=1 and restart VS Code |
| Schema validation not working | Install the Red Hat YAML extension |
π For more about Dalec, see the Dalec documentation!

