Agents CLI
Command-line interface for multi-agent orchestration
The PraisonAI TypeScript CLI runs multi-agent orchestration directly from the terminal.
graph LR
User([User]) --> CLI[CLI]
CLI --> Team[AgentTeam]
Team --> Out([Results])
classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff
class Team agent
class CLI,User,Out tool
classDef agent fill:#8B0000,color:#fff
classDef tool fill:#189AB4,color:#fffQuick Start
- Simple Usage
bash praisonai-ts agents run "Research and summarise AI news" - With Configuration
bash praisonai-ts agents run "Research and write about AI" \ --agents "Research the topic,Write based on research" \ --process parallel
Commands Overview
# Run the default Researcher → Writer pair
praisonai-ts agents run "Research and write about AI"
# Run with inline agent instructions
praisonai-ts agents run "Research and write about AI" --agents "Research the topic,Write based on research"agents run
Run multiple agents in sequence or parallel.
Basic Usage
With no --agents, a Researcher and a Writer agent run the task.
praisonai-ts agents run "AI trends in 2024"With Inline Agents
praisonai-ts agents run "AI trends in 2024" \
--agents "Research the topic,Write based on research"Options
| Option | Description | Default |
|---|---|---|
<task> | Task to execute (positional, required) | – |
--agents | Comma-separated agent instructions (agents are named Agent_1, Agent_2, …) | Researcher + Writer |
--process | Process mode: sequential, parallel | sequential |
--model, -m | LLM model for all agents | Provider default |
--verbose, -v | Enable verbose output | false |
--json | Output as JSON | false |
Examples
# Sequential pipeline
praisonai-ts agents run "AI market analysis" \
--agents "Researcher:Research AI,Analyst:Analyze findings,Writer:Write report" \
--process sequential
# Parallel execution
praisonai-ts agents run "Compare markets" \
--agents "Analyst1:Analyze market A,Analyst2:Analyze market B" \
--process parallel
# JSON output
praisonai-ts agents run "Complete workflow" \
--agents "Agent1:Task 1,Agent2:Task 2" \
--jsonYAML Workflows
agents run takes agents inline only. To run agents defined in a YAML file, use the workflow command:
praisonai-ts workflow workflow.yamlJSON Output Format
{
"success": true,
"data": {
"results": [
"Research findings...",
"Written article..."
],
"process": "sequential",
"agentCount": 2
},
"meta": {
"duration_ms": 5432,
"model": "gpt-4o-mini"
}
}Process Modes
Sequential
Agents run one after another. Each agent receives the previous agent’s output:
praisonai-ts agents run "Plan a product launch" \
--agents "Step1:First task,Step2:Second task,Step3:Third task" \
--process sequentialOutput flow:
Step1 → output → Step2 → output → Step3 → final outputParallel
All agents run simultaneously:
praisonai-ts agents run "Summarise three markets" \
--agents "Worker1:Task A,Worker2:Task B,Worker3:Task C" \
--process parallelOutput flow:
Worker1 → output1
Worker2 → output2 (all run at same time)
Worker3 → output3Environment Variables
# API Keys
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
# Default model
export PRAISONAI_MODEL=gpt-4o-mini
# Behavior
export PRAISON_VERBOSE=trueScripting Examples
Bash Pipeline
#!/bin/bash
# Run agents and process results
RESULT=$(praisonai-ts agents run "Market analysis" \
--agents "Researcher:Find data,Analyst:Analyze data" \
--json)
# Extract specific agent output
RESEARCH=$(echo $RESULT | jq -r '.data.results[0]')
ANALYSIS=$(echo $RESULT | jq -r '.data.results[1]')
echo "Research: $RESEARCH"
echo "Analysis: $ANALYSIS"Error Handling
#!/bin/bash
if ! praisonai-ts agents run "Market analysis"; then
echo "Agent execution failed"
exit 1
fiCommon Patterns
Research → Write Pipeline
praisonai-ts agents run "Write about quantum computing" \
--agents "Researcher:Research thoroughly,Writer:Write engaging content"Multi-Perspective Analysis
praisonai-ts agents run "Analyze the new product launch" \
--agents "Optimist:Find positives,Pessimist:Find risks,Analyst:Balance views" \
--process sequentialParallel Data Collection
praisonai-ts agents run "Gather information about AI" \
--agents "NewsAgent:Get news,SocialAgent:Get social trends,DataAgent:Get statistics" \
--process parallel