Interactive TUI
PraisonAI CLI provides a rich interactive terminal user interface (TUI) for seamless AI-assisted coding sessions. Inspired by Gemini CLI, Codex CLI, and Claude Code, it offers real token streaming, built-in tools, and a clean terminal experience.Overview
The Interactive TUI provides:- Real token streaming - Model deltas rendered as they arrive, real time-to-first-token
- Built-in tools - File operations, shell commands, web search
- Slash commands -
/help,/model,/stats,/compact,/undo,/queue, and more - @file mentions - Include file content with
@file.txtsyntax - Message queuing - Queue messages while agent is processing
- Model switching - Change models on-the-fly with
/model - Token tracking - Monitor usage and costs with
/stats - Context compression - Summarize history with
/compact - Undo support - Revert last turn with
/undo - Queue management - View and manage queued messages with
/queue - Profiling - Measure response times with
/profile - Tool status indicators - See when tools are being used
- Clean UX - No cluttered panels, just streaming text
Streaming
The interactive CLI consumes real token streaming fromagent.iter_stream() — every chunk you see is a live model delta, rendered as it arrives, giving you real time-to-first-token instead of a finished string replayed word-by-word.
If a provider does not support streaming, the CLI transparently falls back to a single non-streamed
agent.chat() response — the answer still arrives, just as one block. No configuration required.openai, anthropic, gemini, most LiteLLM providers) — you will see real time-to-first-token. See Streaming for the SDK-level API and provider coverage.
Verbose Mode Order
In verbose mode theQ: / A: header prints on the first streamed delta, the body streams in live, and the completion line renders only after the streamed body finishes:
Quick Start
Chat Mode (Non-Interactive Testing)
For testing and scripting, use--chat (or praisonai chat) to run a single prompt with interactive-style output:
--chat is different from praisonai chat which starts a web-based Chainlit UI. The praisonai chat flag is an alias for backward compatibility.Built-in Tools
Interactive mode comes with 13 built-in tools across 3 groups:ACP Tools (Agentic Change Plan)
LSP Tools (Code Intelligence)
Basic Tools
Slash Commands
@File Mentions
Include file content directly in your prompts using@ syntax, inspired by Gemini CLI and Claude Code:
- Files larger than 50KB are automatically truncated
- Hidden files and common ignore patterns (node_modules, pycache) are filtered from directory listings
- Paths can be relative or absolute
- Use
~for home directory (e.g.,@~/Documents/file.txt)
Model Switching
Change models on-the-fly without restarting:Session Statistics
Track token usage and estimated costs:Context Compression
When conversations get long, use/compact to summarize older history:
/compact and Gemini CLI’s /compress. It:
- Keeps the last 2 conversation turns intact
- Summarizes older turns using the LLM
- Reduces token usage for long sessions
- Preserves key context and decisions
Undo Support
Made a mistake? Use/undo to remove the last conversation turn:
Message Queue
Queue messages while the AI agent is processing. Type new prompts and they’ll be executed in order as each task completes.Queue Commands
Message Queue
See the full Message Queue documentation for programmatic usage and API reference.
Profiling
Enable profiling to see timing breakdown:Output Comparison
Interactive Mode (Clean)
Regular Mode (Verbose)
Features
Streaming Responses
Responses stream token-by-token as real model deltas fromagent.iter_stream(), similar to Gemini CLI and Claude Code. When a provider cannot stream, the CLI falls back to a single agent.chat() call and prints the completed answer as one block. See the Streaming section above.
Tool Status Indicators
When tools are used, you’ll see status indicators:Security
High-risk tools require approval:write_file- HIGH risk levelexecute_command- CRITICAL risk level
Python API
Basic Usage
Configuration
Custom Completions
History Management
Status Display
Keyboard Shortcuts
Navigation
Editing
Multi-line
VI Mode
Enable VI keybindings:Esc- Enter command modei- Insert modea- Append modedd- Delete line/- Search
Customization
Custom Prompt
Dynamic Prompt
Custom Theme
Integration
With Slash Commands
With Cost Tracking
Fallback Mode
If prompt_toolkit is not available, a simple fallback is used:Best Practices
- Use @file mentions - Include relevant files directly in prompts for context
- Monitor with /stats - Check token usage regularly to avoid surprises
- Use /compact - Compress history when conversations get long
- Switch models - Use
/model gpt-4o-minifor simple tasks,/model gpt-4ofor complex ones - Enable profiling - Use
/profileto identify slow operations - Use completions - Press Tab often for faster input
- Learn shortcuts - Ctrl+R for history search is powerful
Feature Comparison
PraisonAI Interactive Mode compared to other AI CLI tools:Troubleshooting
Completions Not Working
History Not Persisting
Display Issues
@File Mentions Not Working
Testing Interactive Mode
PraisonAI provides a CSV-driven test runner for testing interactive mode functionality. This is useful for:- Validating tool execution (ACP/LSP tools)
- Testing multi-step workflows
- Automated regression testing
- CI/CD integration
Running Interactive Tests
CSV Test Format
Tests are defined in CSV format with the following columns:
Example CSV:
Test Artifacts
When running with--keep-artifacts, each test generates:
transcript.txt- Full conversationtool_trace.jsonl- Structured tool call traceresult.json- Test result with assertionsworkspace/- Snapshot of workspace filesjudge_result.json- LLM judge evaluation (if rubric provided)
CLI Options
GitHub Advanced Tests
Thegithub-advanced suite provides 5 end-to-end GitHub workflow scenarios that exercise real GitHub operations:
Prerequisites:
ghCLI installed and authenticatedPRAISON_LIVE_NETWORK=1environment variable
RUNBOOK.md- Step-by-step execution loggh_repo_view.json- Repository stategh_issue_list.json- Issues createdgh_pr_list.json- Pull requests createdtranscript.txt- Full conversationtool_trace.jsonl- Tool call traceverifications.json- Verification results
Related Features
- Message Queue - Queue messages while agent is processing
- Slash Commands - Full slash command reference
- Cost Tracking - Detailed cost monitoring
- Session - Session management
- Mentions - @file mention syntax
- Git Integration - Git workflow support

