Add structured (JSON) output for tool/agent integration
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Rust
- Estrellas
- 195k
- Forks
- 108k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ultraworkers/claw-code
-
Fix markdown formatting issues in TUI streaming: block-level element newline omission and consecutive empty line accumulationQuizá libre de nuevo @Aditaya08 la tomó hace 49 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ultraworkers/claw-code#3259 · 7 comentarios ·
-
fix(cli): resolve duplicate assistant text printing after 'Done' in non-compact text modePosiblemente ocupada @nankingjing la tomó hace 88 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ultraworkers/claw-code#3258 · 1 comentario ·
-
bug: Missing newlines before paragraphs and code blocks in streamed Markdown renderingPosiblemente ocupada @nankingjing la tomó hace 89 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ultraworkers/claw-code#3257 · 2 comentarios ·
-
[CRITICAL][SECURITY] Untrusted project hooks bypass read-only mode for arbitrary command executionAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
ultraworkers/claw-code#3301 · 4 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
ultraworkers/claw-code#3300 · 2 comentarios ·
Todos los issues de ultraworkers/claw-code
Issues similares
-
app enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
elodin-sys/elodin#890 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
guidance-ai/llguidance#391 ·
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Verifiedz/Shimmer#144 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
点击设置提示`操作未能完成,详情请查看应用日志`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Y-ASLant/ElegantClipboard#166 ·