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

# Devin CLI 中的 Devin Cloud

> 使用 devin --cloud、/cloud、/open、/model 和 /archive，在终端中创建、引导、恢复和查看 Devin Cloud 会话。

`devin --cloud` 会运行 Devin Cloud 会话，而不是本地 agent。Devin 在自己的虚拟机上工作，拥有 shell、浏览器和代码仓库克隆；CLI 会将该会话流式传输到你的终端。

## 启动云端会话

```bash theme={null}
devin --cloud                          # 交互式
devin --cloud -p "fix flaky CI tests"  # 单条提示，打印响应后退出
```

或者在全新的本地会话中运行 `/cloud` (需在第一条消息之前；否则请先运行 `/clear`) 。

> [!NOTE]
>
> 需要 Devin 账户。如果你尚未登录，请运行 `devin auth login` (或 `/login`) 。

在第一条消息之前，可用 `/repo`、`/platform` 和 `/model` 选择仓库、操作系统和模型，然后照常输入任务。会话在虚拟机上运行，因此关闭终端不会中断它。

要将进行中的本地会话转移到云端，请使用 [`/handoff`](https://docs.devin.ai/zh/cli/handoff)。

## 恢复云端会话

`--resume` (`-r`) 可重新打开任意云端会话，无论该会话是从 CLI、web app 还是 Desktop 启动的：

```bash theme={null}
devin --cloud -r https://app.devin.ai/sessions/…          # 通过 URL
devin --cloud -r devin-0123456789abcdef0123456789abcdef   # 通过 ID
devin --cloud -r                                          # 从最近的会话中选择
```

## 以非交互方式运行

`--cloud -p` 会启动一个会话、发送单条提示、将 Devin 的响应打印到 stdout，然后退出。该会话仍会保留；可使用 `devin --cloud -r` 恢复。

```bash theme={null}
devin --cloud -p "fix the failing test in auth.rs"    # inline 提示
devin --cloud -p -- fix the failing test in auth.rs   # 尾部参数
devin --cloud -p --prompt-file prompt.txt             # 从文件读取
```

## 在本地继续工作

`/pickup` (或 `/handoff`) 会检出该会话的 pull request 分支，并基于它启动一个本地会话。参见[移交回本地](https://docs.devin.ai/zh/cli/handoff.md#hand-off-back-to-local)。

`/ssh` 会在该会话的虚拟机上打开一个 shell。参见 [SSH](https://docs.devin.ai/zh/cli/ssh.md)。

## 使用你的本机

云端会话在自己的虚拟机上运行，但它可以请求在你的计算机上运行命令和编辑文件。最简单的授权方式是在 [Devin Desktop](https://docs.devin.ai/zh/desktop/introducing-devin-desktop.md) 中打开该会话，然后在请求卡片上点击 **Approve**。如果会话是通过 `devin --cloud` 打开的，CLI 会自动连接你的机器。如果会话是在 Web 应用中打开的，请运行卡片上提供的 `devin connect <CODE>` 命令。无论采用哪种方式，每次工具调用都需要你批准。详见 [Local Hands](https://docs.devin.ai/zh/work-with-devin/local-hands.md)。

## 云端斜杠命令

除常规的[斜杠命令](https://docs.devin.ai/zh/cli/essential-commands.md#slash-commands)外，以下命令可在云端会话中使用：

| 命令 | 说明 |
| - | - |
| `/cloud` | 将新建的本地会话切换到 Devin Cloud |
| `/repo` | 选择要克隆的仓库 |
| `/platform` | 当你的组织提供多种操作系统时，选择操作系统 |
| `/model` | 选择模型。推荐使用 [SWE-2](https://cognition.com/blog/swe-2)。 |
| `/open [web\|desktop]` | 在 web app (默认) 或 [Devin Desktop](https://devin.ai/desktop) 中打开此会话 |
| `/ssh` | 通过 SSH 连接到该会话的虚拟机 |
| `/pickup`、`/handoff` | 检出 pull request 分支，在本地继续工作 |
| `/rename <new title>` | 重命名此会话 |
| `/archive` | 归档此会话 |

## 相关资源

> [card] [SSH](https://docs.devin.ai/zh/cli/ssh.md)
>
> 连接云端会话的 VM 并转发端口

> [card] [移交给云端 Devin](https://docs.devin.ai/zh/cli/handoff.md)
>
> 使用 /handoff 在本地与云端之间移交任务

> [card] [命令与开关](https://docs.devin.ai/zh/cli/reference/commands.md)
>
> `--cloud` 及云端斜杠命令的完整参考


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