CLI commands and flags

--json-schema

Enforces output validation against a specified JSON Schema once agent execution finishes in print mode.

Syntax

--json-schema

Example

Terminal
claude -p --json-schema '{"type":"object","properties":{...}}' "query"

Type to search the reference, templates and lessons.