Skip to main content
The PraisonAI CLI provides powerful commands and flags to interact with AI agents directly from your terminal.

Installation

pip install praisonai
export OPENAI_API_KEY=your_api_key

How CLI Dispatch Works

PraisonAI uses a unified CLI entry point with Typer as the primary dispatcher: When no credentials are configured, both praisonai (bare) and praisonai run check before doing any agent work. In a TTY, the user is offered the setup wizard. In CI or --output json mode, the command exits 1 with a clear error on stderr. See First-run Onboarding for the full behaviour matrix.
PraisonAI now fails loud on CLI registration errors. If you see a new ImportError after upgrading, a Typer subcommand or one of its dependencies failed to import — fix the import rather than ignoring the error.

Unknown Command Guard

A bare single-word token that looks like a mistyped or reserved command fails fast with a hint on stderr and exit code 2, instead of becoming a paid one-shot LLM prompt.

What Triggers It

The guard only fires on a single-word positional that is not a known command, a file path, or a .yaml / .yml file. Anything containing a space stays a natural-language prompt.
CommandBeforeAfter
praisonai show~10s paid LLM call, exit 0Unknown command: 'show' hint + exit 2, $0, <100ms
praisonai memoyrLLM prompt callDid you mean: memory? + exit 2
praisonai "write a poem"LLM promptLLM prompt (unchanged)
praisonai helloLLM promptLLM prompt (unchanged)

The Two Hint Shapes

A reserved verb prints its canonical replacements:
$ praisonai show
Unknown command: 'show'
There is no top-level 'show' command. Did you mean one of:
  praisonai paths           # storage paths
  praisonai version show    # version details
  praisonai memory show     # memory contents
  praisonai config show     # configuration
$ echo $?
2
A typo of a known command prints a Did you mean: suggestion via difflib (cutoff 0.8):
$ praisonai memoyr
Unknown command: 'memoyr'
Did you mean: memory?
Run 'praisonai --help' to see available commands, or use 'praisonai run "<prompt>"' to send a prompt to the model.
$ echo $?
2
The guard is case-insensitivepraisonai SHOW fires the same reserved-verb hint as praisonai show.

The Escape Hatch

For a genuine one-word prompt, use run explicitly:
praisonai run "hello"
Or add words so the token contains a space — praisonai "write a poem" still runs as a prompt.

Exit Codes & Output Stream

OutcomeExit codeStream
Guard hit (reserved verb or typo)2Hint on stderr
Normal prompt or command0Result on stdout
The hint goes to stderr so it can be redirected separately in scripts, and the check runs before any LLM client is initialised — cost is $0.

Quick Start

Direct Prompt Execution

# Basic usage - includes 5 built-in tools by default
praisonai "hello world"
Direct prompt execution

With Specific Model

# With a specific model
praisonai "list files" --llm gpt-4o-mini
With specific model

Verbose Mode

# Verbose mode - shows full agent panels and tool call details
praisonai "explain AI" -v
Verbose mode shows execution details

Basic Math Calculation

# Simple calculation
praisonai "What is 2+2?"
Basic Math Calculation

Other Examples

# Run agents from YAML - uses praisonai framework by default
praisonai agents.yaml

# Interactive mode with slash commands
praisonai chat

Default Tools

The CLI now includes 5 built-in tools by default, giving agents the ability to interact with your filesystem and the web:
ToolDescription
read_fileRead contents of files
write_fileWrite content to files
list_filesList directory contents
execute_commandRun shell commands
internet_searchSearch the web
# Example: Agent uses list_files tool automatically
praisonai "List all Python files in this directory"
# Output: Tools used: list_files
# [file listing...]

# Example: Agent uses multiple tools
praisonai "Read README.md and summarize it"
# Output: Tools used: list_files, read_file
# [summary...]

Tool Call Tracking

When tools are used, the CLI displays which tools were called:
# Non-verbose mode (default) - clean output with tool summary
praisonai "List files here"
# Output:
# Tools used: list_files
# [results...]

# Verbose mode - full panels with tool call details
praisonai "List files here" -v
# Output:
# ╭─ Agent Info ─────────────────────────────────────────────────────╮
# │  👤 Agent: DirectAgent                                           │
# │  Tools: read_file, write_file, list_files, execute_command, ...  │
# ╰──────────────────────────────────────────────────────────────────╯
# ╭───────── Tool Call ──────────╮
# │ Calling function: list_files │
# ╰──────────────────────────────╯
# [results...]

