このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、英語版 を参照してください。
以下のコマンドはすべて、サインイン 済みであることを前提としています。
メッセージの送信
difyctl run app に位置引数としてメッセージを渡すと、チャットボット、チャットフロー、Agent、テキストジェネレーターのアプリにメッセージを送信できます。応答は stdout に出力されます。
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 で入力を 1 つの JSON オブジェクトとして渡します。出力は JSON として stdout に出力されます。
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 でワークスペース内のアプリを一覧表示します。--name または --mode で絞り込めます。
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 を付けると、最後にまとめて出力するのではなく、生成されるそばから応答を出力します。
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "Draft a launch announcement" --stream
会話の継続
各チャットボットまたはチャットフローの応答に続くヒントから会話 ID をコピーし、--conversation で渡すと、同じ会話を継続できます。
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 を付けると、パイプ処理しやすい生の JSON 応答を取得できます。
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
ワークスペースの切り替え Cloud
difyctl use workspace で現在のワークスペースを切り替えます。利用可能なワークスペースは get workspace で一覧表示できます。
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 でアプリの種類と入力スキーマ(各入力の名前、型、必須かどうか)を確認します。
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
Last modified on July 2, 2026