[Feature]: wsh layout save/load — serialize a workspace/tab to JSON and replay it
Feature description
Wave already persists saved workspaces (tabs, blocks, layouts) automatically. But there's no way to reproduce a workspace setup programmatically — no equivalent of tmuxinator, smug, or VS Code's code-workspace files.
Today, wsh run, wsh launch, wsh web open, wsh view each create blocks one at a time, but there's no compositional API to say "lay out this set of blocks in this configuration." wsh blocks list exposes block IDs but is read-only (wsh-reference#blocks).
As a user with multiple repos + a monitoring stack, I want a per-project layout file checked into the repo (or ~/.config/waveterm/layouts/) that I can replay with one command:
wsh layout apply ~/Git/my-supervision/.wave-layout.json
…and end up with the same tab/block tree every time, on every machine.
Implementation Suggestion
wsh layout save [<file>]— serialize the current tab (or--workspace, or--all) to JSON: tab metadata, layout tree, per-blockmeta(view, controller, cmd, cwd, connection, magnified, etc.). The internal layout system (docs) already has a tree representation — just expose it.wsh layout apply <file> [--into-tab|--new-tab|--new-workspace]— recreate the tree, instantiating each block via the existing block-creation paths. Respectconnection,cmd:cwd,cmd:initscript, etc. so connections.json + secrets are reused.- JSON schema + json-schema entry in the same way
widgets.jsonandconnections.jsonget autocomplete (v0.11.1 release notes). - Optional:
widgets.jsonwidgets that point at a layout file ("view": "layout") so a single-click button restores a whole tab tree.
Anything else?
This composes beautifully with existing features:
term:durable: trueper-block in the layout file → reproducible long-running setups.cmd:initscriptentries already in connections.json → no duplication.- A team can commit
.wave-layout.jsonnext todocker-compose.yml/Makefileto onboard new contributors with one command.
Closely related (but not duplicate): #1372 (env vars from another block), #2738 (CLI focus/switch tabs), #3196 (rename tabs via wsh), #2106 (set window title via wsh). Those are individual primitives; this issue is about the composition layer on top.