> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-docs-new-agent-experience.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ヘルプ

> コマンドごとのドキュメント、ガイドトピック、機械可読な JSON をターミナルで取得

> このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/cli/reference/help) を参照してください。

`difyctl` のヘルプシステムは 4 つの領域をカバーします。[トップレベルの概要](#ヘルプの表示)、[コマンドまたはグループごとのヘルプ](#コマンドまたはグループごとのヘルプ)、[ガイドトピック](#ガイドトピック)、そしてそれらすべての [機械可読な形式](#機械可読ヘルプ) です。ヘルプはすべて stdout に出力され、終了コード `0` で終了します。

## ヘルプの表示

次の 4 つの呼び出し方法は、いずれも同じトップレベルの概要を表示します。

```bash theme={null}
difyctl
difyctl help
difyctl --help
difyctl -h
```

概要には、各コマンドとその概要、3 つの入門例、[グローバルフラグ](/ja/cli/reference/global-flags)、[ガイドトピック](#ガイドトピック) が一覧表示されます。この一覧に本リファレンスへのリンクを添えたものは、[コマンドインデックス](/ja/cli/reference/command-index) を参照してください。

## コマンドまたはグループごとのヘルプ

任意のコマンドに `--help` を付けるか、コマンドの前に `help` を置きます。

```bash theme={null}
difyctl run app --help
difyctl help run app
```

コマンドごとのヘルプには、そのコマンドの説明、使用法の行、引数、デフォルト値付きのフラグ、例が表示されます。

コマンドではなくコマンドグループを指定すると、そのグループのサブコマンドが一覧表示されます。

```bash theme={null}
difyctl auth --help
```

```text theme={null}
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` | `DIFY_*` 環境変数に関する CLI 自身の説明。        |
| `agent`       | `difyctl` を駆動する Agent 向けのコマンド横断の規約。 |

これらのトピックは CLI に組み込まれています。`difyctl` が実際に読み取る変数については、[環境変数](/ja/cli/reference/environment-variables) を参照してください。

## 機械可読ヘルプ

すべてのヘルプ領域が `-o json` と `-o yaml` を受け付けます。トップレベルの形式は、コマンドの全体像を 1 つのドキュメントとして出力します。

```bash theme={null}
difyctl help -o json
```

このドキュメントには 4 つのトップレベルキーがあります。

* `bin`、`contract`：終了コード、出力形式、エラー出力の構造、コマンド横断のルール
* `commands`：コマンドごとに 1 つのディスクリプタ
* `topics`：利用可能なガイドトピックを名前ごとに示し、各トピックの本文は `difyctl help <topic>` で読み取る

JSON 形式のコマンドごとのヘルプは、そのコマンドのディスクリプタのみを返します。

```bash theme={null}
difyctl auth whoami --help -o json
```

```json theme={null}
{
  "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` | 不明なヘルプトピックまたはコマンド名 |

完全な体系については、[出力形式と終了コード](/ja/cli/reference/output-formats-and-exit-codes) を参照してください。