New CLI Features

Tool Tracking

Real-time tool call tracking and display

Tool Approval

Control tool execution approval with —trust and —approve-level

Slash Commands

Interactive /help, /cost, /model commands

Autonomy Modes

Control AI autonomy: suggest, auto_edit, full_auto

Cost Tracking

Real-time token usage and cost monitoring

Repository Map

Intelligent codebase mapping with tree-sitter

Interactive TUI

Rich terminal interface with completions

Message Queue

Queue messages while agent is processing

Git Integration

Auto-commit with AI messages, diff viewing

Sandbox Execution

Secure isolated command execution

All CLI Features

Deep Research

Automated multi-step research with citations

Planning

Step-by-step task execution with planning

Memory

Persistent agent memory management

Rules

Auto-discovered instructions from .praisonai files

Workflow

Multi-step YAML workflow execution

Hooks

Event-driven actions and callbacks

Claude Memory

Anthropic’s memory tool integration

Guardrail

Validate agent outputs with LLM-based guardrails

Metrics

Track token usage and cost metrics

Image Processing

Process images with vision-based AI agents

Telemetry

Enable usage monitoring and analytics

MCP

Integrate Model Context Protocol servers

Fast Context

Search codebase for relevant context

Knowledge

Manage RAG/vector store knowledge bases

Scheduler

Run agents 24/7 with timeout and cost limits

Session

Manage conversation sessions

Tools

Discover and manage available tools

Handoff

Enable agent-to-agent task delegation

Tracker

Step-by-step execution tracking with quality judging

Auto Memory

Automatic memory extraction and storage

Todo

Manage todo lists from tasks

Router

Smart model selection based on task complexity

Flow Display

Visual workflow tracking

Query Rewrite

RAG query optimization

Prompt Expansion

Expand prompts with detailed context

Prompt Caching

Cache prompts for cost reduction

Web Search

Real-time web search integration

Web Fetch

Fetch and process URL content

Docs

Manage project documentation

Mentions

Reference files and context with @mentions

AI Commit

AI-generated commit messages

Serve

Run agents as API server

n8n Integration

Import n8n workflows

Agent Skills

Manage modular skills for agents

Complete CLI Reference

Core Flags

FlagDescriptionExample
--frameworkSpecify framework (crewai, autogen, praisonai). Defaults to praisonai when neither CLI flag nor YAML framework: is set.praisonai agents.yaml --framework crewai
--uiUI mode (chainlit, gradio)praisonai --ui chainlit
--llmSpecify LLM modelpraisonai "task" --llm gpt-4o
--modelModel namepraisonai "task" --model gpt-4o
-v, --verboseVerbose output with full agent panelspraisonai "task" -v
--save, -sSave output to filepraisonai "task" --save

Interactive Mode

FlagDescriptionExample

Tool Approval & Safety

FlagDescriptionExample
--safe / --no-safeSafe mode (default ON): require approval for file writes and commandspraisonai code "..." --no-safe
--dangerously-skip-approvalSkip every approval prompt and run dangerous tools unguardedpraisonai code "..." --dangerously-skip-approval
--trustAuto-approve all tool executionspraisonai "task" --trust
--approve-levelAuto-approve up to risk level (low/medium/high/critical)praisonai "task" --approve-level high
--approval <backend>Route approvals to a backend (console, slack, …)praisonai "task" --approval slack
--autonomySet autonomy mode (suggest, auto_edit, full_auto)praisonai "task" --autonomy auto_edit
--sandboxEnable sandbox execution (off, basic, strict)praisonai "task" --sandbox basic
--guardrailValidate output against criteriapraisonai "task" --guardrail "criteria"

Planning & Memory

FlagDescriptionExample
--planningEnable planning modepraisonai "task" --planning
--planning-toolsTools for planning phasepraisonai "task" --planning --planning-tools tools.py
--planning-reasoningEnable chain-of-thought in planningpraisonai "task" --planning --planning-reasoning
--auto-approve-planAuto-approve generated planspraisonai "task" --planning --auto-approve-plan
--memoryEnable file-based memorypraisonai "task" --memory
--auto-memoryAuto extract memoriespraisonai "task" --auto-memory
--claude-memoryEnable Claude Memory Tool (Anthropic only)praisonai "task" --llm anthropic/claude-3 --claude-memory
--user-idUser ID for memory isolationpraisonai "task" --memory --user-id user123
--auto-saveAuto-save session with namepraisonai "task" --auto-save mysession
--historyLoad history from last N sessionspraisonai "task" --history 3

