mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-07-22 12:25:45 -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
119 lines
3.8 KiB
Plaintext
119 lines
3.8 KiB
Plaintext
---
|
||
title: 帮助
|
||
description: 在终端中获取帮助,包括各命令文档、指南主题以及机器可读的 JSON
|
||
---
|
||
|
||
> 本文档由 AI 自动翻译。如有任何不准确之处,请参考 [英文原版](/en/cli/reference/help)。
|
||
|
||
`difyctl` 的帮助系统涵盖四个层面:[顶层概览](#获取帮助)、[单个命令或命令组的帮助](#查看单个命令或命令组的帮助)、[指南主题](#指南主题),以及上述所有内容的 [机器可读形式](#机器可读帮助)。所有帮助内容均输出到 stdout,并以退出码 `0` 结束。
|
||
|
||
## 获取帮助
|
||
|
||
以下四种调用方式都会显示相同的顶层概览:
|
||
|
||
```bash
|
||
difyctl
|
||
difyctl help
|
||
difyctl --help
|
||
difyctl -h
|
||
```
|
||
|
||
该概览列出每个命令及其简介、三个入门示例、[全局标志](/zh/cli/reference/global-flags),以及 [指南主题](#指南主题)。若想查看同样的清单并附带指向本参考文档的链接,参见 [命令索引](/zh/cli/reference/command-index)。
|
||
|
||
## 查看单个命令或命令组的帮助
|
||
|
||
在任意命令后追加 `--help`,或在命令前加上 `help`:
|
||
|
||
```bash
|
||
difyctl run app --help
|
||
difyctl help run app
|
||
```
|
||
|
||
单个命令的帮助会显示该命令的描述、用法行、参数、带默认值的标志以及示例。
|
||
|
||
指定命令组而非具体命令,可列出该组的子命令:
|
||
|
||
```bash
|
||
difyctl auth --help
|
||
```
|
||
|
||
```text
|
||
COMMANDS
|
||
auth devices list List active sessions for the current bearer
|
||
auth devices revoke Revoke one or all session devices
|
||
auth list List all authenticated contexts (host + account pairs)
|
||
auth login Sign in to Dify via OAuth device flow
|
||
auth logout Log out of the active Dify host
|
||
auth whoami Print the active subject's identity
|
||
```
|
||
|
||
若某个名称既不匹配命令、主题,也不匹配命令组,则会以 `unknown help topic: <name>` 报错,给出建议并返回退出码 `1`。
|
||
|
||
## 指南主题
|
||
|
||
长篇主题随 CLI 一同分发,通过 `difyctl help <topic>` 阅读:
|
||
|
||
| 主题 | 涵盖内容 |
|
||
|:---|:---|
|
||
| `account` | 上手引导。 |
|
||
| `environment` | CLI 自身对 `DIFY_*` 环境变量的说明。 |
|
||
| `agent` | 用于驱动 `difyctl` 的 Agent 所遵循的跨命令约定。 |
|
||
|
||
这些主题已内置于 CLI 中。要了解 `difyctl` 实际读取哪些变量,参见 [环境变量](/zh/cli/reference/environment-variables)。
|
||
|
||
## 机器可读帮助
|
||
|
||
每个帮助层面都接受 `-o json` 和 `-o yaml`。顶层形式会在一份文档中输出完整的命令全貌:
|
||
|
||
```bash
|
||
difyctl help -o json
|
||
```
|
||
|
||
该文档包含四个顶层键:
|
||
|
||
- `bin`、`contract`:退出码、输出格式、错误输出的结构以及跨命令规则
|
||
- `commands`:每个命令一个描述符
|
||
- `topics`:按名称列出的可用指南主题,每个主题的正文通过 `difyctl help <topic>` 读取
|
||
|
||
JSON 形式的单个命令帮助仅返回该命令的描述符:
|
||
|
||
```bash
|
||
difyctl auth whoami --help -o json
|
||
```
|
||
|
||
```json
|
||
{
|
||
"command": "auth whoami",
|
||
"description": "Print the active subject's identity",
|
||
"effect": "read",
|
||
"args": [],
|
||
"flags": [
|
||
{
|
||
"name": "json",
|
||
"char": null,
|
||
"type": "boolean",
|
||
"default": false,
|
||
"multiple": false,
|
||
"options": null,
|
||
"description": "emit JSON"
|
||
}
|
||
],
|
||
"examples": [
|
||
"difyctl auth whoami",
|
||
"difyctl auth whoami --json"
|
||
],
|
||
"agentGuide": null
|
||
}
|
||
```
|
||
|
||
每个描述符都带有该命令的参数和标志(含类型与默认值)、一个 `effect` 标签(`read`、`write` 或 `destructive`),以及在有的情况下提供的 `agentGuide` 字符串。编码 Agent 正是通过这种方式发现 `difyctl`。
|
||
|
||
## 退出码
|
||
|
||
| 退出码 | 含义 |
|
||
|:---|:---|
|
||
| `0` | 已打印帮助 |
|
||
| `1` | 未知的帮助主题或命令名称 |
|
||
|
||
完整方案参见 [输出格式与退出码](/zh/cli/reference/output-formats-and-exit-codes)。
|