cli-anything-comfyui — Claude Code skill: ComfyUI CLI
A skill that hands your coding agent a terminal for ComfyUI, so it can queue workflows, browse models and pull finished images without a GUI in the way.
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a claude-codeWhat cli-anything-comfyui does
The skill turns ComfyUI into something your agent can drive from the shell. Queue a workflow, see what is running, interrupt it, list checkpoints and LoRAs, download the PNGs when the run finishes. Commands come in five groups: workflow, queue, models, images and system.
It is a Python package sitting on top of the ComfyUI REST API. A repl mode adds tab-completion and command history if you want to poke at things by hand. Every command accepts --json and returns structured output, which is how the skill tells agents to call it, plus a non-zero exit code and stderr text when something fails.
Before any of this works you need Python 3.10+ and a ComfyUI instance already listening on port 8188. Nothing answers until that server is up, so run system stats first instead of queueing blind. For downloads, images download takes --filename and --output, and absolute paths save you from hunting for a file in the wrong directory.
What it helps with
- queue a workflow from a JSON file
- list which checkpoints and LoRAs the server already has
- interrupt a generation that is running too long
- download every image from a single prompt
- validate a workflow against the node graph before running it
Example prompts for the agent
- Check that ComfyUI is up:
cli-anything-comfyui system stats - Queue
my_workflow.jsonand show me the queue status - Download all images from prompt
<id>into./outputs
How to install cli-anything-comfyui
1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a claude-code2Manually: put the files in place
~/.claude/skills/cli-anything-comfyui/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cli-anything-comfyui/
1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a codex2Manually: put the files in place
.agents/skills/cli-anything-comfyui/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a cursor2Manually: put the files in place
.cursor/skills/cli-anything-comfyui/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install HKUDS/CLI-Anything cli-anything-comfyui2Manually: put the files in place
.github/skills/cli-anything-comfyui/SKILL.md1Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a gemini-cli2Platform CLI
gemini skills install https://github.com/HKUDS/CLI-Anything --path skills/cli-anything-comfyuiManually: put the files in place
.devin/skills/cli-anything-comfyui/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about cli-anything-comfyui
How do I install cli-anything-comfyui in Claude Code?
Run npx skills add HKUDS/CLI-Anything --skill cli-anything-comfyui -a claude-code. The skill then sits at ~/.claude/skills/cli-anything-comfyui/SKILL.md.
What does cli-anything-comfyui do?
It drives ComfyUI from the command line over its REST API: queue prompts, list models and node types, download generated images, read server stats. Built for agents and for people who would rather not click through the GUI.
What do I need before using it?
Python 3.10+ and ComfyUI already running on port 8188. The CLI itself installs separately with pip install cli-anything-comfyui.
Source text
SKILL.md · Apache-2.0
--- name: "cli-anything-comfyui" description: >- Command-line interface for ComfyUI - AI image generation workflow management via ComfyUI REST API. Designed for AI agents and power users who need to queue workflows, manage models, download generated images, and monitor the generation queue without a GUI. --- # cli-anything-comfyui AI image generation workflow management via the ComfyUI REST API. Designed for AI agents and power users who need to queue workflows, manage models, download generated images, and monitor the generation queue without a GUI. ## Installation This CLI is installed as part of the cli-anything-comfyui package: ```bash pip install cli-anything-comfyui ``` **Prerequisites:** - Python 3.10+ - ComfyUI must be installed and running at http://localhost:8188 ## Usage ### Basic Commands ```bash # Show help cli-anything-comfyui --help # Start interactive REPL mode cli-anything-comfyui repl # Check server stats cli-anything-comfyui system stats # Run with JSON output (for agent consumption) cli-anything-comfyui --json system stats ``` ### REPL Mode Start an interactive session for exploratory use: ```bash cli-anything-comfyui repl # Enter commands interactively with tab-completion and history ``` ## Command Groups ### Workflow Workflow management commands. | Command | Description | |---------|-------------| | `list` | List saved workflows | | `load` | Load a workflow from a JSON file | | `validate` | Validate a workflow JSON against the ComfyUI node graph | ### Queue Generation queue management. | Command | Description | |---------|-------------| | `prompt` | Queue a workflow for execution | | `status` | Show current queue status (running and pending) | | `clear` | Clear the generation queue | | `history` | Show prompt execution history | | `interrupt` | Interrupt the currently running generation | ### Models Model discovery commands. | Command | Description | |---------|-------------| | `checkpoints` | List available checkpoint models | | `loras` | List available LoRA models | | `vaes` | List available VAE models | | `controlnets` | List available ControlNet models | | `node-info` | Show detailed info for a specific node type | | `list-nodes` | List all available node types | ### Images Generated image management. | Command | Description | |---------|-------------| | `list` | List generated images on the server | | `download` | Download a specific generated image | | `download-all` | Download all images from a prompt execution | ### System Server status and information. | Command | Description | |---------|-------------| | `stats` | Show ComfyUI system statistics (GPU, CPU, memory) | | `info` | Show ComfyUI server info and extensions | ## Examples ### Check System Status ```bash # Server stats cli-anything-comfyui system stats # Server info cli-anything-comfyui system info ``` ### Discover Available Models ```bash # List checkpoints cli-anything-comfyui models checkpoints # List LoRAs cli-anything-comfyui models loras # List all node types cli-anything-comfyui models list-nodes ``` ### Queue and Monitor Generation ```bash # Queue a workflow cli-anything-comfyui queue prompt --workflow my_workflow.json # Check queue status cli-anything-comfyui queue status # View execution history cli-anything-comfyui --json queue history ``` ### Download Generated Images ```bash # List generated images cli-anything-comfyui images list # Download a specific image cli-anything-comfyui images download --filename ComfyUI_00001_.png --output ./out.png # Download all images from a prompt cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs ``` ## Output Formats All commands support dual output modes: - **Human-readable** (default): Tables, colors, formatted text - **Machine-readable** (`--json` flag): Structured JSON for agent consumption ```bash # Human output cli-anything-comfyui system stats # JSON output for agents cli-anything-comfyui --json system stats ``` ## For AI Agents When using this CLI programmatically: 1. **Always use `--json` flag** for parseable output 2. **Check return codes** - 0 for success, non-zero for errors 3. **Parse stderr** for error messages on failure 4. **Use absolute paths** for all file operations 5. **Verify ComfyUI is running** with `system stats` before other commands ## More Information - Full documentation: See README.md in the package - Test coverage: See TEST.md in the package - Methodology: See HARNESS.md in the cli-anything-plugin ## Version 1.0.0
© HKUDS · Apache-2.0 · HKUDS/CLI-Anything