Tools & Extensions

FlagDescriptionExample
--tools, -tComma-separated tool names or a path to a tools.py file. Names are resolved through the unified ToolResolver.praisonai "task" --tools tavily_search,github
--mcpUse MCP serverpraisonai "task" --mcp "npx server"
--mcp-envMCP environment variablespraisonai "task" --mcp "cmd" --mcp-env "KEY=val"
--handoffAgent delegation (comma-separated)praisonai "task" --handoff "a1,a2"
--final-agentFinal agent for multi-agent taskspraisonai "task" --final-agent summarizer
--tools accepts either a comma-separated list of tool names or a tools.py file path. Names go through the same ToolResolver chain as YAML and Python, so a name unknown to every source prints Warning: Unknown tool '<name>' and is skipped. Loading a local tools.py file still requires PRAISONAI_ALLOW_LOCAL_TOOLS=true. Run praisonai tools list to see resolvable names.
FlagDescriptionExample
--web-searchEnable native web searchpraisonai "task" --web-search
--web-fetchEnable web fetch for URLspraisonai "task" --web-fetch
--researchRun deep research on topicpraisonai research "topic"
--query-rewriteRewrite query for better resultspraisonai "task" --query-rewrite
--rewrite-toolsTools for query rewriting — file path OR comma-separated tool namespraisonai "task" --query-rewrite --rewrite-tools "internet_search,duckduckgo_search"

Context & Prompts

FlagDescriptionExample
--fast-contextAdd code context from pathpraisonai "task" --fast-context ./src
--file, -fRead input from filepraisonai "task" --file input.txt
--urlRepository URL for contextpraisonai "task" --url https://github.com/repo
--goalGoal for context engineeringpraisonai --url repo --goal "understand auth"
--auto-analyzeEnable automatic analysispraisonai --url repo --auto-analyze
--expand-promptExpand short prompt to detailedpraisonai "task" --expand-prompt
--expand-toolsTools for prompt expansion — file path OR comma-separated tool namespraisonai "task" --expand-prompt --expand-tools "internet_search,duckduckgo_search"
--include-rulesInclude rules filepraisonai "task" --include-rules rules.md
--no-rulesDisable auto-loading of project instruction filespraisonai "task" --no-rules
--no-contextDisable AGENTS.md/CLAUDE.md auto-loading into system prompt for chat, run, code, and tuipraisonai chat --no-context
--max-tokensMaximum tokens for responsepraisonai "task" --max-tokens 4000

Monitoring & Display

FlagDescriptionExample
--metricsShow token usage and costspraisonai "task" --metrics
--telemetryEnable usage monitoringpraisonai "task" --telemetry
--flow-displayVisual workflow trackingpraisonai agents.yaml --flow-display
--todoGenerate todo list from taskpraisonai "plan" --todo
--routerSmart model selectionpraisonai "task" --router
--router-providerProvider for routerpraisonai "task" --router --router-provider openai
--imageProcess image filepraisonai "describe" --image photo.png
--prompt-cachingEnable prompt cachingpraisonai "task" --prompt-caching

Server & Deployment

FlagDescriptionExample
--serveStart API server for agentspraisonai agents.yaml --serve
--portServer port (default: 8005)praisonai agents.yaml --serve --port 8080
--hostServer host (default: 127.0.0.1)praisonai agents.yaml --serve --host 0.0.0.0
--deployDeploy the applicationpraisonai agents.yaml --deploy
--providerDeployment provider (gcp, aws, azure)praisonai --deploy --provider aws
--scheduleSchedule deploymentpraisonai --deploy --schedule daily
--schedule-configSchedule configurationpraisonai --deploy --schedule-config config.yaml
--max-retriesMax retries for deploymentpraisonai --deploy --max-retries 3
Note: As of PR #1713, --deploy --schedule invokes the real DeployHandler (previously a stub). Combine with --provider {gcp,aws,azure} and --max-retries N. See Scheduler Deployment for details.

Workflow & Integration

FlagDescriptionExample
--workflowRun inline workflow stepspraisonai --workflow "step1:action1;step2:action2"
--workflow-varWorkflow variablespraisonai --workflow "..." --workflow-var "key=val"
--n8nExport workflow to n8npraisonai agents.yaml --n8n
--n8n-urln8n instance URLpraisonai --n8n --n8n-url http://localhost:5678
--api-urlPraisonAI API URL for n8npraisonai --n8n --api-url http://localhost:8005

