Skip to main content
Generate type-safe structured JSON output using the PraisonAI CLI.

Quick Start

1

Simple Usage

2

With Configuration


Commands

Generate Structured Output

Schema File Format

Create a JSON schema file:

Options

Examples

Data Extraction

Output:

Classification

Output:

Sentiment Analysis

Where sentiment.json:

Complex Nested Output

Where order.json:
Output:

Using Different Providers

Piping and Scripting

Pipe Input

Use in Scripts

JSON Lines Output

Error Handling

Environment Variables

Exit Codes

Best Practices

  1. Use schema files for complex schemas
  2. Set low temperature (0.1) for consistent output
  3. Validate output with jq or similar tools
  4. Handle errors in scripts
  5. Use --json flag for machine-readable output

Structured Output

Structured output SDK

Agent CLI

Agent commands