The PraisonAI CLI automatically tracks and displays tool calls made by agents, providing visibility into what actions the AI is taking.
Overview
When you run a prompt, the CLI:
- Loads 5 built-in tools by default
- Tracks all tool calls made during execution
- Displays a summary of tools used after completion
Every CLI prompt has access to these 5 built-in tools:
| Tool | Description | Example Use |
|---|
read_file | Read file contents | โRead README.mdโ |
write_file | Write to files | โCreate a hello.py fileโ |
list_files | List directory contents | โList files hereโ |
execute_command | Run shell commands | โRun ls -laโ |
internet_search | Search the web | โSearch for Python tutorialsโ |
Usage Examples
# Agent automatically uses list_files
praisonai "List all files in current directory"
Output:
Tools used: list_files
- file1.py
- file2.py
- README.md
...
# Agent uses multiple tools to complete the task
praisonai "Read the README.md file and summarize it"
Output:
Tools used: list_files, read_file
This project is about...
Verbose Mode
For detailed tool call information, use verbose mode:
praisonai "List files" -v
Output:
โญโ Agent Info โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ ๐ค Agent: DirectAgent โ
โ Role: Assistant โ
โ Tools: read_file, write_file, list_files, execute_command, internet_search โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโ Tool Call โโโโโโโโโโโฎ
โ Calling function: list_files โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Arguments: {'directory': '.'}
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Tool Call โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Function list_files returned: [{"name": "file1.py", ...}] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Response generated in 2.5s
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Task โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ List files โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Response โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ - file1.py โ
โ - file2.py โ
โ - README.md โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
You can add additional tools using the --tools flag:
# Load tools from a Python file
praisonai "Analyze data" --tools my_tools.py
my_tools.py:
def analyze_csv(filepath: str) -> dict:
"""Analyze a CSV file and return statistics."""
import pandas as pd
df = pd.read_csv(filepath)
return {
"rows": len(df),
"columns": list(df.columns),
"summary": df.describe().to_dict()
}
Callback System
The tool tracking uses a callback system that can be extended programmatically:
from praisonaiagents import register_display_callback
def my_tool_callback(message):
"""Custom callback for tool calls."""
print(f"๐ง Tool activity: {message}")
# Register the callback
register_display_callback('tool_call', my_tool_callback)
Comparison: Default vs Verbose
| Feature | Default Mode | Verbose Mode (-v) |
|---|
| Tool summary | โ
โTools used: X, Yโ | โ
Full panels |
| Arguments | โ Hidden | โ
Shown |
| Return values | โ Hidden | โ
Shown (truncated) |
| Agent info | โ Hidden | โ
Full panel |
| Response time | โ Hidden | โ
Shown |
Best Practices
Use default mode for clean output in scripts and pipelines. Use verbose mode (-v) when debugging or learning what the agent is doing.
Tool calls are tracked via a callback system that has zero performance overhead when no callback is registered.