Initialization & Setup

FlagDescriptionExample
--autoEnable auto modepraisonai --auto "create agents for task"
--initInitialize agents with topicpraisonai --init "research assistant"
--mergeMerge with existing agents.yamlpraisonai --auto "task" --merge

Model Providers

FlagDescriptionExample
--hfHugging Face modelpraisonai "task" --hf model-name
--ollamaOllama modelpraisonai "task" --ollama llama2
--datasetDataset for trainingpraisonai --dataset data.json

Special Modes

FlagDescriptionExample
--realtimeStart realtime voice interfacepraisonai --realtime
--callStart PraisonAI Call serverpraisonai --call
--publicExpose server with ngrok (with —call)praisonai --call --public
--claudecodeEnable Claude Code integrationpraisonai "task" --claudecode

Slash Commands (Interactive Mode)

CommandDescription
/helpShow available commands
/exit, /quitExit interactive mode
/clearClear the screen
/toolsList available tools (5 built-in)
Both direct prompts and interactive mode include 5 built-in tools by default: read_file, write_file, list_files, execute_command, internet_search. Tool usage is automatically tracked and displayed.

Standalone Commands

CommandDescriptionExample
chatTerminal-native interactive chat REPLpraisonai chat
knowledgeManage knowledge basepraisonai knowledge add doc.pdf
sessionManage sessionspraisonai session list
toolsManage toolspraisonai tools list
todoManage todospraisonai todo list
memoryManage memorypraisonai memory show
rulesManage rulespraisonai rules list
workflowManage workflowspraisonai workflow list
hooksManage hookspraisonai hooks list
researchDeep researchpraisonai research "query"
skillsManage agent skillspraisonai skills list
trackerAutonomous agent trackingpraisonai tracker run "task"

UI Commands (Browser-Based)

CommandDescriptionExample
uiStart default web UI (Chainlit)praisonai ui
ui chatBrowser-based chat UIpraisonai ui chat
ui codeBrowser-based code assistant UIpraisonai ui code
ui realtimeBrowser-based realtime/voice UIpraisonai ui realtime
ui gradioGradio-based web UIpraisonai ui gradio
All browser-based UIs are under the ui namespace. Terminal commands (chat, code, tui) never open a browser.

Skills Commands

CommandDescriptionExample
skills listList available skillspraisonai skills list
skills validateValidate a skill directorypraisonai skills validate --path ./my-skill
skills createCreate a new skill from templatepraisonai skills create --name my-skill
skills promptGenerate prompt XML for skillspraisonai skills prompt --dirs ./skills

Global Options

# Verbose output
praisonai "task" -v

# Specify LLM model
praisonai "task" --llm openai/gpt-4o

# Save output to file
praisonai "task" --save

# Enable planning mode
praisonai "task" --planning

# Enable memory
praisonai "task" --memory

Combining Features

You can combine multiple CLI features for powerful workflows:
# Research with metrics and guardrails
praisonai "Analyze market trends" --metrics --guardrail "Include sources"

# Planning with router and flow display
praisonai "Complex analysis" --planning --router --flow-display

# Multi-agent with handoff and memory
praisonai "Research and write" --handoff "researcher,writer" --auto-memory
Use praisonai --help to see all available options and commands.

CLI Profiling

FlagDescriptionExample
--profileEnable CLI profiling (timing breakdown)praisonai chat "task" --profile
--profile-deepEnable deep profiling (cProfile stats, higher overhead)praisonai chat "task" --profile --profile-deep
Profiling is only supported for terminal-native execution commands:
  • praisonai chat "prompt" --profile
  • praisonai code "prompt" --profile
  • praisonai run agents.yaml --profile
Profiling is NOT supported for browser-based UI commands (praisonai ui ...), TUI (praisonai tui), or long-running servers.
Example Output:
praisonai chat --profile "What is 2+2?"

four

╭───────────────────────────────── Profiling ──────────────────────────────────╮
│  Import           587.0ms                                                    │
│  Agent setup        0.1ms                                                    │
│  Execution       2697.5ms                                                    │
│  ────────────  ──────────                                                    │
│  Total           3284.6ms                                                    │
╰──────────────────────────────────────────────────────────────────────────────╯