difyctl as an ordinary subprocess and reads the JSON it prints back. difyctl describes itself, so the agent discovers your apps, runs them, and reads the results on its own.
What the Agent Does on Its Own
The agent drives a four-step loop, with no glue code from you:- Discover the apps in your workspace.
- Inspect one to learn the inputs it expects.
- Run it with those inputs.
- Parse the JSON result.
difyctl describes itself through machine-readable help, and the agent reads that at runtime, so it always tracks the current CLI.
Before You Start: Sign In Where the Agent Runs
The agent doesn’t log in. It runsdifyctl and reuses whatever session exists on the machine where it runs, so get a session onto that machine first:
- On your own machine: a one-time browser sign-in.
- On a server or in a container: sign in on the machine, or copy a session onto it. See Authenticate Where Your Agent Runs for details.
Onboard Your Agent
The agent learnsdifyctl from its machine-readable help: a compact command map to choose from, then per-command help for arguments and flags. Pointing it there is the only setup, and how depends on the agent:
-
Reads skills (Claude Code, Codex, and similar): install the
difyctlskill. One command writes a small file that walks the agent through that discovery flow, and it onboards itself from there. No integration code. -
Doesn’t read skills: point it there yourself. Add a line to the agent’s system prompt or instructions, such as:
“To work with Dify, run
difyctl help -o json --compactto list the commands, thendifyctl help <path> -o jsonfor the one you need before running it.” That’s the hand-off the skill otherwise does for you.