> ## 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.

# よくあるタスク

> 最も頻繁に実行する difyctl タスク向けのコピー＆ペースト用コマンド

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

以下のコマンドはすべて、[サインイン](/ja/cli/authenticate) 済みであることを前提としています。

## メッセージの送信

[`difyctl run app`](/ja/cli/reference/apps#アプリを実行) に位置引数としてメッセージを渡すと、チャットボット、チャットフロー、Agent、テキストジェネレーターのアプリにメッセージを送信できます。応答は stdout に出力されます。

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

# save just the reply to a file; hints and errors go to stderr, not stdout
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "Summarize this week's tickets" > reply.txt
```

## ワークフローの実行

位置引数のメッセージではなく、[`--inputs`](/ja/cli/reference/apps#アプリを実行) で入力を 1 つの JSON オブジェクトとして渡します。出力は JSON として stdout に出力されます。

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

# read large input sets from a file instead
difyctl run app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b --inputs-file inputs.json
```

## アプリの検索

[`difyctl get app`](/ja/cli/reference/apps#アプリを一覧表示) でワークスペース内のアプリを一覧表示します。`--name` または `--mode` で絞り込めます。

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

# filter by name substring or mode
difyctl get app --name report --mode workflow

# list apps from every workspace you belong to
difyctl get app -A
```

## 長いレスポンスのストリーミング

[`--stream`](/ja/cli/reference/apps#アプリを実行) を付けると、最後にまとめて出力するのではなく、生成されるそばから応答を出力します。

```bash theme={null}
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "Draft a launch announcement" --stream
```

## 会話の継続

各チャットボットまたはチャットフローの応答に続くヒントから会話 ID をコピーし、[`--conversation`](/ja/cli/reference/apps#アプリを実行) で渡すと、同じ会話を継続できます。

```bash theme={null}
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?"
# hint: continue this conversation with --conversation 4f7d8c2a-9b1e-4c6d-8a3f-5e2b7c9d0a1f

difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "And on weekends?" --conversation 4f7d8c2a-9b1e-4c6d-8a3f-5e2b7c9d0a1f
```

## スクリプト用の JSON 出力

任意のコマンドに [`-o json`](/ja/cli/reference/output-formats-and-exit-codes) を付けると、パイプ処理しやすい生の JSON 応答を取得できます。

```bash theme={null}
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?" -o json | jq -r '.answer'

# extract fields from list output the same way
difyctl get app -o json | jq -r '.data[].id'

# get just the IDs, one per line, no jq needed
difyctl get app -o name
```

## ワークスペースの切り替え <Badge color="blue">Cloud</Badge>

[`difyctl use workspace`](/ja/cli/reference/workspaces#ワークスペースの切り替え-cloud) で現在のワークスペースを切り替えます。利用可能なワークスペースは `get workspace` で一覧表示できます。

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

difyctl use workspace 9c2f4e6a-8b1d-4f3e-a5c7-0d9e2b4f6a8c
# ✓ Switched to Marketing (9c2f4e6a-8b1d-4f3e-a5c7-0d9e2b4f6a8c)

# one-off: run a single command against another workspace without switching
difyctl get app --workspace 9c2f4e6a-8b1d-4f3e-a5c7-0d9e2b4f6a8c
```

## アプリの入力の確認

馴染みのないアプリを実行する前に、[`difyctl describe app`](/ja/cli/reference/apps#アプリを確認) でアプリの種類と入力スキーマ（各入力の名前、型、必須かどうか）を確認します。

```bash theme={null}
difyctl describe app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b

# get the schema as JSON to build --inputs programmatically
difyctl describe app 7f3e9a2b-1c4d-4e8f-9a0b-2d5c8e1f4a7b -o json
```
