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 difyctl help -o json, 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 difyctl help -o json. 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 points the agent atdifyctl help -o json, 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 jsonand use the commands it lists.” That’s the hand-off the skill otherwise does for you.