> ## Documentation Index
> Fetch the complete documentation index at: https://www.unkey.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Unkey is two separate products. Compute builds, deploys, and runs apps behind a gateway. API Management issues API keys, enforces rate limits, manages identities and permissions, and reports usage. Say which product a page belongs to; a reader can use either without the other.
> Every Unkey API endpoint is an HTTP POST to https://api.unkey.com/v2/{service}.{procedure} with a root key in the Authorization: Bearer header. Root keys are workspace scoped.
> Error codes have the form err:{system}:{category}:{specific} and each has a page at /errors/{system}/{category}/{specific}.
> The word environment means production or preview in Compute. Rate limiting has four meanings on this site; the glossary lists them.

# unkey workspace list

> List the workspaces this machine has signed into and show which one is active.

List the workspaces that have a stored CLI session on this machine. Each `unkey login` stores one session per workspace, and the most recent login becomes the active workspace. Resource commands that use a CLI session send requests to the active workspace.

The command reads local sessions only. It doesn't call the API and needs no root key.

## Usage

```bash theme={"system"}
unkey workspace list
```

The command has no flags and doesn't accept the shared resource command flags, such as `--json`.

## Output

The command prints one workspace ID per line to `stdout`, in no particular order. An asterisk marks the active workspace:

```plaintext theme={"system"}
  WORKSPACE
* ws_1234abcd
  ws_5678efgh

* Active workspace
```

With no stored sessions, it prints `No saved workspaces. Run 'unkey login' to sign in.` and exits 0.

Root keys saved with `unkey login --root-key` aren't sessions and don't appear in this list.

## Examples

List stored workspaces, then switch to another one:

```bash theme={"system"}
unkey workspace list
unkey workspace switch ws_5678efgh
```

See [unkey workspace switch](https://www.unkey.com/docs/platform/cli/workspace/switch.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.