> ## 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 ユーザーとして最も頻繁に実行する実行タスク向けのコピー＆ペースト用コマンド

以下のコマンドはすべて、[サインイン](/ja/3.11.x/develop/cli/sso-users/authenticate) 済みで、対象のアプリの実行が管理者によって許可されていることを前提としています。

## メッセージの送信

[`difyctl run app`](/ja/3.11.x/develop/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/3.11.x/develop/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
```

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

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

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

## 会話の継続

各応答に続くヒントから会話 ID をコピーし、[`--conversation`](/ja/3.11.x/develop/cli/reference/apps#アプリを実行) で渡すと、同じ会話を継続できます。この機能はチャットボット、チャットフロー、Agent のアプリで利用できます。ワークフローとテキストジェネレーターのアプリは会話状態を保持しません。

```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/3.11.x/develop/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'
```
