Agent CLI
The PraisonAI TypeScript CLI provides commands for chatting with and running agents directly from the command line.Commands Overview
chat
Interactive chat with an agent.Basic Usage
With Model Selection
With Streaming
Options
| Option | Description | Default |
|---|---|---|
--model, -m | LLM model to use | gpt-4o-mini |
--stream, -s | Enable streaming output | false |
--session | Session ID for conversation continuity | Auto-generated |
--verbose, -v | Enable verbose output | false |
--json | Output as JSON | false |
Examples
JSON Output Format
run
Run an agent with a specific task.Basic Usage
Options
| Option | Description | Default |
|---|---|---|
--agent, -a | Agent configuration file or name | - |
--tools, -t | Comma-separated list of tools | - |
--verbose, -v | Enable verbose output | false |
--json | Output as JSON | false |
Examples
Environment Variables
Set these environment variables for API access:Database Persistence
Use the--db flag to persist memory, sessions, and knowledge across CLI invocations.
Supported Databases
| Database | URL Format |
|---|---|
| SQLite | sqlite:./data.db |
| PostgreSQL | postgres://user:pass@host:5432/db |
| Redis | redis://localhost:6379 |
Memory Persistence
Session Persistence
Knowledge Persistence
Environment Variable
Instead of passing--db on every command, set the environment variable:
Scripting Examples
Bash Script
Pipeline Usage
Error Handling
Missing API Key
Invalid Model
See Also
- Agent - Agent class documentation
- Agents CLI - Multi-agent CLI commands
- Workflow CLI - Workflow CLI commands

