CLI Reference

PraisonAI TypeScript CLI – Complete command reference

The praisonai-ts CLI provides a comprehensive interface for interacting with AI agents.

Diagram

User

CLI

Agent

Quick Start

  1. Simple Usage
    bash
    npm install -g praisonai
    praisonai-ts chat "Hello"
  2. With Configuration
    bash
    export OPENAI_API_KEY=your-key
    praisonai-ts chat "Explain AI" --model openai/gpt-4o-mini


All Commands

CommandDescription
chatChat with an AI agent
runRun an agent with a task
workflowExecute a multi-agent workflow
autoAuto-generate agents from topic
researchDeep research on a topic
imageImage generation and analysis
providersList available LLM providers
toolsList or manage tools
memoryManage agent memory
sessionManage agent sessions
knowledgeManage knowledge base
skillsManage agent skills
guardrailContent validation and safety
evalEvaluate agent performance
query-rewriteRewrite queries for better search
prompt-expandExpand prompts with more detail
routerRoute requests to agents
contextManage conversation context
planningTask planning and todo management
telemetryUsage monitoring and analytics
vectorVector store management
observabilityMonitoring and tracing
voiceText-to-speech and speech-to-text
dbDatabase adapter management
cacheCaching management
versionShow CLI version
helpShow help information

Core Commands

Chat

bash
praisonai-ts chat "Your prompt here"
praisonai-ts chat "Write a poem" --stream
praisonai-ts chat "Explain AI" --model anthropic/claude-sonnet-4-20250514

Providers

bash
praisonai-ts providers
praisonai-ts providers --json

Global Options

OptionDescription
-v, --verboseEnable verbose output
-c, --configPath to config file
-o, --outputOutput format (pretty, json, text)
--jsonShorthand for --output json

Environment Variables

bash
export OPENAI_API_KEY=your-key
export ANTHROPIC_API_KEY=your-key
export GOOGLE_API_KEY=your-key
export PRAISONAI_MODEL=openai/gpt-4o-mini

Loading a .env file

praisonai-ts no longer calls dotenv.config() for you (as of v-next, PR #4416). If you keep credentials in a .env file, load it yourself at the top of your entrypoint. Shell exports above keep working with no code changes.

ts
// If you keep credentials in a .env file, load it yourself.
import 'dotenv/config';       // or: import dotenv from 'dotenv'; dotenv.config();
import { Agent } from 'praisonai';

const agent = new Agent({ instructions: 'You are a helpful assistant' });
await agent.start('Hello');

Prefer no dotenv at all? See JS Import Safety & Runtimes for per-agent credentials in browsers and webviews.

Related