A lightweight CLI tool to add VS Code-style .code-workspace support to the Zed editor.
Since Zed's native extension API does not currently support window or folder management, this tool bridges the gap by using a Node.js CLI script combined with Zed's Task and Keymap system.
First, install the CLI globally so it can be executed from anywhere. Note that you need Node.js installed on your system.
git clone https://github.com/artumont/zed-workspaces.git zed-workspaces
cd zed-workspaces
pnpm install
pnpm build
npm install -g .To run the workspace manager from within Zed, you need to add it as a Task.
Open your Zed tasks file:
- Open the Command Palette (
Ctrl-Shift-PorCmd-Shift-P) - Search for "zed: open tasks" (this opens
~/.config/zed/tasks.json)
Add the following configuration to the tasks.json array:
[
{
"label": "Open Workspace",
"command": "zed-workspaces",
"args": ["open"],
"use_new_terminal": true
},
{
"label": "Create Workspace",
"command": "zed-workspaces",
"args": ["create"],
"use_new_terminal": true
}
]Note: Saving current workspace functionality is currently in development so for now you can only create new workspaces.
You can assign a keyboard shortcut to instantly trigger the "Open Workspace" task.
Open your Zed keymap file:
- Open the Command Palette (
Ctrl-Shift-PorCmd-Shift-P) - Search for "zed: open keymap" (this opens
~/.config/zed/keymap.json)
Add the shortcut under the Workspace context:
[
{
"context": "Workspace",
"bindings": {
"ctrl-shift-o": ["task::Spawn", { "task_name": "Open Workspace" }]
}
}
]Press your configured shortcut (Ctrl+Shift+O by default), or open the Command Palette, type task: spawn, and select Open Workspace.
- If your current folder contains exactly one
.code-workspacefile, Zed will launch a new window with all the folders defined in it immediately. - If your folder contains multiple workspace files, a terminal prompt will appear asking you to select one.
- If it cannot find any workspace file, it will display an error message.
The CLI uses the standard VS Code workspace format.
Example .code-workspace file:
{
"folders": [
{
"path": "../my-project"
},
{
"path": "../my-other-project"
}
],
"settings": {}
}