---
url: /en/workspaces/default-dev-env.md
description: >
  Introduces the default cloud-native development environment image
  (`cnbcool/default-dev-env`) and explains how to configure automatic command
  execution on environment startup using the `CNB_WELCOME_CMD` environment
  variable.
---
The default environment image for cloud-native development is
[cnbcool/default-dev-env](https://cnb.cool/cnb/cool/default-dev-env).

## Configure Automatic Command Execution

After installing the VS Code extension [cnb-welcome](https://cnb.cool/cnb/cool/cnb-welcome),
configure the `CNB_WELCOME_CMD` environment variable to
automatically execute commands when the development environment opens.

::: tip
The default environment image `cnbcool/default-dev-env` comes with the `cnbcool.cnb-welcome` extension pre-installed —
no additional installation needed.
:::

### Configure in `.cnb.yml`

Declare a `vscode` event pipeline in the `.cnb.yml` of the repository's default branch
and set `CNB_WELCOME_CMD` in `env` to automatically run the specified command in the
terminal when the development environment opens:

```yaml title=".cnb.yml"
$:
  vscode:
    - services:
        - vscode
      env:
        CNB_WELCOME_CMD: echo "Environment ready, start coding"
      stages:
        - name: environment created
          script: echo "development environment created"
```

The value of `CNB_WELCOME_CMD` is a shell command that runs once when you enter the
development environment (WebIDE / remote client).

::: tip

* When `docker.image` / `docker.build` is not explicitly declared, the development
  environment uses the default image `cnbcool/default-dev-env`.
* For multiple steps or special characters, write them into a script file first and
  set `CNB_WELCOME_CMD` to a command that invokes the script, such as `bash /workspace/setup.sh`.

:::
