> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/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 会将该会话流式传输到你的终端。

<div id="start-a-cloud-session">
  ## 启动云端会话
</div>

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

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

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

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

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

<div id="resume-a-cloud-session">
  ## 恢复云端会话
</div>

`--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                                          # 从最近的会话中选择
```

<div id="run-non-interactively">
  ## 以非交互方式运行
</div>

`--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             # 从文件读取
```

<div id="continue-the-work-locally">
  ## 在本地继续工作
</div>

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

`/ssh` 会在该会话的虚拟机上打开一个 shell。参见 [SSH](/zh/cli/ssh)。

<div id="cloud-slash-commands">
  ## 云端斜杠命令
</div>

除常规的[斜杠命令](/zh/cli/essential-commands#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`             | 归档此会话                                                             |

<div id="related-resources">
  ## 相关资源
</div>

<CardGroup cols={2}>
  <Card title="SSH" icon="terminal" href="/zh/cli/ssh">
    连接云端会话的 VM 并转发端口
  </Card>

  <Card title="移交给云端 Devin" icon="share-from-square" href="/zh/cli/handoff">
    使用 /handoff 在本地与云端之间移交任务
  </Card>

  <Card title="命令与开关" icon="terminal" href="/zh/cli/reference/commands">
    `--cloud` 及云端斜杠命令的完整参考
  </Card>
</CardGroup>
