Skip to content

Add --quiet / -q flag to suppress doctor warnings in CLI output #9777

@jontsai

Description

@jontsai

Problem

When running openclaw sessions list --json, the output includes doctor warnings before the JSON:

│
◇  Doctor warnings ─────────────────────────────────────────╮
│                                                           │
│  - State dir migration skipped: target already exists     │
│    (/Users/jontsai/.openclaw). Remove or merge manually.  │
│                                                           │
├───────────────────────────────────────────────────────────╯
{
  "path": "/Users/jontsai/.openclaw/agents/main/sessions/sessions.json",
  ...
}

This breaks programmatic parsing with jq or any JSON parser since the output doesn't start with {.

Proposed Solution

Add a global --quiet / -q flag that suppresses all non-essential output (doctor warnings, decorative boxes, etc.) when machine-readable output is needed.

Alternatively/additionally:

  • --no-doctor or --skip-doctor to specifically suppress doctor warnings
  • Automatically suppress warnings when --json is used (warnings should go to stderr, JSON to stdout)

Use Case

Building a dashboard that queries openclaw sessions list --json to display active session counts. Currently requires stripping non-JSON prefix before parsing.

Workaround

Strip everything before the first { in the output, but this is fragile.

Environment

  • OpenClaw version: 2026.2.2-2
  • Platform: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions