CLI Reference
Complete command tree and flag reference for PraisonAI CLI
First-run Credential Check
Both praisonai (bare) and praisonai run verify credentials before executing agent work.
Detected env vars (any one satisfies the check): any credential key in PROVIDER_ENV_CATALOGUE β OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, COHERE_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, MISTRAL_API_KEY, DEEPSEEK_API_KEY, XAI_API_KEY, TOGETHER_API_KEY / TOGETHERAI_API_KEY, PERPLEXITYAI_API_KEY, FIREWORKS_API_KEY / FIREWORKS_AI_API_KEY (full 14-row table). Stored credentials from praisonai setup are also accepted. See First-run Onboarding for details.
Top-level options
Accepted on the bare praisonai invocation (no subcommand):
| Option | Short | Description |
|---|---|---|
--version | -V | Print version and exit. |
--output-format | -o | text / json / actions. |
--json | Shortcut for --output-format json. | |
--no-color | Disable ANSI colours. | |
--quiet | -q | Suppress non-essential output. |
--verbose | -v | Verbose logging. |
--screen-reader | Screen-reader-friendly output. | |
--observe | -O | Enable observability (langfuse, langextract). |
--continue | -c | Resume the most recent session into the interactive launch (PR #4912). |
--session | -s | Resume a specific session id into the interactive launch (PR #4912). |
--fork | Fork the resumed session non-destructively (requires --continue or --session) (PR #4912). |
--continue / --session / --fork on the bare invocation only apply when no subcommand is given; a subcommand’s own flags always win. See Interactive TUI β Launching with a resumed session.
Command Tree
praisonai
βββ [direct prompt] # Any text β runs agent (in-process on standalone as of PR #2853)
βββ (bare, no subcommand) # Interactive TUI; accepts -c/--continue, -s/--session <id>, --fork (PR #4912)
βββ [file.yaml] # YAML workflow execution
βββ praisonai chat # TUI mode (resident standalone; wrapper adds richer dispatch)
βββ praisonai chat # Single prompt chat mode (resident standalone; wrapper adds richer dispatch)
β
βββ chat # Chainlit chat UI (port 8084)
βββ code # Chainlit code UI (port 8086)
βββ call # PraisonAI Call server
β βββ --port --host --public
βββ realtime # Realtime voice UI (port 8088)
βββ train # Model training
βββ ui # Gradio/Chainlit UI (port 8082)
β
βββ context # Context engineering
β βββ --url, --goal, --auto-analyze
βββ research # Deep research agent
β βββ --query-rewrite, --tools (file path OR comma-separated names via full resolver), --save
β
βββ checkpoint # File-level shadow-git checkpoints
β βββ save <msg> # Snapshot the workspace
β β βββ --allow-empty, -w
β βββ list # Show recent checkpoints (newest first)
β β βββ --limit/-n, -w
β βββ restore <id|last> # Rewind workspace to a checkpoint
β β βββ -w
β βββ diff [from] [to] # Diff between checkpoints or working dir
β β βββ -w
β βββ delete # Delete all checkpoints
β βββ --yes/-y, -w
β
βββ memory # Memory management
β βββ show # Show current memory (--limit N, --user-id ID)
β βββ list # Alias for show (--limit N, --user-id ID)
β βββ add <content> # Add memory entry
β βββ search <query> # Search memories
β βββ clear # Clear all memories
β βββ save <name> # Save session
β βββ resume <name> # Resume session
β βββ sessions # List sessions
β βββ compress # Compress memory
β βββ checkpoint # Create memory checkpoint
β βββ restore <id> # Restore memory checkpoint
β βββ checkpoints # List memory checkpoints
β
βββ rules # Rules management
β βββ list # List all rules
β βββ show <name> # Show specific rule
β βββ create <name> <content> # Create rule
β βββ delete <name> # Delete rule
β βββ stats # Rule statistics
β
βββ workflow # Workflow management
β βββ list # List workflows
β βββ run <file> # Run workflow
β βββ show <file> # Show workflow details
β βββ create # Create workflow
β βββ validate <file> # Validate workflow
β βββ template <name> # Create from template
β βββ auto <topic> # Auto-generate workflow
β
βββ flow # Visual workflow builder (Langflow)
β βββ (no args) # Start the builder UI
β βββ import <file> # Import YAML β Langflow
β βββ export <flow_id> # Export Langflow β YAML/JSON
β βββ list # List flows on a server
β βββ version # Show Langflow version
β
βββ hooks # Hooks management
β βββ list # List hooks
β βββ stats # Hook statistics
β βββ init # Create hooks.json
β
βββ knowledge # Knowledge/RAG management
β βββ add <source> # Add knowledge source
β βββ query <query> # Query knowledge
β βββ list # List sources
β βββ clear # Clear knowledge
β βββ stats # Knowledge statistics
β
βββ session # Session management
β βββ start # Start new session
β βββ list # List sessions
β βββ resume <id> [PROMPT] # Resume session with full state restore
β β βββ --transcript # Show transcript only (no state restore)
β βββ delete <id> # Delete session
β βββ info <id> # Session info
β
βββ usage # Local token/cost usage reporting
β βββ --days/-d --by/-b --project/-p --json
β
βββ tools # Tool management
β βββ list # List available tools
β βββ info <name> # Tool information
β βββ search <query> # Search tools
β
βββ todo # Todo management
β βββ list # List todos
β βββ add <content> # Add todo
β βββ complete <id> # Complete todo
β βββ delete <id> # Delete todo
β βββ clear # Clear all todos
β
βββ docs # Documentation management
β βββ run # Run doc code validation
β βββ list # List docs/code blocks
β βββ stats # Show group statistics
β βββ run-all # Run all groups
β βββ report [path] # View execution report
β β βββ --limit, --wide, --match, --group, --format
β βββ cli # CLI command validation
β β βββ run-all # Validate all CLI commands
β β βββ list # List CLI commands
β β βββ stats # CLI command statistics
β β βββ report # View CLI validation report
β βββ api-md # Generate API reference (api.md)
β β βββ --write, --check, --stdout
β βββ generate # Generate documentation
β βββ serve # Serve docs locally
β
βββ examples # Examples management
β βββ run # Run examples
β βββ list # List examples
β βββ stats # Show group statistics
β βββ run-all # Run all groups
β βββ report [path] # View execution report
β βββ --limit, --wide, --match, --group, --format
β
βββ mcp # MCP server management
β βββ list # List MCP configs
β βββ show <name> # Show config
β βββ create <name> <cmd> # Create config
β βββ delete <name> # Delete config
β βββ enable <name> # Enable config
β βββ disable <name> # Disable config
β
βββ commit # AI commit message generation
β βββ --push, -a/--auto, --no-verify
β
βββ serve # API server
β βββ <agents.yaml> --port --host
β
βββ schedule # Task scheduling
β βββ start # Start scheduler
β βββ list # List jobs
β βββ stop <id> # Stop job
β βββ logs <id> # View logs
β βββ restart <id> # Restart job
β βββ delete <id> # Delete job
β βββ describe <id> # Job details
β βββ save # Save state
β βββ stop-all # Stop all jobs
β βββ stats # Scheduler stats
β
βββ skills # Agent Skills management
β βββ list # List skills
β βββ validate <path> # Validate skill
β βββ create <name> # Create skill
β βββ install <repo> # Install skill
β
βββ profile # Profiling
β βββ <prompt> # Profile agent execution
β
βββ eval # Evaluation framework
β βββ accuracy # Accuracy evaluation
β βββ performance # Performance benchmark
β βββ reliability # Tool reliability check
β βββ criteria # Custom criteria eval
β
βββ doctor # Health checks & diagnostics
β βββ env # Environment checks
β βββ config # Configuration validation
β βββ tools # Tool availability
β βββ db # Database checks
β βββ mcp # MCP configuration
β βββ obs # Observability providers
β βββ skills # Agent skills
β βββ memory # Memory storage
β βββ permissions # Filesystem permissions
β βββ network # Network connectivity
β βββ performance # Import times
β βββ ci # CI mode
β βββ selftest # Agent functionality
β
βββ agent # Custom agent definitions
β βββ create [name] # Author a new custom agent (interactive or --yes)
β βββ list [--verbose] # List discovered custom agents
β βββ show <name> # Show agent details
β
βββ auth # Credential management
β βββ login <provider> # Store provider key (interactive or --key)
β βββ list # List stored providers (redacted)
β βββ status [provider] # Validate stored credentials
β βββ logout [provider|--all] # Remove credentials
β
βββ command # Custom command templates
β βββ list [--verbose] # List discovered commands
β βββ show <name> [--preview] # Show / preview a command template
β
βββ models # LLM model catalogue
β βββ list [SEARCH] # List/filter models by provider or name
β βββ describe <model> # Full capabilities/limits/cost
β βββ validate <model> # Validate an ID; suggests alternatives on miss
β
βββ permissions # Tool approval rules
β βββ list # List rules
β βββ allow|deny|ask <pattern> # Add a rule
β βββ remove <id-prefix> # Remove a rule
β βββ reset # Delete all rules (confirm)
β βββ export # Print rules as JSON
β βββ import <file> # Import rules from JSON
β
βββ validate # YAML configuration validation
β βββ <file> # Validate one file
β βββ check [directory] # Validate all YAML in directory
β βββ schema # Print the YAML schema
β
βββ agents # Agent management
βββ run # Run agents
βββ thinking # Thinking budget config
βββ compaction # Context compaction config
βββ output # Output style config
β
βββ deploy # Deployment management
β βββ init # Initialize deployment
β βββ validate # Validate config
β βββ plan # Show deployment plan
β βββ status # Deployment status
β βββ destroy # Destroy deployment
β βββ run # Run deployment
β βββ api # API deployment
β βββ docker # Docker deployment
β βββ cloud # Cloud deployment
β
βββ templates # Template management
β
βββ backends # List registered external coding-CLI backends
β βββ list # Explicit form (same as bare `backends`)
β
βββ [Capabilities - LiteLLM parity] (27 commands) # route to legacy handlers (except β verbs)
βββ audio # Audio transcription/TTS
βββ embed # Embeddings
βββ images # Image generation
βββ moderate # Content moderation
βββ files # File management
βββ batches # Batch processing
βββ vector-stores # Vector store management β still billed to LLM pending #4322
βββ rerank # Reranking
βββ ocr # OCR
βββ assistants # Assistants API
βββ fine-tuning # Fine-tuning
βββ completions # Completions
βββ messages # Messages
βββ guardrails # Guardrails
βββ rag # RAG
βββ videos # Video processing
βββ a2a # Agent-to-Agent
βββ containers # Container management β still billed to LLM pending #4322
βββ passthrough # Passthrough requests
βββ responses # Response management
βββ search # Search
βββ realtime-api # Realtime APIDirect Prompt Examples
The [direct prompt] entry in the tree above means a bare positional that isn’t a .yaml/.yml name routes to Typer run β the same modern engine as praisonai run "<prompt>". Flags accepted by run itself (--model, --continue, --session, --output, --stream, β¦) are forwarded to run intact; only a genuinely legacy-only flag (e.g. --framework, --auto, --serve) keeps the invocation on the legacy dispatcher (and now prints a one-line stderr notice when it does):
praisonai "summarise this folder" # bare prompt β Typer run (modern engine)
praisonai show # bare token β Typer run, prompt "show"
praisonai memoyr # close typo of memory β exit 2, Did you mean: memory?
praisonai agents.yaml # flagless .yaml β Typer run (modern engine)
praisonai memory show # known subcommand β routed normally
praisonai show --framework crewai # flag β legacy; β reserved-verb hint, exit 2Global Flags (70+ flags)
| Flag | Type | Description |
|---|---|---|
--framework | choice | Framework adapter to use. Choices are discovered from the adapter registry, so built-in adapters (ag2, autogen, autogen_v4, crewai, praisonai) and any third-party adapter installed via the praisonai.framework_adapters entry-point group are all valid. See Framework Adapter Plugins. |
--ui | choice | UI: chainlit/gradio |
--auto | remainder | Auto-generate agents |
--init | remainder | Initialize agents.yaml from a task description. Prints provider-setup guidance and exits if no LLM provider is configured (see praisonai setup). |
--deploy | flag | Deploy application |
--schedule | str | Schedule pattern |
--schedule-config | str | Schedule configuration file |
--provider | str | Cloud provider |
--max-retries | int | Max retry attempts |
--llm | str | LLM model |
--model | str | Model name |
--hf | str | HuggingFace model |
--ollama | str | Ollama model |
--dataset | str | Dataset path |
--tools | str | Tools path/names |
--no-tools | flag | Disable tools |
--tool-retry-attempts | int | Tool retry max attempts (default: 3) |
--tool-retry-delay | int | Tool retry initial delay in ms (default: 1000) |
--tool-retry-backoff | float | Tool retry backoff factor (default: 2.0) |
--tool-retry-on | str | Tool retry error types (CSV, default: “timeout,rate_limit,connection_error”) |
--verbose | flag | Verbose output |
--save | flag | Save output |
--memory | flag | Enable memory |
--user-id | str | User ID for memory |
--planning | flag | Planning mode |
--planning-tools | str | Planning tools |
--planning-reasoning | flag | Planning with reasoning |
--auto-approve-plan | flag | Auto-approve plans |
--web-search | flag | Native web search |
--web-fetch | flag | Web fetch |
--prompt-caching | flag | Prompt caching |
--max-tokens | int | Max output tokens |
--final-agent | str | Final agent name |
--guardrail | str | Output validation |
--metrics | flag | Token/cost metrics |
--telemetry | flag | Usage monitoring |
--mcp | str | MCP server command |
--fast-context | str | Codebase search |
--handoff | str | Agent delegation |
--auto-memory | flag | Auto memory extraction |
--claude-memory | flag | Claude memory format |
--todo | flag | Todo generation |
--router | flag | Smart model selection |
--trust | flag | Auto-approve tools |
--approve-level | str | Risk level approval |
--sandbox | str | Sandbox mode |
--external-agent | str | External CLI tool β choices are dynamically populated from the registry (built-ins claude/gemini/codex/cursor plus any entry-point plugins), like --cli-backend. Uses manager-Agent delegation by default. See Register a custom external agent |
--external-agent-direct | flag | Use external agent as direct proxy (skip manager Agent delegation) |
--image | str | Image analysis |
--image-generate | flag | Image generation |
--file | str | Input file |
--url | str | Input URL |
--goal | str | Goal/objective |
--auto-analyze | flag | Auto-analyze context |
--query-rewrite | flag | Query rewriting |
--rewrite-tools | str | Query rewrite tools β path to tools.py, OR comma-separated names resolved via the full tool resolver (local β wrapper β SDK builtins β praisonai-tools β plugins) |
--expand-prompt | flag | Prompt expansion |
--expand-tools | str | Prompt expansion tools β path to tools.py, OR comma-separated names resolved via the full tool resolver (local β wrapper β SDK builtins β praisonai-tools β plugins) |
--public | flag | Public deployment |
--merge | flag | Merge workflows |
--claudecode | flag | Claude Code integration |
--realtime | flag | Realtime mode |
--call | flag | Call mode |
--workflow | str | Workflow file |
--workflow-var | str | Workflow variables |
--auto-save | str | Auto-save name |
--history | int | History size |
--include-rules | str | Include rules |
--no-rules | flag | Disable auto-injection of project instruction files (AGENTS.md, CLAUDE.md, etc.) |
--append-system-prompt | str | Append text (literal or @file) to the system prompt for this invocation only (code / chat / run). Env fallback: PRAISONAI_APPEND_SYSTEM_PROMPT. Never persisted. See Append System Prompt. |
--checkpoint | str | Checkpoint ID |
--thinking | str | Thinking budget |
--compaction | str | Compaction strategy |
--output-style | str | Output style |
--policy | str | Policy file |
--background | flag | Background execution |
--lite | flag | Lite mode (minimal dependencies) |
praisonai chat / -i | flag | Interactive TUI mode (resident on praisonai-code; wrapper adds richer dispatch) |
praisonai chat | flag | Single prompt chat mode (resident on praisonai-code; wrapper adds richer dispatch) |
Note on --tools: Comma-separated tool names (e.g., --tools tavily_search,my_tool) are now resolved via the unified ToolResolver, so any tool reachable from YAML is also reachable from the CLI.
SDK Module Reference
praisonaiagents (Core SDK)
| Module | Location | Features | CLI Exposure |
|---|---|---|---|
| Agent | agent/agent.py | Agent, ImageAgent, ContextAgent, DeepResearchAgent, QueryRewriterAgent, PromptExpanderAgent | Via wrapper CLI |
| Agents | agents/agents.py | Multi-agent orchestration | Via wrapper CLI |
| Task | task/task.py | Task definition | Via wrapper CLI |
| Tools | tools/ | 80+ tools (file, web, db, search, etc.) | praisonai tools |
| Memory | memory/ | FileMemory, Memory, RulesManager, AutoMemory, WorkflowManager, HooksManager, DocsManager, MCPConfigManager | praisonai memory/rules/workflow/hooks/docs/mcp |
| Knowledge | knowledge/ | RAG, chunking, vector stores, rerankers | praisonai knowledge |
| Workflows | workflows/ | Workflow, Pipeline, Route, Parallel, Loop, Repeat | praisonai workflow |
| MCP | mcp/ | MCP client, server, transports (HTTP, WebSocket, SSE) | praisonai mcp |
| DB | db/ | DbAdapter protocol, lazy backends | Via wrapper |
| Observability | obs/ | 16 providers (Langfuse, LangSmith, AgentOps, etc.) | --telemetry |
| Eval | eval/ | AccuracyEvaluator, PerformanceEvaluator, ReliabilityEvaluator, CriteriaEvaluator | praisonai eval |
| Skills | skills/ | SkillManager, SkillLoader, SkillValidator | praisonai skills |
| Planning | planning/ | Plan, PlanStep, TodoList, PlanStorage, PlanningAgent | --planning |
| Telemetry | telemetry/ | MinimalTelemetry, TelemetryCollector, PerformanceMonitor | --telemetry |
| Guardrails | guardrails/ | GuardrailResult, LLMGuardrail | --guardrail |
| Handoff | agent/handoff.py | Agent-to-agent delegation | --handoff |
| Checkpoints | checkpoints/ | Shadow git checkpointing | praisonai checkpoint |
| Thinking | thinking/ | Thinking budget management | praisonai thinking |
| Compaction | compaction/ | Context compaction | praisonai compaction |
| Background | background/ | Background task execution | Via wrapper |
| Hooks | hooks/ | Event hooks, middleware | praisonai hooks |
| UI | ui/ | AGUI, A2A | praisonai a2a |
| LLM | llm/ | LLM client, model router, rate limiter | Internal |
praisonai (Wrapper/CLI)
| Module | Location | Features | CLI Exposure |
|---|---|---|---|
| CLI Main | cli/main.py | PraisonAI class, argparse dispatcher | praisonai |
| CLI Features | cli/features/ | 50+ feature handlers | Various commands |
| Integrations | integrations/ | Built-in: Claude Code, Gemini CLI, Codex CLI, Cursor CLI β plus any registered praisonai.external_agents plugins | --external-agent |
| Adapters | adapters/ | Readers, rerankers, retrievers, vector stores | Internal |
| Capabilities | capabilities/ | 27 LiteLLM-parity endpoints | praisonai <capability> |
| Deploy | deploy/ | Docker, cloud providers | praisonai deploy |
| Auto | auto.py | AutoGenerator, WorkflowAutoGenerator | --auto, workflow auto ΒΉ |
| Train | train.py | Model training | praisonai train |
| Scheduler | scheduler/ | Job scheduling | praisonai schedule |
| Templates | templates/ | Agent templates | praisonai templates |
| UI | ui/ | Chainlit, Gradio interfaces | praisonai ui/chat/code |
ΒΉ workflow auto previously raised NameError on _models_cache in every code path; fixed in PR #2147.
Quick Reference
Common Commands
# Run agent with prompt
praisonai "Create a blog post about AI"
# Run workflow
praisonai workflow.yaml
# Interactive mode
praisonai chat
# Chat UI
praisonai chat
# Health checks
praisonai doctor
# Memory management
praisonai memory show # 10 most recent
praisonai memory list --limit 25 # alias for show
praisonai memory add "Important context"
# Tool management
praisonai tools list
praisonai tools list --source registered
# Workflow management
praisonai workflow list
praisonai workflow auto "Research AI trends"
# Visual workflow builder
praisonai flow
praisonai flow import workflow.yaml --open
praisonai flow export <flow_id> -o my_flow.yaml
# Deployment
praisonai deploy init
praisonai deploy runCommon Flag Combinations
# Agent with memory and planning
praisonai "Task" --memory --planning
# Agent with web search and tools
praisonai "Research topic" --web-search --tools
# Agent with external CLI tool (delegated via manager)
praisonai "Refactor code" --external-agent claude
# Agent with external CLI tool (direct proxy)
praisonai "Refactor code" --external-agent claude --external-agent-direct
# Agent with guardrails and metrics
praisonai "Generate content" --guardrail --metrics
# CI mode with JSON output
praisonai doctor ci --json --output report.jsonError Handling
The CLI provides clean error handling across all display modes.
Budget Exceeded Errors
When agents exceed their budget limits, the CLI catches BudgetExceededError and provides actionable guidance:
# Before: Raw Python traceback
Traceback (most recent call last):
...
BudgetExceededError: Agent 'Researcher' exceeded budget: $1.2500 >= $1.0000
# After: Clean CLI message
Budget limit exceeded: [budget] Agent 'Researcher' exceeded budget: $1.2500 >= $1.0000
- Set max_budget parameter (e.g., Agent(max_budget=1.00))Error Handling Features:
- Works across all display modes:
silent(-qq),quiet(-q), default,verbose(-v),debug(-vv),--output jsonl,--output json,--output editor - Returns exit code
1for budget exceeded errors - Includes remediation hints in error messages
- No raw Python tracebacks in production
praisonai init
praisonai init scaffolds a .praisonai/ project structure (config.yaml, starter agent, starter command). The scaffolded model is set to match whichever provider credential is detected in your environment:
| Credential detected | Scaffolded model |
|---|---|
OPENAI_API_KEY | gpt-4o-mini |
ANTHROPIC_API_KEY | anthropic/claude-3-5-sonnet-latest |
GEMINI_API_KEY | gemini/gemini-1.5-flash |
GOOGLE_API_KEY | google/gemini-1.5-flash |
GROQ_API_KEY | groq/llama-3.3-70b-versatile |
COHERE_API_KEY | cohere/command-r |
OLLAMA_HOST | ollama/llama3.2 |
| (none detected) | gpt-4o-mini (fallback) |
When no provider credential is detected, praisonai init prints:
No provider credential detected β scaffolded placeholder model 'gpt-4o-mini'.
Set one of OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY/GOOGLE_API_KEY,
GROQ_API_KEY, COHERE_API_KEY or OLLAMA_HOST, then update the model if needed.When a credential is detected, it prints:
Detected provider β scaffolded model: anthropic/claude-3-5-sonnet-latest| Flag | Description |
|---|---|
--global | Scaffold ~/.praisonai/ instead of the project root |
--force / -f | Overwrite existing files |
praisonai session resume
praisonai session resume <id> restores full conversational state β chat history, model, and agent name β for a prior session. See the dedicated Session Resume page for full details.
# List sessions to find an ID
praisonai session list
# Resume (restores model + history)
praisonai session resume <session_id>
# Resume and continue with a new prompt
praisonai session resume <session_id> "what should I do next?"
# Show transcript only (no state restore)
praisonai session resume <session_id> --transcriptpraisonai usage
praisonai usage reports aggregate token and cost totals from the local session store β no network, no configuration. See the dedicated Usage CLI page for options and JSON output.
# Last 30 days, grouped by day
praisonai usage
# Group by model or project
praisonai usage --by model
praisonai usage --by project
# Window and JSON output
praisonai usage --days 7
praisonai usage --jsonSee Also
- Usage CLI – Local token/cost usage reporting
- CLI Commands – Detailed CLI documentation
- Session Resume – Deterministic CLI session resume
- Doctor CLI – Health checks and diagnostics
- Workflows – Workflow management
- Flow CLI – Visual workflow builder (Langflow)
- Memory – Memory and sessions
- Tools – Tool reference