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 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 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 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 difyctl skill. 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 --compact to list the commands, then difyctl help <path> -o json for the one you need before running it.” That’s the hand-off the skill otherwise does for you.
Last modified on September 10, 2026