Author, validate, spawn, and tear down VS Code devcontainers — locally or over SSH — from one command group in the pks CLI.
pks devcontainer <command> [options]$ pks devcontainer init MyProjectGenerate .devcontainer/devcontainer.json from flags
$ pks devcontainer wizardBuild a configuration through guided prompts
$ pks devcontainer validate --strictLint the configuration and fail on warnings
$ pks devcontainer spawnRun the devcontainer and open it in VS Code
$ pks devcontainer list --allShow managed devcontainers including stopped ones
$ pks devcontainer destroyRemove a container and its Docker volumes
pks devcontainer manages devcontainer configurations for isolated development environments. It covers two jobs that share a filename and nothing else: writing the .devcontainer/devcontainer.json file, and running the container that file describes.
pks devcontainer is a command group in the pks CLI. It generates a devcontainer configuration for a repository, checks that configuration for errors, and then runs it as a real Docker container backed by a named volume — on your machine, on a registered SSH target, or on an Azure VM it starts for you.
init, wizard, and validate read and write files on disk. Docker is never involved.spawn, list, connect, and destroy operate on running containers and their Docker volumes, locally or over SSH.init is flag-driven and scriptable. wizard walks through templates, features, required environment variables, and extensions with prompts.validate checks structure, features, extensions, ports, base image, and referenced file paths in one pass, with a --strict mode for CI.spawn puts the workspace in a named Docker volume rather than a bind mount, so the container owns its own copy of the files.spawn --ssh-target runs the same flow on another machine, installing Node 20 and the devcontainer CLI there if they are missing.spawn compares the host configuration, the container's build-time label, and the volume contents, and asks how to resolve a mismatch.destroy removes the container, its named volumes, and any staged remote copy of the project.Start in a repository. init or wizard writes .devcontainer/devcontainer.json. validate reads that file and reports problems. Neither command needs Docker, so both run in CI.
spawn picks the file up from there. It requires .devcontainer/devcontainer.json to already exist, checks that Docker and the @devcontainers/cli npm package are available, generates or accepts a Docker volume name, builds the container, and launches VS Code against it. list shows what spawn produced, connect reopens one of those containers in VS Code without rebuilding, and destroy removes it along with its volumes.
init, wizard, validate) fail on missing files and bad JSON.spawn, list, connect, destroy) fail on missing Docker, a missing devcontainer CLI, or an unreachable SSH target.Two other pks commands build directly on this machinery: pks claude and pks vibecast both extend the spawn command and reuse its flags and remote-spawn behavior.
init · wizard · validate · spawn · list · connect · destroy
| Command | What it does |
|---|---|
init | Generate .devcontainer/devcontainer.json from flags. |
wizard | Build the same configuration through guided prompts. |
validate | Lint an existing configuration and report errors and warnings. |
spawn | Run the devcontainer in a Docker volume and open VS Code. |
list | Show managed devcontainers as a table or JSON. |
connect | Reopen a running devcontainer in VS Code. |
destroy | Remove a container and its named Docker volumes. |
Every subcommand inherits four options from the shared settings base: -o|--output-path <PATH>, -v|--verbose, -f|--force, and --dry-run. Several commands ignore some of them — each page states which.
Open an already-running devcontainer in VS Code by container ID or interactive pick, locally or through Remote-SSH on a registered target.
pks devcontainer connect [CONTAINER_ID] [options]
Permanently remove a managed devcontainer, its named Docker volumes, and any staged remote project files, behind an explicit confirmation step.
pks devcontainer destroy [CONTAINER_ID] [options]
Generate a .devcontainer/devcontainer.json non-interactively from flags — template, features, extensions, ports, and forwarded environment variables.
pks devcontainer init [NAME] [options]
Show managed devcontainers with status, volumes, image, and creation time, on this machine or a registered SSH target, as a table or JSON.
pks devcontainer list [options]
Run a project's devcontainer in a named Docker volume on this machine, a registered SSH target, or a new Azure VM, and open it in VS Code.
pks devcontainer spawn [PROJECT_PATH] [options]
Lint an existing devcontainer.json — configuration structure, features, VS Code extensions, forwarded ports, base image, and referenced file paths.
pks devcontainer validate [CONFIG-PATH] [options]
Build a devcontainer configuration through guided prompts: template, features, required environment variables, VS Code extensions, and advanced settings.
pks devcontainer wizard [options]