# dflow environments:use

> Select an environment after the API confirms it exists in the current project.

Web page: /docs/cli/project/environments-use/

This selects an environment that already exists in the current project. The workspace and the project stay selected. A missing name leaves the config file unchanged.

```bash
dflow environments:use NAME
```

## Flags

`--output`, `--api`, and `--context` apply. The name argument is saved. The workspace and the project stay.

## What you see

The terminal prints `name`, `id`, and `environment`. The API list for the current project must contain the name.

## When it fails

A missing name exits 3 and leaves the config file unchanged. Exit 1: bad name or missing project. Exit 2: auth. Exit 10: unreachable.
