npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dify-cli

v1.2.0

Published

CLI tool to manage Dify workflows via DSL files

Readme

Dify CLI

npm version CI License: MIT

CLI tool to manage Dify workflows via DSL files.

Features

  • Update existing workflows with local DSL files
  • Publish workflows to make them available via API
  • Create new workflows from DSL templates
  • List available workflow files

Installation

npm (Recommended)

Add to your project:

pnpm add dify-cli dotenv-cli

Create package.json scripts:

{
  "scripts": {
    "dify": "dotenv -e .env -- dify-cli",
    "list": "dotenv -e .env -- dify-cli list",
    "update": "dotenv -e .env -- dify-cli update",
    "publish": "dotenv -e .env -- dify-cli publish",
    "new": "dotenv -e .env -- dify-cli new"
  }
}

Configure .env:

DIFY_URL="https://dify.example.com"
DIFY_USER_EMAIL="[email protected]"
DIFY_USER_PASSWORD="your-password"
WORKFLOWS_DIR="./workflows"

Run commands:

pnpm run list
pnpm run update <workflow-id>
pnpm run publish <workflow-id>
pnpm run new <name>

Global Installation

npm install -g dify-cli

Docker

# Clone the repository
git clone https://github.com/jimx7/dify-cli.git
cd dify-cli

# Configure credentials
cp .env.example .env
# Edit .env with your Dify credentials

# Build Docker image
docker compose build

# Run commands
docker compose run --rm dify-cli list
docker compose run --rm dify-cli update <workflow-id>
docker compose run --rm dify-cli publish <workflow-id>
docker compose run --rm dify-cli new <name>

Configuration

Create .env file with your Dify credentials:

DIFY_URL="https://dify.example.com"
DIFY_USER_EMAIL="[email protected]"
DIFY_USER_PASSWORD="your-password"
WORKFLOWS_DIR="./workflows"

Usage

Commands

| Command | Description | |---------|-------------| | list | List available workflow files | | update <id> | Update existing workflow with DSL file | | publish <id> | Publish workflow (make available via API) | | new <name> | Create new workflow, rename file with returned ID |

Workflows Directory

DSL files are stored in workflows/ directory:

  • Deployed workflows: <name>_<workflow-id>.yml (with ID in filename)
  • New workflows: <name>.yml (without ID, will be renamed after creation)

Example:

workflows/
├── document-assistant_00f0761f-43fc-4532-b160-407401f4e5f7.yml  # deployed
└── new-workflow.yml                                              # ready to create

Examples

# List all workflows
pnpm run list

# Update an existing workflow
pnpm run update 00f0761f-43fc-4532-b160-407401f4e5f7

# Publish a workflow
pnpm run publish 00f0761f-43fc-4532-b160-407401f4e5f7

# Create a new workflow from template
# (First create workflows/my-chatbot.yml)
pnpm run new my-chatbot

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | DIFY_URL | Dify instance URL | - | | DIFY_USER_EMAIL | Login email | - | | DIFY_USER_PASSWORD | Login password | - | | WORKFLOWS_DIR | Workflows directory path | ./workflows | | NODE_TLS_REJECT_UNAUTHORIZED | SSL verification | 0 |

DSL File Format

Dify DSL files are YAML files that define workflow structure. Example:

app:
  description: My Chatbot
  icon: "\U0001F916"
  icon_background: '#2563EB'
  mode: advanced-chat
  name: My Chatbot
kind: app
version: 0.5.0
workflow:
  graph:
    nodes:
    - data:
        type: start
        title: User Input
      id: start_node
    - data:
        type: llm
        title: LLM
        model:
          name: gpt-4
          provider: openai
        prompt_template:
        - role: system
          text: You are a helpful assistant.
      id: llm_node
    - data:
        type: answer
        answer: '{{#llm_node.text#}}'
      id: answer_node
    edges:
    - source: start_node
      target: llm_node
    - source: llm_node
      target: answer_node

License

MIT