> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/cli/guides/connect/switch-workspaces.md).

# Switch between workspaces

List your Devolutions CLI contexts, change the current one, or use another workspace for a single command or a whole session.

When you work with more than one workspace, for example Devolutions Cloud for production and a local profile for tests, each one is a context. One context is current at a time, and every command uses it. You can change the current context, or pick another one for a single command without changing anything.

## Pick the right option

<table><thead><tr><th width="230">CHOOSE</th><th>WHAT HAPPENS</th><th>USE IT WHEN</th></tr></thead><tbody><tr><td><code>devo context use</code></td><td>Changes the current context. Every later command uses it.</td><td>You move to another workspace for a while.</td></tr><tr><td><code>--context &#x3C;context-name></code></td><td>Uses that context for this command only.</td><td>You need another workspace for one command.</td></tr><tr><td><code>DEVO_CONTEXT</code></td><td>Uses that context for every command started with this environment variable.</td><td>A terminal session, a script, or a pipeline must stick to one workspace, whatever the current context is.</td></tr></tbody></table>

## See your contexts

```bash
devo context list
```

Each line shows a context name, its type (`sqlite`, `cloud`, or `server`) and its address or profile folder. The current context is marked with `*`.

To see the details of one context, or of the current one when you don't name it:

```bash
devo context inspect <context-name>
```

## Change the current context

```bash
devo context use <context-name>
```

`devo login` also makes the new context current, unless you add `--no-set-current`.

## Use another workspace for one command

Add `--context` to any command:

```bash
devo secret run --context <context-name> --env-ref DB_PASSWORD=<reference> -- <your-command>
```

To select the same context for a whole terminal session or a script, set `DEVO_CONTEXT`:

{% tabs %}
{% tab title="PowerShell" %}

```powershell
$env:DEVO_CONTEXT = "<context-name>"
```

{% endtab %}

{% tab title="Bash" %}

```bash
export DEVO_CONTEXT=<context-name>
```

{% endtab %}
{% endtabs %}

`--context` on the command line wins over `DEVO_CONTEXT`.

{% hint style="info" %}
A canonical reference to a Devolutions Cloud or Devolutions Server entry always goes to the login that owns it, whatever context you select. The context matters for named references and for commands like `devo secret get`. See [Compare workspace types](/cli/guides/understand/workspace-types.md).
{% endhint %}

### Select a workspace by type with `--source`

`--source` selects the workspace by type: `sqlite`, `cloud`, `cloud:<context-name>`, `server`, or `server:<context-name>`. It takes priority over `--context` and over the `DEVO_RDM_SOURCE` environment variable, which accepts the same values. Most of the time, `--context` is simpler.

## Check where you are

* `devo status` shows the selected context, its type, and, for Devolutions Cloud or Devolutions Server, whether it has a sign-in. Add `--online` to contact the workspace and confirm that the sign-in still works.
* `devo info` shows information about the Devolutions Cloud or Devolutions Server instance. It also works on an address you haven't signed in to, with `--cloud <url>` or `--server <url>`. It doesn't apply to local profiles.

## Sign out or remove a context

<table><thead><tr><th width="250">COMMAND</th><th>WHAT HAPPENS</th></tr></thead><tbody><tr><td><code>devo logout [&#x3C;context-name>]</code></td><td>Clears the sign-in of a Devolutions Cloud or Devolutions Server context. The context stays, so you can sign in again with the same name. Without a name, it applies to the current context.</td></tr><tr><td><code>devo context delete &#x3C;context-name></code></td><td>Removes a local profile context. The profile folder stays untouched.</td></tr><tr><td><code>devo context delete &#x3C;context-name> --yes</code></td><td>Removes a Devolutions Cloud or Devolutions Server context and its stored session. Without <code>--yes</code>, the command refuses.</td></tr></tbody></table>

If you delete the current context, no context is current until you select one.

## Good to know

* A context name can be used by one workspace type only. If an older name exists as two types, commands ask you to delete one with `devo context delete <context-name> --kind <type>`.
* If the current context no longer exists, commands don't fail because of it: Devolutions CLI ignores it until you select another one.
* Switching between local profiles in different folders may need `devo daemon restart`. See [Use a local Devolutions Remote Desktop Manager profile](/cli/guides/connect/local-profile.md).

## Next

* [Run a command with its secrets](/cli/guides/secrets/run-with-secrets.md)
* [Global options](/cli/reference/global-options.md)
* [Environment variables](/cli/reference/environment-variables.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/cli/guides/connect/switch-workspaces.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
