mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-07-25 13:35:29 -04:00
2f88f0f7d2
* docs: add Human Input file inputs and Service API to Cloud docs Port the Phase 2 Human Input docs (file inputs and the Service API integration flow) to the Cloud docs, mirroring the self-host pages. - human-input.mdx (en/zh/ja): add the Single File / File List field type and the file-handling notes; the upload-limit callout states Cloud's fixed limits (documents 15 MB, images 10 MB, audio 50 MB, video 100 MB, up to 10 files) instead of self-host env vars. - hitl-api-integration-flow.mdx (en/zh/ja): new; identical to self-host since the Service API is the same. - docs.json: nest the integration-flow under the Human Input group in all three navs. - zh/ja reuse the self-host translations; only the callout and the /self-host/ links changed. * docs: rewrite Cloud model providers around AI Credits * docs: rewrite Cloud subscription management for 1.15.0 * docs: update Cloud code node limits and XLSX image extraction note * docs: rewrite Cloud team members management for 1.15.0 * docs: apply the 1.15.0 Integrations redesign to Cloud docs * docs: fix workflow API reference for run-level logs and streaming * docs: sync self-host use-dify pages and fix translation debt * docs: align shared tutorials and quick start with 1.15.0 * docs: refine difyctl install examples and workspace reference * docs: rewrite hotkeys page to match current shortcuts * fix: correct broken anchor links for badged headings and tabs * fix: correct env link and Human Input resume identifier * feat: handle heading badges in link-checker slugs * fix: repoint publish-mcp cross-links to the merged MCP section * docs: rename plugin dev CLI to Dify Plugin CLI * docs: refine CLI reference readability and expand --agent * feat: stop format checkers flagging indented list-item content * fix: correct zh/ja custom-endpoint spacing and a list blank line * docs: clarify Cloud model provider install and AI Credits coverage
147 lines
5.0 KiB
Plaintext
147 lines
5.0 KiB
Plaintext
---
|
||
title: 安装 difyctl
|
||
sidebarTitle: 安装
|
||
description: 用一行脚本或手动下载二进制文件安装 difyctl
|
||
---
|
||
|
||
> 本文档由 AI 自动翻译。如有任何不准确之处,请参考 [英文原版](/en/cli/install)。
|
||
|
||
`difyctl` 是一个独立的二进制文件,无任何运行时依赖。安装脚本会检测你的平台,从 Dify 的 GitHub Releases 下载匹配的构建版本,校验其校验和,并完成安装。
|
||
|
||
<Note>
|
||
`difyctl` 需要 Dify 1.15.0 或更高版本。
|
||
</Note>
|
||
|
||
## 安装
|
||
|
||
<Steps>
|
||
<Step title="运行安装程序">
|
||
每个 Dify 发布版本都会随附一个 `difyctl` 构建版本,安装程序默认获取最新版本。
|
||
|
||
<Tabs>
|
||
<Tab title="macOS / Linux">
|
||
|
||
支持的平台:macOS 和 Linux,x64 和 arm64。
|
||
|
||
```bash
|
||
curl -fsSL https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install-cli.sh | sh
|
||
```
|
||
|
||
脚本会安装到 `~/.local/bin/difyctl`,并在该目录不在你的 `PATH` 中时提示你。
|
||
</Tab>
|
||
<Tab title="Windows">
|
||
|
||
支持的平台:x64。
|
||
|
||
```powershell
|
||
irm https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install.ps1 | iex
|
||
```
|
||
|
||
脚本会安装到 `%LOCALAPPDATA%\difyctl\bin\difyctl.exe`,如果该目录尚未加入 `PATH`,会打印将其加入 `PATH` 的命令。
|
||
|
||
</Tab>
|
||
<Tab title="手动下载">
|
||
|
||
1. 从 [Dify 的 GitHub Releases](https://github.com/langgenius/dify/releases) 中,选择与服务器 Dify 版本匹配的发布版本,并下载两个资源文件:
|
||
|
||
- 适用于你平台的二进制文件(`difyctl-v<version>-<os>-<arch>`)
|
||
- 校验和清单(`difyctl-v<version>-checksums.txt`)
|
||
|
||
2. 计算二进制文件的 SHA-256 哈希值,并与 checksums 文件中对应的条目比对。
|
||
|
||
如果两者不一致,说明下载文件已损坏或被篡改;删除它并重新下载。
|
||
|
||
<CodeGroup>
|
||
```bash macOS / Linux
|
||
shasum -a 256 difyctl-v<version>-<os>-<arch>
|
||
```
|
||
|
||
```powershell Windows
|
||
Get-FileHash difyctl-v<version>-windows-x64.exe
|
||
```
|
||
</CodeGroup>
|
||
|
||
3. 将二进制文件加入 `PATH`:
|
||
|
||
<CodeGroup>
|
||
```bash macOS / Linux
|
||
chmod +x difyctl-v<version>-<os>-<arch>
|
||
mv difyctl-v<version>-<os>-<arch> ~/.local/bin/difyctl
|
||
```
|
||
|
||
```powershell Windows
|
||
New-Item -ItemType Directory -Force "$env:LOCALAPPDATA\difyctl\bin" | Out-Null
|
||
Move-Item difyctl-v<version>-windows-x64.exe "$env:LOCALAPPDATA\difyctl\bin\difyctl.exe"
|
||
```
|
||
</CodeGroup>
|
||
</Tab>
|
||
</Tabs>
|
||
|
||
<Tip>
|
||
如需自定义安装,可在运行安装命令时设置以下环境变量。
|
||
|
||
| 变量 | 说明 | 示例 |
|
||
| --- | --- | --- |
|
||
| `DIFY_VERSION` | 用于安装 `difyctl` 的 Dify 发布标签,取自 [Dify Releases](https://github.com/langgenius/dify/releases)。<br></br><br></br>默认使用最新发布版本;当服务器不是最新版本时,将其设置为服务器的发布标签。 | `1.15.0` |
|
||
| `DIFYCTL_VERSION` | 固定使用特定的 `difyctl` 构建版本。仅在未设置 `DIFY_VERSION` 时生效。 | `0.1.0-alpha` |
|
||
| `DIFYCTL_PREFIX` | 安装目录(默认 `~/.local`)。二进制文件会放在 `<prefix>/bin` 下。 | `/usr/local` |
|
||
|
||
例如:
|
||
|
||
<CodeGroup>
|
||
```bash macOS / Linux
|
||
curl -fsSL https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install-cli.sh | DIFY_VERSION=1.15.0 sh
|
||
```
|
||
|
||
```powershell Windows
|
||
# PowerShell 没有内联写法,该设置在当前会话剩余时间内生效
|
||
$env:DIFY_VERSION = "1.15.0"
|
||
irm https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install.ps1 | iex
|
||
```
|
||
</CodeGroup>
|
||
</Tip>
|
||
</Step>
|
||
<Step title="验证安装">
|
||
```bash
|
||
difyctl version
|
||
```
|
||
|
||
你应当看到一个 `Client:` 区块,其中包含版本和平台信息。
|
||
|
||
如果你看到的是 `command not found`,说明安装目录不在你的 `PATH` 中。将它加入:
|
||
|
||
<CodeGroup>
|
||
```bash macOS / Linux
|
||
# add to ~/.zshrc or ~/.bashrc; running it inline only lasts until the session ends
|
||
export PATH="$HOME/.local/bin:$PATH"
|
||
```
|
||
|
||
```powershell Windows
|
||
[Environment]::SetEnvironmentVariable('PATH', "$env:LOCALAPPDATA\difyctl\bin;$env:PATH", 'User')
|
||
```
|
||
</CodeGroup>
|
||
</Step>
|
||
</Steps>
|
||
|
||
## 更新
|
||
|
||
要更新 `difyctl`,重新运行安装脚本即可,它会原地替换二进制文件。要切换到特定的 Dify 版本,按上文设置 `DIFY_VERSION`。
|
||
|
||
## 卸载
|
||
|
||
<CodeGroup>
|
||
```bash macOS / Linux
|
||
rm ~/.local/bin/difyctl
|
||
```
|
||
|
||
```powershell Windows
|
||
Remove-Item -Recurse "$env:LOCALAPPDATA\difyctl"
|
||
```
|
||
</CodeGroup>
|
||
|
||
要在卸载前退出登录,运行 [`difyctl auth logout`](/zh/cli/reference/auth-and-contexts#退出登录)。
|
||
|
||
## 后续步骤
|
||
|
||
装好 `difyctl` 后,前往 [快速开始](/zh/cli/quick-start) 登录并运行你的第一个应用。
|