Skip to main content
All commands below assume you’re signed in and that your administrator has permitted you to run the apps you’re targeting.

Send a Message

Send a message to a Chatbot, Chatflow, Agent, or Text Generator app by passing it as a positional argument to difyctl run app. The reply prints to 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

Run a Workflow

Pass the inputs as a single JSON object with --inputs instead of a positional message. The outputs print to stdout as JSON.
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 a Long Response

Add --stream to print the response as it’s generated instead of all at once at the end.
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "Draft a launch announcement" --stream

Continue a Conversation

Copy the conversation ID from the hint that follows each reply, then pass it back with --conversation to continue the same session. This applies to Chatbot, Chatflow, and Agent apps; Workflow and Text Generator apps don’t maintain conversation state.
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

Get JSON Output for Scripts

Add -o json to any command to get the raw response as pipe-friendly JSON.
difyctl run app 0a1b2c3d-4e5f-6789-abcd-ef0123456789 "What are your business hours?" -o json | jq -r '.answer'