AGENT SKILL

devcontainer-cli

This skill should be used when the user asks about "devcontainer CLI", "devcontainer up", "devcontainer exec", "devcontainer build", "devcontainer read-configuration", "run-user-commands", "CI devcontainer", "install devcontainer CLI", or needs to automate devcontainer operations from the command line.

License 许可
MIT
最近更新
2026-08-03
Stars
★ 1
Forks
0

01 前言 Front Matter

name
devcontainer-cli
description
This skill should be used when the user asks about "devcontainer CLI", "devcontainer up", "devcontainer exec", "devcontainer build", "devcontainer read-configuration", "run-user-commands", "CI devcontainer", "install devcontainer CLI", or needs to automate devcontainer operations from the command line.

02 资源文件 2

03 SKILL.md 正文

Dev Container CLI Reference

Overview

The devcontainer CLI (@devcontainers/cli) provides full container lifecycle management through subcommands and flags. All commands support JSON output for programmatic integration. Install via npm install -g @devcontainers/cli or manage through mise.

Core Commands

devcontainer up

Create and start a development container.

devcontainer up --workspace-folder .
devcontainer up --workspace-folder . --remove-existing-container
devcontainer up --workspace-folder . --config .devcontainer/custom.json

Key flags:

  • --workspace-folder <path> — Workspace directory (required)
  • --config <path> — Custom devcontainer.json path
  • --remove-existing-container — Delete and recreate
  • --skip-post-create — Skip postCreateCommand and later
  • --skip-non-blocking-commands — Stop after updateContentCommand
  • --mount <spec> — Add mounts (repeatable)
  • --remote-env <KEY=VALUE> — Add env vars (repeatable)
  • --id-label <KEY=VALUE> — Container tracking labels
  • --image-name <image> — Specify output image name

JSON output:

{"outcome": "success", "containerId": "<id>", "remoteUser": "<user>", "remoteWorkspaceFolder": "/path"}

devcontainer exec

Execute a command in a running container.

devcontainer exec --workspace-folder . -- npm test
devcontainer exec --workspace-folder . --remote-env CI=true -- pytest

Key flags:

  • --workspace-folder <path> — Target workspace
  • --id-label <KEY=VALUE> — Target by label
  • --remote-env <KEY=VALUE> — Add env vars for command
  • Arguments after -- passed to target command

devcontainer build

Build container image from configuration.

devcontainer build --workspace-folder . --image-name ghcr.io/org/repo:tag
devcontainer build --workspace-folder . --image-name img --platform linux/amd64,linux/arm64 --push

Key flags:

  • --workspace-folder <path> — Source workspace (required)
  • --image-name <image> — Output image reference (required)
  • --no-cache — Skip layer caching
  • --platform <platforms> — Multi-platform build
  • --push — Push to registry after build
  • --cache-from <image> — Pull build cache from registry

devcontainer run-user-commands

Re-execute lifecycle commands on a running container.

devcontainer run-user-commands --workspace-folder .
devcontainer run-user-commands --workspace-folder . --skip-non-blocking-commands

Use case: Re-run setup after config changes, debug lifecycle issues.

devcontainer read-configuration

Output merged configuration for debugging.

devcontainer read-configuration --workspace-folder . --include-merged-configuration

Use case: Debug config resolution, understand feature merging, validate overrides.

CI/CD Patterns

GitHub Actions

- uses: devcontainers/ci@v0.3
  with:
    imageName: ghcr.io/${{ github.repository }}/devcontainer
    push: filter
    refFilterForPush: refs/heads/main

Manual CI Build

devcontainer build --workspace-folder . \
  --image-name ghcr.io/org/repo:$SHA \
  --cache-from ghcr.io/org/repo:main \
  --push

Running Tests in CI

devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . -- npm test

Additional Resources

Reference Files

For complete flag reference and all 11 subcommands:

  • references/cli-full-reference.md — All subcommands, flags, and output formats

Related Skills

  • devcontainer-lifecycle — Understanding lifecycle events the CLI manages
  • devcontainer-features — Feature CLI subcommands (test, package, publish)

04 同仓库更多 Skills

ray-manaloto
ray-manaloto/macos-development-environment

next-workflow-step

Use this skill when the user wants to transition to the next workflow step, wrap up a session cleanly, prepare a handoff, or says things like "next step", "continue the workflow", "wrap up", "hand off", "move to the next phase", "what's next in embrace", or "prepare for /clear". Also triggers when the current octo:embrace phase appears complete and no explicit next action is set.

★ 1
ray-manaloto
ray-manaloto/macos-development-environment

source-discovery

This skill should be used when the user asks to "find sources", "discover URLs", "catalog a source", "classify a URL", "search for libraries", "check what exists", or mentions source discovery, URL cataloging, source classification, or research source management.

★ 1
ray-manaloto
ray-manaloto/macos-development-environment

review-synthesis

This skill should be used when the user asks to "summarize review findings", "prioritize fixes", "rank review issues", "combine reviewer feedback", "create action items from review", or mentions review synthesis, finding prioritization, severity ranking, or review result summarization.

★ 1
ray-manaloto
ray-manaloto/macos-development-environment

research-scoring

This skill should be used when the user asks to "score research", "check research quality", "evaluate coverage", "measure improvement", "assess research completeness", or mentions research scoring, quality metrics, coverage gaps, improvement baseline, or research pipeline status.

★ 1
ray-manaloto
ray-manaloto/macos-development-environment

notebooklm-integration

This skill should be used when the user asks to "ingest into NotebookLM", "query NotebookLM", "add sources to notebook", "cross-source synthesis", "check stale sources", or mentions NotebookLM, notebook integration, source ingestion, or knowledge consolidation.

★ 1
ray-manaloto
ray-manaloto/macos-development-environment

evidence-synthesis

This skill should be used when the user asks to "synthesize findings", "combine research", "cross-reference sources", "summarize evidence", "write a deep review", or mentions evidence synthesis, finding consolidation, cross-source analysis, or research summarization.

★ 1