Prompt Expander CLI

CLI commands for prompt expansion in PraisonAI TypeScript

The praisonai-ts CLI provides the prompt-expand command for enhancing prompts with more detail.

Diagram

User

CLI

Expander

Quick Start

  1. Simple Usage
    bash
    praisonai-ts prompt-expand "write a story"
  2. With Configuration
    bash
    praisonai-ts prompt-expand "Write code" --strategy detail --json

Basic Usage

bash
# Expand a prompt (default strategy: auto)
praisonai-ts prompt-expand "write a story"

# Get JSON output
praisonai-ts prompt-expand "create an app" --json

Example Output:

json
{
  "success": true,
  "data": {
    "originalPrompt": "write a story",
    "expandedPrompt": "Write a compelling narrative with...",
    "strategy": "detail",
    "additions": ["genre", "length", "characters", "plot"]
  }
}

Expansion Strategies

bash
# Detail strategy - add specific details
praisonai-ts prompt-expand "Write code" --strategy detail

# Context strategy - add background context
praisonai-ts prompt-expand "Explain this" --strategy context

# Examples strategy - add example outputs
praisonai-ts prompt-expand "Show me" --strategy examples

# Constraints strategy - add requirements
praisonai-ts prompt-expand "Build a website" --strategy constraints

# Auto strategy (default) - automatically detect best approach
praisonai-ts prompt-expand "Create function" --strategy auto

Available Strategies

StrategyDescription
detailAdd specific details and requirements
contextAdd background context and information
examplesAdd example outputs or formats
constraintsAdd constraints and requirements
autoAutomatically detect the best strategy

SDK Usage

For programmatic usage, see the Prompt Expander SDK documentation.

Related