ReddGrowReddGrow Docs

Output Modes

Understand how the CLI switches between human-readable and raw JSON output, and how to control it

The CLI supports two output modes that control how results are formatted. The correct mode is chosen automatically based on context, but you can always override it.

Human Mode

Human mode renders rich, colored output designed for interactive terminal use — tables, boxes, labels, and highlighted values.

Account:  you@example.com
Credits:  4,820 remaining
Plan:     Pro

This is the default when the CLI detects it is attached to an interactive terminal (TTY).

Agent Mode

Agent mode writes raw JSON to stdout and errors to stderr. There is no additional formatting or color.

{
  "email": "you@example.com",
  "credits": 4820,
  "plan": "pro"
}

This is the default when the CLI detects it is running in a non-interactive context — inside a script, a pipe, or an AI agent tool call.

Auto-Detection

The CLI checks whether stdout is a TTY at startup:

  • TTY detected → human mode
  • No TTY (pipe, script, subprocess) → agent mode

This means piping output or calling the CLI from a tool handler automatically produces clean JSON without any extra flags.

# Auto human mode (interactive terminal)
reddgrow subreddits about rust

# Auto agent mode (piped — stdout is not a TTY)
reddgrow subreddits about rust | jq '.subscribers'

Forcing a Mode

Override auto-detection with the --mode flag or the REDDGROW_MODE environment variable.

Per-command flag

reddgrow subreddits about rust --mode agent
reddgrow subreddits about rust --mode human

Environment variable

export REDDGROW_MODE=agent
reddgrow subreddits about rust   # always outputs JSON
REDDGROW_MODE=agent reddgrow posts search "typescript tips" | jq '.[] | .title'

The --mode flag takes precedence over the environment variable.

Side-by-Side Example

Command:

reddgrow auth whoami

Human mode output:

Account:  you@example.com
Credits:  4,820 remaining
Plan:     Pro

Agent mode output:

{
  "email": "you@example.com",
  "credits": 4820,
  "plan": "pro"
}

Precedence

  1. --mode flag (highest)
  2. REDDGROW_MODE environment variable
  3. TTY auto-detection (default)