Skip to main content
Your agent can call your Dify apps as tools. It runs 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:
  1. Discover the apps in your workspace.
  2. Inspect one to learn the inputs it expects.
  3. Run it with those inputs.
  4. Parse the JSON result.
The agent doesn’t work from a hard-coded command list. 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 runs difyctl and reuses whatever session exists on the machine where it runs, so get a session onto that machine first:

Onboard Your Agent

The agent learns difyctl 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 difyctl skill. One command writes a small file that points the agent at difyctl 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 json and use the commands it lists.” That’s the hand-off the skill otherwise does for you.
Last modified on June 25, 2026