Several --format flags are parsed but ignored (kcl bounding-box always prints a table), and kcl snapshot --session ignores its rendering flags
Context: API Makeathon participant. Found while reviewing the kcl command surface; the bounding-box no-op was independently confirmed by a second review pass.
1. zoo kcl bounding-box --format is dead
src/cmd_kcl.rs:1189-1191 declares pub format: Option<FormatOutput> with help "Output format", but the run impl (src/cmd_kcl.rs:1246-1286) never reads it. It unconditionally calls bounding_box_rows(...) and ctx.io.write_output_table_for_vec(...), so the output is always an ASCII table.
Every sibling measurement command resolves format via ctx.format(&self.format) (volume, mass, center-of-mass, density, surface-area), and the bounding-box row struct even derives serde::Serialize, so JSON output was clearly intended. The config-file format setting is ignored too, since that is also resolved inside ctx.format.
2. Same dead --format on other commands
kcl export (src/cmd_kcl.rs:121-123), kcl snapshot (:324-326), and kcl view (:603-605) declare "Command output format" but never reference self.format. api-call status (src/cmd_api_call.rs) accepts a format flag but hardcodes JSON output.
3. kcl snapshot --session ignores its rendering flags
The session branch (src/cmd_kcl.rs:394-413) posts only the program and a test name to the local session server and writes back whatever bytes return. --angle, --camera-style, --camera-padding, --replay, --allow-errors, and the requested --output-format are all ignored, so -t jpeg writes PNG bytes into a .jpeg file.
Concrete failure
zoo kcl bounding-box part.kcl --output-unit mm --format json | jq . gets a table and jq fails, while every other zoo kcl measurement command works in that pipeline. zoo kcl snapshot --session -t jpeg --angle ... saves a default-angle PNG under a .jpeg name.
Verify
Grep self.format in src/cmd_kcl.rs: it is referenced by the other measurement commands and nowhere in the bounding-box impl. Run zoo kcl bounding-box some.kcl --output-unit mm --format json: the output is a table. Capture the --session snapshot request with varying flags: the request body does not change.
Suggested fix
Wire ctx.format(&self.format) / ctx.io.write_output into bounding-box (and the other dead-flag commands), and thread the snapshot options into the session request, or remove the flags that cannot take effect.
Environment
Zoo CLI v0.2.184 (33534cd). Reviewed against the current main of KittyCAD/cli.
Several
--formatflags are parsed but ignored (kcl bounding-boxalways prints a table), andkcl snapshot --sessionignores its rendering flagsContext: API Makeathon participant. Found while reviewing the kcl command surface; the
bounding-boxno-op was independently confirmed by a second review pass.1.
zoo kcl bounding-box --formatis deadsrc/cmd_kcl.rs:1189-1191declarespub format: Option<FormatOutput>with help "Output format", but the run impl (src/cmd_kcl.rs:1246-1286) never reads it. It unconditionally callsbounding_box_rows(...)andctx.io.write_output_table_for_vec(...), so the output is always an ASCII table.Every sibling measurement command resolves format via
ctx.format(&self.format)(volume, mass, center-of-mass, density, surface-area), and the bounding-box row struct even derivesserde::Serialize, so JSON output was clearly intended. The config-fileformatsetting is ignored too, since that is also resolved insidectx.format.2. Same dead
--formaton other commandskcl export(src/cmd_kcl.rs:121-123),kcl snapshot(:324-326), andkcl view(:603-605) declare "Command output format" but never referenceself.format.api-call status(src/cmd_api_call.rs) accepts a format flag but hardcodes JSON output.3.
kcl snapshot --sessionignores its rendering flagsThe session branch (
src/cmd_kcl.rs:394-413) posts only the program and a test name to the local session server and writes back whatever bytes return.--angle,--camera-style,--camera-padding,--replay,--allow-errors, and the requested--output-formatare all ignored, so-t jpegwrites PNG bytes into a.jpegfile.Concrete failure
zoo kcl bounding-box part.kcl --output-unit mm --format json | jq .gets a table andjqfails, while every otherzoo kclmeasurement command works in that pipeline.zoo kcl snapshot --session -t jpeg --angle ...saves a default-angle PNG under a.jpegname.Verify
Grep
self.formatinsrc/cmd_kcl.rs: it is referenced by the other measurement commands and nowhere in the bounding-box impl. Runzoo kcl bounding-box some.kcl --output-unit mm --format json: the output is a table. Capture the--sessionsnapshot request with varying flags: the request body does not change.Suggested fix
Wire
ctx.format(&self.format)/ctx.io.write_outputintobounding-box(and the other dead-flag commands), and thread the snapshot options into the session request, or remove the flags that cannot take effect.Environment
Zoo CLI v0.2.184 (33534cd). Reviewed against the current
mainof KittyCAD/cli.