vscode_composerize
Convert between docker run commands and Docker Compose YAML without leaving VS Code.
vscode_composerize brings Composerize and Decomposerize into the Command Palette, so you can turn quick container commands into a compose.yaml, merge new services into an existing Compose file, or go the other way and generate docker run commands from Compose YAML.

Features
- Convert a
docker run command from your clipboard into Docker Compose YAML.
- Convert a selected
docker run command into Docker Compose YAML.
- Merge a converted service into the currently open Compose file when it already contains a
services: section.
- Convert Compose YAML from your clipboard into
docker run commands.
- Convert selected Compose YAML into
docker run commands.
- Works entirely inside the active editor using the VS Code Command Palette.
Commands
Open the Command Palette with F1 or Ctrl+Shift+P, then run one of:
| Command |
Input |
Output |
Composerize clipboard |
Clipboard docker run command |
Compose YAML inserted at the cursor, or merged into the active Compose file |
Composerize selection |
Selected docker run command |
Compose YAML replacing the selection, or merged into the active Compose file |
Decomposerize clipboard |
Clipboard Compose YAML |
Multiline docker run command inserted at the cursor |
Decomposerize selection |
Selected Compose YAML |
Multiline docker run command replacing the selection |
Composerize Example
Copy or select:
docker run -d --name my-web-app -p 8080:80 nginx:latest
Run Composerize clipboard or Composerize selection:
services:
nginx:
ports:
- 8080:80
container_name: my-web-app
image: nginx:latest
Merge Into Existing Compose Files
When the active editor looks like a Docker Compose file and contains a top-level services: section, Composerize passes the current file content to the Composerize merge API.
For example, if your file already contains:
services:
api:
image: node:20
and you composerize:
docker run -d --name web -p 8080:80 nginx:latest
the extension replaces the active document with merged Compose YAML:
services:
api:
image: node:20
nginx:
ports:
- 8080:80
container_name: web
image: nginx:latest
Merge Note
Composerize currently concatenates some array fields while merging. If you composerize the exact same command into the same service repeatedly, list values such as ports, volumes, or environment may be duplicated. This comes from Composerize's merge behavior, not from VS Code insertion.
Decomposerize Example
Copy or select:
services:
web:
image: nginx:latest
ports:
- 8080:80
Run Decomposerize clipboard or Decomposerize selection:
docker run -p 8080:80 \
nginx:latest
Tips
- Use
Composerize clipboard when you copied a command from docs, a terminal, or a deployment note.
- Use
Composerize selection when the command is already in a scratch file.
- Use
Decomposerize selection on one service or a whole Compose file.
- For merge mode, open the target
compose.yaml or docker-compose.yml file before running a Composerize command.
Development
Install dependencies:
pnpm install
Build the extension:
pnpm esbuild:base
Run checks:
pnpm lint
pnpm compile:test
Package the extension:
pnpm package
Credits
This extension is a VS Code wrapper around:
License
See LICENSE.