Add structured (JSON) output for tool/agent integration
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
The issue names no implementation files, tests, or entry points; begin by locating the claw CLI output path and existing argument parsing. Done means a documented --json or --format json mode emits a machine-readable final result with status and available usage or cost data, optionally following the referenced NDJSON convention.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What
A machine-readable output mode for claw -- a --json (or --format json) flag that emits a structured final result instead of (or alongside) raw stdout.
Ideally:
- a single final JSON envelope with at least: the result/assistant text, an exit/outcome status, and token usage + cost when available; and/or
- a newline-delimited JSON (NDJSON) event stream for progress, terminated by the final result object (the shape codex
exec --jsonand opencoderun --format jsonalready use).
Why
Tools that drive a coding agent as a non-interactive subprocess need machine-parseable output to integrate it reliably. kazi (an open-source reconciliation controller that drives a coding agent in a loop until a goal's predicates are objectively true) supports multiple harnesses as config-driven profiles -- claude, opencode, codex, and others -- by parsing each harness's structured output for the result and token/cost usage.
Because claw currently emits only raw stdout with no structured envelope, its integration is necessarily best-effort: the raw text can be captured as the result, but there is no reliable way to extract the outcome status or token/cost. A --json mode would let claw be driven as a first-class, cost-accountable harness the same way codex/opencode are.
Suggested shape (for reference)
claw <prompt> --json
# -> {"result": "...", "status": "ok", "usage": {"input_tokens": N, "output_tokens": M, "cost_usd": X}}
Matching the codex/opencode NDJSON convention would let existing parsers be reused. Happy to share how the kazi profile contract works if useful. Thanks!
- Ngôn ngữ chính
- Rust
- Star
- 195k
- Fork
- 108k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ultraworkers/claw-code
-
Fix markdown formatting issues in TUI streaming: block-level element newline omission and consecutive empty line accumulationCó thể làm lại được @Aditaya08 đã nhận 50 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ultraworkers/claw-code#3259 · 7 bình luận ·
-
fix(cli): resolve duplicate assistant text printing after 'Done' in non-compact text modeCó thể đã có người làm @nankingjing đã nhận 89 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ultraworkers/claw-code#3258 · 1 bình luận ·
-
bug: Missing newlines before paragraphs and code blocks in streamed Markdown renderingCó thể đã có người làm @nankingjing đã nhận 89 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ultraworkers/claw-code#3257 · 2 bình luận ·
-
[CRITICAL][SECURITY] Untrusted project hooks bypass read-only mode for arbitrary command executionĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
ultraworkers/claw-code#3301 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
ultraworkers/claw-code#3300 · 2 bình luận ·
Tất cả issue của ultraworkers/claw-code
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
elodin-sys/elodin#890 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
guidance-ai/llguidance#391 ·