Read configuration outputs logs as well as configuration

Open
#873 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Start by reproducing the devcontainer read-configuration --include-merged-configuration --log-format json command from the example usage, including its redirected output, then trace the read-configuration CLI entry point and its output handling. Confirm whether logs and configuration are intentionally combined, and define completion as output that matches the command's documented example without the reported ambiguity.

Written by the indexing model from the issue text.

Description

info-needed

When running devcontainer read-configuration --include-merged-configuration --log-format json --workspace-folder ../workspace 2>/dev/null > server/configuration.json as suggested in the example usage folder, it outputs logs in json format, then at the end, the JSON configuration. Similarly if I remove --log-format json .

Example output:

{"type":"text","level":3,"timestamp":1724085707436,"text":"@devcontainers/cli 0.65.0. Node.js v20.14.0. darwin 24.1.0 arm64."}
{"type":"start","level":2,"timestamp":1724085707436,"text":"Run: git rev-parse --show-cdup"}
{"type":"stop","level":2,"timestamp":1724085707448,"text":"Run: git rev-parse --show-cdup","startTimestamp":1724085707436}
{"type":"start","level":2,"timestamp":1724085707449,"text":"Run: docker ps -q -a --filter label=devcontainer.local_folder=/DEVCONTAINER_CLI_PATH/workspace/.devcontainer/devcontainer.json"}
{"type":"stop","level":2,"timestamp":1724085707476,"text":"Run: docker ps -q -a --filter label=devcontainer.local_folder=/DEVCONTAINER_CLI_PATH/workspace/.devcontainer/devcontainer.json","startTimestamp":1724085707449}
{"type":"start","level":2,"timestamp":1724085707476,"text":"Run: docker inspect --type container a183f5305ed0"}
{"type":"stop","level":2,"timestamp":1724085707503,"text":"Run: docker inspect --type container a183f5305ed0","startTimestamp":1724085707476}
{"configuration":{"name":"devcontainer CLI Demo","build":{"dockerfile":"Dockerfile"},"customizations":{"vscode":{"extensions":["streetsidesoftware.code-spell-checker","mutantdino.resourcemonitor"],"settings":{"resmon.show.battery":false,"resmon.show.cpufreq":false}},"openvscodeserver":{"extensions":["streetsidesoftware.code-spell-checker"],"settings":{}}},"features":{"ghcr.io/devcontainers/features/go:1":{"version":"1.18.4"},"ghcr.io/devcontainers/features/node:1":{"version":"16.15.1","nodeGypDependencies":false},"ghcr.io/devcontainers/features/desktop-lite:1":{},"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/sshd:1":{}},"appPort":["127.0.0.1:2222:2222",8000,6080],"remoteUser":"vscode","configFilePath":{"$mid":1,"fsPath":"/Users/tjs/Documents/.coding/open-source-repl/data/templates/workspace/.devcontainer/devcontainer.json","path":"/Users/tjs/Documents/.coding/open-source-repl/data/templates/workspace/.devcontainer/devcontainer.json","scheme":"vscode-fileHost"}},"workspace":{"workspaceFolder":"/workspaces/.coding/open-source-repl/data/templates/workspace","workspaceMount":"type=bind,source=/Users/tjs/Documents/.coding,target=/workspaces/.coding,consistency=consistent"},"mergedConfiguration":{"name":"devcontainer CLI Demo","build":{"dockerfile":"Dockerfile"},"features":{"ghcr.io/devcontainers/features/go:1":{"version":"1.18.4"},"ghcr.io/devcontainers/features/node:1":{"version":"16.15.1","nodeGypDependencies":false},"ghcr.io/devcontainers/features/desktop-lite:1":{},"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/sshd:1":{}},"appPort":["127.0.0.1:2222:2222",8000,6080],"remoteUser":"vscode","configFilePath":{"$mid":1,"fsPath":"/Users/tjs/Documents/.coding/open-source-repl/data/templates/workspace/.devcontainer/devcontainer.json","path":"/Users/tjs/Documents/.coding/open-source-repl/data/templates/workspace/.devcontainer/devcontainer.json","scheme":"vscode-fileHost"},"init":true,"privileged":true,"capAdd":["SYS_PTRACE"],"securityOpt":["seccomp=unconfined"],"entrypoints":["/usr/local/share/desktop-init.sh","/usr/local/share/docker-init.sh","/usr/local/share/ssh-init.sh"],"mounts":[{"source":"dind-var-lib-docker-1r24dt41uav7vdhklt8d2bd3dnr3h8f1hftte0fss9ufcg2rom8j","target":"/var/lib/docker","type":"volume"}],"customizations":{"vscode":[{"extensions":["ms-azuretools.vscode-docker"]},{"extensions":["golang.Go"]},{"extensions":["dbaeumer.vscode-eslint"]},{"extensions":["streetsidesoftware.code-spell-checker","mutantdino.resourcemonitor"],"settings":{"resmon.show.battery":false,"resmon.show.cpufreq":false}}],"openvscodeserver":[{"extensions":["streetsidesoftware.code-spell-checker"],"settings":{}}]},"onCreateCommands":[],"updateContentCommands":[],"postCreateCommands":[],"postStartCommands":[],"postAttachCommands":[],"remoteEnv":{},"containerEnv":{},"portsAttributes":{}}}

Dominant language
TypeScript
Stars
3k
Forks
461
Avg merge
18m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devcontainers/cli

All issues in devcontainers/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.