Skip to main content
pflow provides a CLI for running workflows, managing MCP servers, and configuring settings.
Who runs these commands? Most pflow commands are run by your AI agent, not by you directly. You handle setup (installation, API keys, MCP servers), then your agent uses pflow to build and run workflows. This reference documents all commands so you understand what your agent is doing. See Using pflow for what to expect day-to-day.

Command structure

pflow [command] [options] [arguments]

Command groups

Main command

The default pflow command runs workflows. Your agent uses this to run saved workflows or workflow files it has created.

Run a saved workflow

pflow my-workflow input=data.txt threshold=0.5

Run from a file

pflow ./workflow.pflow.md
pflow ~/workflows/analysis.pflow.md param=value
pflow can generate workflows from natural language, but this feature is experimental. For production use, let your AI agent build workflows directly.
pflow "read data.txt and summarize the content"
Natural language requests must be quoted. The planner generates a workflow, which you can save for reuse. Requires an LLM to be configured.

Global options

OptionDescription
--versionShow pflow version
-v, --verboseShow detailed execution output
-o, --output-key KEYSpecific shared store key to output
--output-format text|jsonOutput format (default: text)
-p, --printForce non-interactive output
--no-traceDisable workflow trace saving
--validate-onlyValidate workflow without running
--helpShow help message
These options apply when using natural language mode to generate workflows:
OptionDescription
--trace-plannerSave planner execution trace
--auto-repairEnable automatic workflow repair on failure
--planner-timeout INTTimeout for planner in seconds (default: 60)
--save / --no-saveSave generated workflow (default: save)
--cache-plannerEnable cross-session LLM caching to reduce costs
--planner-model TEXTLLM model for planning (default: auto-detect)
--no-updateSave repairs to separate file instead of updating original
This is not the recommended way to use pflow. It may be deprecated in favor of using pflow through AI agents via the CLI or MCP server.

Parameter syntax

Pass parameters to workflows using key=value syntax:
pflow my-workflow input=data.txt count=10 enabled=true
Type inference:
  • true / false → boolean
  • 10 → integer
  • 3.14 → float
  • '["a","b"]' → JSON array
  • '{"key":"val"}' → JSON object
  • Everything else → string

Stdin input

Pipe data into workflows that declare an input with stdin: true:
echo "test content" | pflow my-workflow
cat data.csv | pflow csv-analyzer
The workflow must have an input marked to receive stdin:
## Inputs

### data

Data input from stdin pipe.

- type: string
- required: true
- stdin: true
Piped data routes to this input automatically. CLI parameters override stdin if both are provided:
# CLI parameter wins - "override" is used, not piped content
echo "piped" | pflow my-workflow data="override"
For workflow chaining, use the -p flag to output results for the next workflow:
pflow -p step1 | pflow -p step2 | pflow step3

Output modes

Text mode (default)

Human-readable output with progress indicators in interactive terminals:
pflow my-workflow

JSON mode

Structured output for parsing:
pflow --output-format json my-workflow | jq '.result'
Clean output for piping (no progress indicators):
pflow -p my-workflow > output.txt

Validation mode

Validate a workflow without running it:
pflow --validate-only workflow.pflow.md
pflow --validate-only my-saved-workflow
Agents use this to check workflows before running them — pflow catches template errors, type mismatches, and missing inputs during validation, so problems surface immediately instead of after step 5 fails. Exit code 0 means valid.

Traces

By default, pflow saves execution traces to ~/.pflow/debug/:
  • Workflow traces: workflow-trace-{name}-{timestamp}.json
Disable traces with --no-trace for faster execution.

Instructions command

The pflow instructions command provides guidance for AI agents using pflow.
pflow instructions <SUBCOMMAND>
SubcommandDescription
usageBasic usage guide for AI agents (~100 lines)
createComprehensive workflow creation guide (~1600 lines)
Example:
# Get usage instructions (AI agents should run this first)
pflow instructions usage

# Get detailed workflow creation guide
pflow instructions create
AI agents should run pflow instructions usage when first connecting to pflow. This provides optimized guidance for agent-driven workflow building.