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

# dome context

> Manage CLI contexts (org/tenant/workspace sessions)

Contexts represent authenticated sessions scoped to a specific org, tenant, and workspace.

| Command             |                                             |
| ------------------- | ------------------------------------------- |
| [List](#list)       | `dome context list`                         |
| [Current](#current) | `dome context current`                      |
| [Use](#use)         | `dome context use [name]`                   |
| [Sync](#sync)       | `dome context sync`                         |
| [Rename](#rename)   | `dome context rename <old> <new>`           |
| [Delete](#delete)   | `dome context delete <name>`                |
| [Alias](#alias)     | `dome context alias <context-name> <alias>` |

***

## List

`dome context list`

List all contexts in org/tenant/workspace hierarchy. Aliases: `ls`.

## Current

`dome context current`

Show the active context name.

```text theme={"system"}
prod/acme/backend
```

With `--format json`, the response includes the context name, level, server, and available organization, tenant, and workspace names. Use `dome gateway list` or `dome gateway get` for complete Gateway URLs.

## Use

`dome context use [name]`

Switch the active context by name, alias, or shorthand.

```bash theme={"system"}
# By exact name
dome context use "prod/acme/backend"

# By alias
dome context use backend

# By shorthand (workspace name)
dome context use backend

# By shorthand (tenant/workspace)
dome context use acme/backend

# By shorthand (org/tenant/workspace)
dome context use prod/acme/backend
```

If the shorthand is ambiguous, an error lists the matching contexts.

| Flag                  | Type | Description                    |
| --------------------- | ---- | ------------------------------ |
| `--interactive`, `-i` | bool | Interactively select a context |

## Sync

`dome context sync`

Refresh contexts from server memberships. Fetches all org/tenant memberships and creates or updates local contexts with scoped session tokens.

| Flag       | Type   | Description                                                |
| ---------- | ------ | ---------------------------------------------------------- |
| `--server` | string | Sync only this server (default: all authenticated servers) |

## Rename

`dome context rename <old> <new>`

Rename a context.

## Delete

`dome context delete <name>`

Delete a context.

## Alias

`dome context alias <context-name> <alias>`

Set or remove an alias for a context. Pass two args (context-name and alias) to set an alias. With `--remove`, pass a single arg (the alias to remove).

| Flag       | Type | Description                                              |
| ---------- | ---- | -------------------------------------------------------- |
| `--remove` | bool | Remove the alias (pass the alias as the single argument) |
