Note: A complete reference implementation is already available in my fork: Mephistophillis/jsight-cli @ llm-support. I'm opening this issue as required by the contributing guidelines before submitting a PR.
Summary
Currently, jsight doc only supports HTML output (jsight doc html). This makes it impossible to programmatically process API documentation in CI/CD pipelines, scripts, or by AI agents.
We propose adding two new subcommands — jsight doc json and jsight doc yaml — that output the native JSight catalog (produced by the internal ToJson() method) in machine-readable formats.
Problem
jsight doc currently supports only HTML output. The existing jsight convert openapi json/yaml is not a solution — it converts to the OpenAPI specification, not the native JSight structure, and it has no --output flag.
Issues with HTML-only output:
- HTML cannot be consumed by scripts, AI agents, or CI/CD pipelines.
- The internal IR already holds all the needed data, but it's exposed only through HTML rendering.
- Tools like
jq and yq cannot parse HTML documentation.
- LLM agents cannot reliably extract structured data from HTML to auto-generate client code or tests.
Proposed Solution
Add two new subcommands under jsight doc:
jsight doc json <file.jst> [--pretty] [--output/-o <file>] [--strict]
jsight doc yaml <file.jst> [--output/-o <file>] [--strict]
The output is the raw JSight catalog from the internal ToJson() method — no field renaming or additional metadata.
Command Tree (after)
jsight
├── doc
│ ├── html ← existing
│ ├── json ← NEW
│ └── yaml ← NEW
├── convert
│ └── openapi
└── version
New Flags
| Flag |
Description |
Default |
Commands |
--pretty |
Indent JSON output with 2 spaces |
enabled |
json only |
--output / -o |
Write to file instead of stdout |
— |
json, yaml |
--strict |
Non-zero exit code on any warning |
disabled |
json, yaml |
Exit Codes
| Code |
Situation |
0 |
Success |
1 |
.jst parse error |
2 |
File not found |
3 |
Serialization or file write error |
4 |
Warning present + --strict flag |
Use Cases
| Use Case |
Command |
| Save doc to file |
jsight doc json my-api.jst -o doc.json |
| CI/CD pipe |
jsight doc json my-api.jst | jq '.interactions[].path' |
| AI agent consumption |
jsight doc json my-api.jst (parse stdout) |
| Breaking change detection |
diff <(jsight doc json v1.jst) <(jsight doc json v2.jst) |
Backward Compatibility
All existing commands remain unchanged:
jsight doc html — unchanged
jsight convert openapi json/yaml — unchanged
jsight version — unchanged
- All existing tests continue to pass
Implementation Status
All changes are already implemented in the fork and ready for review:
Summary
Currently,
jsight doconly supports HTML output (jsight doc html). This makes it impossible to programmatically process API documentation in CI/CD pipelines, scripts, or by AI agents.We propose adding two new subcommands —
jsight doc jsonandjsight doc yaml— that output the native JSight catalog (produced by the internalToJson()method) in machine-readable formats.Problem
jsight doccurrently supports only HTML output. The existingjsight convert openapi json/yamlis not a solution — it converts to the OpenAPI specification, not the native JSight structure, and it has no--outputflag.Issues with HTML-only output:
jqandyqcannot parse HTML documentation.Proposed Solution
Add two new subcommands under
jsight doc:The output is the raw JSight catalog from the internal
ToJson()method — no field renaming or additional metadata.Command Tree (after)
New Flags
--prettyjsononly--output/-ojson,yaml--strictjson,yamlExit Codes
01.jstparse error234--strictflagUse Cases
jsight doc json my-api.jst -o doc.jsonjsight doc json my-api.jst | jq '.interactions[].path'jsight doc json my-api.jst(parse stdout)diff <(jsight doc json v1.jst) <(jsight doc json v2.jst)Backward Compatibility
All existing commands remain unchanged:
jsight doc html— unchangedjsight convert openapi json/yaml— unchangedjsight version— unchangedImplementation Status
All changes are already implemented in the fork and ready for review:
jsight doc json—cmd/doc/json.gojsight doc yaml—cmd/doc/yaml.goDocSerializerinterface —internal/serializer/serializer.go--prettysupport —internal/serializer/json.gointernal/serializer/yaml.goREADME.mdupdated with new commandstests/run-tests.sh(recommended addition)