[FEATURE]: support JSON schema as a constrain of opencode run command #6738

Open
opened 2026-02-16 18:05:06 -05:00 by yindo · 1 comment
Owner

Originally created by @richardanaya on GitHub (Jan 18, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Support for new --json on opencode run command similar to llama.cpp cli

'''
opencode run -m opencode/grok-code --json '{"type":"object","properties":{"colors":{"type":"array","items":{"type":"string"}}},"required":["colors"]}' "make 3 colors"
'''

Originally created by @richardanaya on GitHub (Jan 18, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Support for new --json <json schema> on opencode run command similar to llama.cpp cli ''' opencode run -m opencode/grok-code --json '{"type":"object","properties":{"colors":{"type":"array","items":{"type":"string"}}},"required":["colors"]}' "make 3 colors" '''
yindo added the discussion label 2026-02-16 18:05:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 18, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5639: Support for Structured Outputs in the OpenCode SDK
  • #6758: Enforcing structured output (c.f. Pydantic) and offload to temporary variables
  • #6879: JSON Schema as Source of Truth for API Contracts
  • #7202: --format json does not print reasoning_content

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 18, 2026): This issue might be a duplicate of existing issues. Please check: - #5639: Support for Structured Outputs in the OpenCode SDK - #6758: Enforcing structured output (c.f. Pydantic) and offload to temporary variables - #6879: JSON Schema as Source of Truth for API Contracts - #7202: --format json does not print reasoning_content Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6738