# dflow workspaces:use

> Choose the active workspace for this login.

Web page: /docs/cli/workspace/workspaces-use/

This chooses the active workspace for this login. Later commands use it. `WORKSPACE` is a name or an id. A login without a refresh token exits 2. `dflow context:use --workspace` does the same switch when a refresh token is saved.

```bash
dflow workspaces:use WORKSPACE
```

## Flags

Global flags only. This page does not add a flag.

## What you see

Later commands use that workspace. `WORKSPACE` is a name or an id. A name is matched on `GET /v1/workspaces`, then `POST /v1/auth/workspace` stores the new token. An id skips the list. `dflow context:use --workspace` does the same switch when this login has a refresh token.

## When it fails

A name that is not in the list exits 3. An id this login cannot see exits 3. A login without a refresh token exits 2.
