CLI Reference

Complete command-line interface reference for PraisonAI

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

Installation

bash
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:

Diagram

Yes

No

No, TTY

No, non-TTY

Yes

User accepts

User declines

No — bare prompt / run-supported flags

Yes — YAML / legacy-only flags

🚀 praisonai command

–version?

📄 Print version & exit

Credentials
configured?

🧙 Offer setup wizard

❌ stderr + exit 1

Legacy-only flag
or .yaml/.yml?

⚙️ praisonai setup

💡 Exit 0 with hint

⚡ Typer run
modern engine

🔄 Legacy shim

A bare prompt routes to Typer run — the same modern engine as praisonai run "…". Flags accepted by run itself (--model, --continue, --session, --output, --stream, --verbose, …) are forwarded to the modern engine too. Only YAML files and legacy-only flags (--framework, --auto, --serve, …) reach the legacy shim; when a legacy-only flag forces that fallback, a one-line stderr notice points at the modern equivalent.

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.

Bare interactive launch (no subcommand)

Running praisonai with no prompt and no subcommand launches the interactive TUI. As of PR #4912 it accepts three continuity flags — parity with run and chat:

FlagShortWhat it does
--continue-cResume the most recent session for this project into the TUI.
--session <id>-s <id>Resume a specific session id into the TUI.
--forkFork the resumed session non-destructively (requires --continue or --session).
bash
# Fresh interactive session (unchanged)
praisonai

# Resume the most recent project session into the TUI
praisonai -c

# Resume a specific session id
praisonai --session abc12345

# Branch a resumed session into a new timeline
praisonai --fork --session abc12345

The resume path reuses run / chat‘s existing machinery — the recorded session model is restored, the prior transcript is replayed into scrollback, and the primary agent is wired to the resumed session’s store so a follow-up prompt has real conversational memory of prior turns (not just display-only history).

--fork alone (without --continue / --session) and --continue + --session together both exit 1 with an actionable error — parity with praisonai run. See Interactive TUI → Launching with a resumed session for the full flow.

Unknown Command Guard (legacy path)

The guard fires on the legacy dispatcher only; a plain praisonai show now reaches Typer run and is sent to the model as the literal prompt show. It only kicks in once an invocation is already on the legacy path — because it carries a flag or points at a .yaml/.yml file — and a lone token there looks like a mistyped or reserved command.

Diagram

Unknown Command Guard (legacy path)

Reserved verb

Fuzzy match

Unrelated word

💻 legacy invocation
flag or .yaml

🔍 Classify

💡 Hint + exit 2

🧠 Did you mean?

✅ LLM prompt

What Triggers It

The guard runs only when the invocation already reached legacy (a flag or a .yaml/.yml file) and the lone token looks like a mistyped or reserved command. A bare praisonai show skips legacy entirely and routes to Typer run.

CommandRouteResult
praisonai show (bare)Typer runprompt show sent to the model
praisonai show --framework crewaiLegacyUnknown command: 'show' hint + exit 2
praisonai memoyr --framework crewaiLegacyDid you mean: memory? + exit 2
praisonai "write a poem" (bare)Typer runprompt sent to the model

The Two Hint Shapes

On the legacy path, a reserved verb prints its canonical replacements:

bash
$ praisonai show --framework crewai
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):

bash
$ praisonai memoyr --framework crewai
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

Exit Codes & Output Stream

OutcomeExit codeStream
Guard hit on legacy (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

bash
# Basic usage - includes 5 built-in tools by default
praisonai "hello world"

A bare prompt is identical to praisonai run "hello world" — same modern engine, same features (session continuity, --output modes, credential gate, permissions/checkpoints).

Direct prompt execution

With Specific Model

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

Verbose Mode

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

Basic Math Calculation

bash
# Simple calculation
praisonai "What is 2+2?"

!Basic Math Calculation

Other Examples

bash
# 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
bash
# 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:

bash
# 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

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
--sandboxDisplay-only (off, basic, strict) — not enforced; use PRAISON_SHELL=sandboxed praisonai code for containmentpraisonai "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

Web & Search

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)

Standalone Commands

CommandDescriptionExample
chatTerminal-native interactive chat REPLpraisonai chat
knowledgeManage knowledge basepraisonai knowledge add doc.pdf
sessionManage sessionspraisonai session list
usageLocal token/cost spend reportingpraisonai usage --by model
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

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

bash
# 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:

bash
# 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

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

Example Output:

praisonai chat --profile "What is 2+2?"

four

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