Dify Chat for Openclaw

A powerful CLI tool to interface with local Dify API instances for intelligent knowledge base querying and multi-turn conversations.

yep123456
v1.0.0
Apr 17, 2026
0
805
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dify-chat

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dify-chat using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Dify Chat?

Dify Chat is a specialized integration within the Openclaw Skills library designed to bridge the gap between local AI workflows and the command-line interface. It enables users to trigger sophisticated knowledge base lookups, document queries, and Q&A sessions directly through OpenClaw.

By leveraging the Dify API, this skill supports both single-turn queries and continuous multi-turn dialogues using conversation tracking. It is an ideal solution for developers and teams needing quick, automated access to internal company documentation, technical manuals, or private datasets via a streamlined terminal experience.

Dify Chat Use Cases

  • Accessing internal company knowledge bases and reimbursement policies via CLI.
  • Automating technical documentation lookups for developers during coding sessions.
  • Integrating intelligent customer service responses into automated terminal workflows.
  • Conducting multi-turn AI research sessions while maintaining context through conversation IDs.

How Dify Chat Works

  1. The user initiates a query using the dify-chat command with specific arguments.
  2. The skill retrieves configuration details (API Key and Base URL) from the local environment.
  3. A POST request is sent to the Dify /chat-messages endpoint.
  4. Dify processes the request, querying the linked knowledge base or executing the defined workflow.
  5. The skill handles Server-Sent Events (SSE) to stream the AI response back to the terminal in real-time.
  6. A Conversation ID is returned and displayed, allowing the user to continue the session in subsequent calls.

Dify Chat Setup

To enable this entry in your Openclaw Skills collection, configure your environment file at ~/.openclaw/config/dify.env:

# Dify API Configuration
DIFY_API_KEY=your_api_key_here
DIFY_API_BASE=your_dify_api_base_url
DIFY_USER=openclaw-user

Ensure you have the Python requests library installed and network access to your Dify instance.

Dify Chat Data Schema & Taxonomy

The skill manages interaction data through environment variables and CLI parameters as outlined below:

Variable Type Required Description
DIFY_API_KEY String Yes Your Dify application secret key
DIFY_API_BASE String Yes The base URL for your Dify API instance
DIFY_USER String No Unique user identifier (defaults to openclaw-user)
conv-id String No Identifier used to maintain multi-turn chat context

Dify Chat Advanced Features

  • Streaming Responses: Real-time output display using SSE (Server-Sent Events) for a responsive chat experience.
  • Context Persistence: Use the --conv-id or -c flag to reference previous interactions and maintain conversational state.
  • Configuration Validation: Built-in --show-config flag to verify API connectivity and environment health.
  • Error Diagnostics: Detailed error reporting for common issues like rate limiting, expired session IDs, or network connectivity blocks.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*