> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Streaming CLI

> Command-line streaming options for agents

Control streaming behaviour when running agents from the command line.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Stream([Streaming])

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Stream agent
    class CLI,User tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

Control streaming behavior when running agents from the command line.

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-ts chat "Tell me a story" --stream
    ```
  </Step>

  <Step title="With Configuration">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai-ts chat "Tell me a story" --no-stream
    ```
  </Step>
</Steps>

***

## Overview

By default, agent responses stream to the terminal in real-time. You can control this behavior with CLI flags.

## Commands

### Enable Streaming (Default)

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts chat "Tell me a story" --stream
```

### Disable Streaming

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts chat "Tell me a story" --no-stream
```

## Options

| Option            | Description                                   | Default |
| ----------------- | --------------------------------------------- | ------- |
| `--stream`        | Enable streaming output                       | `true`  |
| `--no-stream`     | Disable streaming, wait for complete response | `false` |
| `--verbose`, `-v` | Show streaming output in terminal             | `true`  |
| `--quiet`, `-q`   | Suppress streaming output                     | `false` |

## Examples

### Interactive Streaming

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Stream response as it's generated
praisonai-ts chat "Explain quantum computing in detail" --stream
```

### Batch Processing

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Get complete response (better for scripting)
praisonai-ts chat "Summarize this text" --no-stream --json
```

### Silent Mode

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# No streaming output, just final result
praisonai-ts chat "Hello" --quiet
```

### Verbose Streaming

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Full streaming with debug info
praisonai-ts chat "Hello" --stream --verbose
```

## Scripting Examples

### Capture Streamed Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
#!/bin/bash

# Stream to file
praisonai-ts chat "Write a long story" --stream > story.txt

# Stream and display
praisonai-ts chat "Explain AI" --stream | tee output.txt
```

### JSON Output (No Streaming)

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# For API-like usage, disable streaming
RESULT=$(praisonai-ts chat "Hello" --no-stream --json)
echo $RESULT | jq '.data.response'
```

### Pipeline Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Pipe between commands (streaming disabled automatically)
echo "Summarize this" | praisonai-ts chat --stdin --no-stream
```

## Environment Variables

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Default streaming behavior
export PRAISON_STREAM=true

# Default verbose behavior
export PRAISON_VERBOSE=true
```

## Use Cases

### Interactive Chat

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Best experience for interactive use
praisonai-ts chat "Let's have a conversation" --stream --verbose
```

### Automation Scripts

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Best for scripts and automation
praisonai-ts chat "Process this data" --no-stream --json
```

### Long-Form Generation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Stream long content to see progress
praisonai-ts run \
  --instructions "You are a writer" \
  --task "Write a 2000-word essay" \
  --stream
```

## See Also

* [Streaming](/docs/js/streaming) - Streaming in code
* [Agent CLI](/docs/js/agent-cli) - Agent CLI commands
* [Agents CLI](/docs/js/agents-cli) - Multi-agent CLI

## Related

<CardGroup cols={2}>
  <Card title="Streaming" icon="wave-square" href="/docs/js/streaming">Streaming SDK</Card>
  <Card title="Agent CLI" icon="terminal" href="/docs/js/agent-cli">Agent commands</Card>
</CardGroup>
