praisonai batch command discovers and runs all Python files containing PraisonAI imports in a directory. It’s designed for quick debugging and testing of multiple scripts at once.
Basic Usage
Key Features
- Auto-discovery: Finds all
.pyfiles withfrom praisonaiagentsorfrom praisonaiimports - Server exclusion: Automatically excludes server scripts (uvicorn, Flask, streamlit, etc.) that would hang
- Agent filtering: Filter by agent type (Agent, Agents, Workflow)
- CI integration: Machine-readable output for automated pipelines
- Parallel execution: Run multiple scripts concurrently
- Report generation: JSON, Markdown, and CSV reports
Options
Server Script Handling
By default, the batch command excludes server scripts that would hang during execution. Server scripts are detected by patterns like:uvicorn.run()- ASGI servers.launch()- PraisonAI agent APIs, Gradio interfacesapp.run()- Flask applicationsimport streamlit- Streamlit appsimport gradio- Gradio appsFastAPI(),Flask()- Web frameworks
Running Server Scripts
Use the--server flag to run only server scripts with a 10-second timeout:
Filtering by Agent Type
Filter scripts by the PraisonAI components they use:CI Integration
The--ci flag provides machine-readable output suitable for CI/CD pipelines:
- No emoji/color output (plain text)
- Proper exit codes (0 = success, 1 = failures, 2 = errors)
- Machine-parseable summary
Example CI Output
Parallel Execution
Run scripts concurrently for faster execution:Subcommands
List Scripts
List discovered scripts without running them:Show Statistics
Display statistics about discovered scripts:- Group (directory)
- Runnable status
- Agent type (Agent, Agents, Workflow)
View Reports
View the latest execution report:Script Directives
Control script behavior with comment directives:Reports
Reports are saved to~/Downloads/reports/batch/<timestamp>/ by default:
report.json- Full JSON reportreport.md- Markdown summaryreport.csv- CSV for spreadsheet analysislogs/- Individual script output logs

