Skip to main content
The chat command starts an interactive chat session with an AI agent.

Usage

praisonai chat [OPTIONS] [PROMPT]

Arguments

ArgumentDescription
PROMPTInitial prompt for the chat session

Options

OptionShortDescriptionDefault
--model-mLLM model to useprovider-aware default
--verbose-vVerbose outputfalse
--memoryEnable memory persistencefalse
--tools-tComma-separated tool names (e.g. web_search,github) or a tools.py file path
--user-idUser ID for memory isolation
--session-sSession ID to resume
--workspace-wWorkspace directorycurrent dir
--debugEnable debug logging to ~/.praisonai/async_tui_debug.logfalse
--safe / --no-safeSafe mode: require approval for file writes and commands (default: on). Use --no-safe to disable.true
--autonomy/--no-autonomyEnable agent autonomy for complex taskstrue
--ui-backendUI backend: auto, plain, rich, mgauto
--jsonOutput JSON (forces plain backend)false
--no-colorDisable colorsfalse
--themeUI theme: default, dark, light, minimaldefault
--compactCompact output modefalse
--no-rulesDisable auto-injection of project instruction filesfalse
--no-contextDisable AGENTS.md/CLAUDE.md auto-loading into system promptfalse
praisonai chat with no --model picks a default that matches your active provider credential — it no longer always falls back to gpt-4o-mini. See Setup → What happens if you skip --model for the precedence ladder.

Piped Input

praisonai chat accepts piped stdin as an initial prompt seed.
echo "$STACKTRACE" | praisonai chat "Explain this"
Prompt argument is merged first, piped body second. The interactive REPL still opens for follow-up turns. See Piped Input.

Examples

Start a chat session

praisonai chat

Chat with initial prompt

praisonai chat "Hello, how can you help me today?"

Chat with specific model

praisonai chat --model gpt-4o "Explain machine learning"

Chat with memory enabled

praisonai chat --memory "Remember my name is Alice"

Resume a previous session

praisonai chat --session abc123

Use plain text output (no colors)

praisonai chat --ui-backend plain "What is 2+2?"

Output as JSON

praisonai chat --json "Summarize this text"

Use middle-ground UI (enhanced streaming)

praisonai chat --ui-backend mg

Chat without auto-loaded instructions

praisonai chat --no-rules "Hello, ignore project rules"
The chat session normally inherits AGENTS.md/CLAUDE.md/PRAISON.md from the working directory. --no-rules runs the assistant with only its built-in instructions.

Exit codes

praisonai chat returns a non-zero exit code on failure so shell scripts and CI can detect problems without parsing stderr.
Exit codeMeaning
0Prompt executed successfully.
1Authentication failed (invalid or missing API key), the agent raised an exception, or a profiled run finished with no response and a logged auth error.
Exit-code semantics apply to single-prompt / non-interactive invocations (praisonai chat "..." and praisonai chat --profile ...). The interactive TUI (praisonai chat with no prompt) always exits 0 when you leave the session.

Detect failures in a script

if ! praisonai chat "Summarize the changelog" >/dev/null; then
  echo "chat failed — check credentials or provider status" >&2
  exit 1
fi

CI example (GitHub Actions)

- name: Smoke-test chat
  run: praisonai chat "Say hello" > /tmp/chat.out
  env:
    OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
The step fails automatically if the key is invalid — no extra parsing needed.

Project context

By default, praisonai chat walks up from the current directory to your git root and prepends any AGENTS.md / CLAUDE.md / agents.md / .agents/AGENTS.md it finds to the agent’s system prompt, layered on top of ~/.praisonai/AGENTS.md. Pass --no-context (or set PRAISON_NO_CONTEXT=true) to disable. See Context Files for details.

UI Backends

The --ui-backend flag controls how output is rendered:
BackendDescription
autoAuto-select best available (default)
plainPlain text, no colors, works everywhere
richRich formatting with colors and panels
mgMiddle-ground: enhanced streaming with no flicker
Environment variable: Set PRAISONAI_UI_SAFE=1 to force plain backend.

Interactive Commands

During a chat session, you can use these commands:
CommandDescription
/helpShow available commands
/exit, /quitExit the chat session
/clearClear conversation history
/newStart new conversation
/sessionShow current session info
/sessionsList all saved sessions
/continueContinue most recent session
/model [name]Show or change model
/costShow token usage and cost
/historyShow conversation history
/export [file]Export conversation to file
/import <file>Import conversation from file
/statusShow ACP/LSP runtime status
/autoToggle autonomy mode (auto-delegate complex tasks)
/debugToggle debug logging to ~/.praisonai/async_tui_debug.log
/plan <task>Create a step-by-step plan for a task
/handoff <type> <task>Delegate to specialized agent (code/research/review/docs)
/compactToggle compact output mode
/multilineToggle multiline input mode
/filesList workspace files for @ mentions
/queueShow pending prompts in queue

Quick Start

Running praisonai with no arguments starts interactive mode:
praisonai
This is equivalent to praisonai chat.

Features

The interactive chat mode includes:
  • ASCII Art Logo - Beautiful PraisonAI branding on startup
  • Status Bar - Shows model, session info, and keyboard shortcuts
  • Auto-completion - Tab completion for commands and file paths
  • Command History - Navigate previous commands with arrow keys
  • Markdown Rendering - Rich formatted responses with syntax highlighting
  • Streaming Output - Real-time response streaming

See Also