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

# 快速开始

> 使用你的企业 SSO 身份从命令行运行第一个 Dify 应用

开始之前，请确认已 [安装](/zh/3.11.x/develop/cli/install) `difyctl`。

## 第 1 步：登录

使用管理员提供的主机 URL 运行登录命令：

```bash theme={null}
difyctl auth login --host https://dify.example.com
```

`difyctl` 会打印一个一次性验证码和一个验证 URL，在默认浏览器中打开该 URL，然后等待：

```text theme={null}
! Copy this one-time code: WDJP-XKLM
  Open: https://dify.example.com/device
```

浏览器会引导你完成公司日常的登录流程，然后要求输入这个一次性验证码。完成后，终端会确认：

```text theme={null}
✓ Logged in to dify.example.com as <your-email> (external SSO, issuer: <your-identity-provider>)
```

## 第 2 步：查看你可运行的应用

列出管理员允许你使用的应用：

```bash theme={null}
difyctl get app
```

你应该会看到类似下面的输出：

```text theme={null}
NAME          ID                                    MODE      UPDATED
Customer FAQ  0a1b2c3d-4e5f-6789-abcd-ef0123456789  chat      2026-06-08T03:14:27.521839
Daily Report  7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b  workflow  2026-06-05T22:41:09.812016
```

复制要运行的应用的 ID。

## 第 3 步：运行你的应用

传入输入的方式取决于应用类型。

<Tabs>
  <Tab title="聊天助手 / 对话流 / Agent / 文本生成应用">
    将消息作为位置参数传入：

    ```bash theme={null}
    difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?"
    ```

    回复会打印到 stdout。对于聊天助手、对话流和 Agent 应用，还会向 stderr 打印一条提示，方便你稍后继续同一段对话：

    ```text theme={null}
    Our business hours are Monday through Friday, 9am to 6pm PT.

    hint: continue this conversation with --conversation 4f7d8c2a-9b1e-4c6d-8a3f-5e2b7c9d0a1f
    ```
  </Tab>

  <Tab title="工作流">
    用 `--inputs` 将输入作为单个 JSON 对象传入：

    ```bash theme={null}
    difyctl run app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --inputs '{"topic":"quarterly report","audience":"executives"}'
    ```

    工作流的输出会以 JSON 形式打印到 stdout：

    ```json theme={null}
    {"summary":"Q3 revenue grew 14% YoY...","sections":["revenue","costs","outlook"]}
    ```
  </Tab>
</Tabs>

## 后续步骤

* **开箱即用的日常命令**：[常见任务](/zh/3.11.x/develop/cli/sso-users/common-tasks)
* **你的会话能做什么、不能做什么**：[权限范围与限制](/zh/3.11.x/develop/cli/sso-users/scope-and-limitations)
