# devcontainer-cli

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> The reference devcontainer CLI (@devcontainers/cli), installed globally with npm.


Installs the reference devcontainer CLI (`devcontainer`) as a global npm package.
It is the tool that reads a repository's `devcontainer.json`, builds the image
(Features included), and runs the file's lifecycle commands.

You rarely declare this recipe yourself: setting
[`sources[].devcontainer.enabled`](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/devcontainers/) on a
workstation implies both this devtool and [`docker`](https://docs-stg.ringleader.dev/reference/tools/devtools/docker/).
Declare it explicitly only to pin its version:

```yaml
devtools:
  - name: devcontainer-cli
    version: "0.80.0"
```

## Version behavior

| `version` | Result |
|-----------|--------|
| omitted | the latest published release |
| `0.80.0` | that exact npm version |

A workstation that already has `devcontainer` on PATH keeps the release it has. A changed
`version` replaces that release on the next configuration pass.

## Updates

With `updatePolicy: latest` and no `version`, the devcontainer CLI takes the
[npm route](https://docs-stg.ringleader.dev/reference/tools/devtools/#update-routes): about once a day, it moves to the newest npm release. A `devcontainer` command that is already
running keeps its release.

## Node.js

The recipe needs npm. If [`nodejs`](https://docs-stg.ringleader.dev/reference/tools/devtools/nodejs/) is
declared first, that Node is used; otherwise the recipe installs the distribution's
Node.js and npm. A configuration that also declares `npm`
[packages](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/package-installation/#language-toolchains) gets the
`nodejs` devtool added first when the workstation has no npm, so on Debian and Ubuntu the
tool runs on Node 24.

## Notes

- The engine is a separate concern: this recipe installs the CLI only, and
  [`docker`](https://docs-stg.ringleader.dev/reference/tools/devtools/docker/) provides what it drives.
  A devcontainer declaration implies both.
- Works on Debian, Ubuntu, and Alpine.

