Skip to main content

kapi inspect

kapi inspect [flags] [FILE...]

Parse each file into one record per content block: the text, a stable content-hash anchor, and the block's structural role (heading, list-item, table-cell, …) and nesting level. Any format — a Word document, a JSON catalog, Markdown, HTML — yields the same shape, so an AI agent or RAG pipeline can read content, retrieve against the anchors, and write edits back to the same blocks.

Prints a JSON array by default; --output-format yaml emits a YAML sequence, and --jsonl streams one JSON object per line (JSONL) for piping into an ingestion pipeline.

Positional paths take glob patterns (** recurses) and directories, expanded by kapi itself. Inside a project, no FILE means the project's tracked content; FILE "-" reads standard input.

Commandinspect
Groupadvanced
Try it

Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.

kapi inspect report.docx
Flags
FlagTypeDefaultDescription
--encodingstringUTF-8input encoding
--format, -fstringinput format (default: auto-detect by extension/content)
--jsonlboolfalsestream one JSON object per line (JSONL) instead of a JSON array
--projectstringSlicealso render each block to these target formats (html, markdown, asciidoc) under "projected"
--source-langstringensource language (e.g. en, en-US)
More examples
kapi inspect --jsonl 'docs/**/*.md' | jq .content_hash
kapi inspect --output-format yaml report.dclg.xml
kapi inspect report.docx --project html,markdown # each block rendered per format
cat page.html | kapi inspect -f html

← Back to the Command Reference