kapi inspect
kapi inspect [flags] [FILE...]Read each file into one record per content block. Any format, whether a Word document, a JSON catalog, Markdown or HTML, yields the same shape, so an agent or a script can read content and send edits back to the same blocks with kapi apply:
ref the block's reference, {"doc", "block", "edition"}, to copy into an operation's "at" rev the revision of the block's text, to send as "if_match" text the text, with inline codes as <x id="…"/> placeholders codes each inline code by the id its placeholder shows: its type, its attributes, and the attributes an edit may change structures each plural or select, with the path to each branch and the branch's text editions the block's other editions, each with its revision and text, and the status the file records for it where it keeps one ops the operations the block accepts role, level the block's structural role (heading, list-item, table-cell, …) and nesting level
Inside a project (the one -p names, or the one found from the working directory) a file is named by its project-relative path and read with the format and configuration the recipe binds, and each declared translation is listed among the editions. A file outside the project is named by its absolute path. A bilingual file whose reader has to be told the language of the translation it holds, such as a PO catalog, lists it with --target-lang. A source file whose comments are what kapi edits in it lists each comment, keyed as kapi check reports it (func/Parse).
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 a script.
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.
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| Flag | Type | Default | Description |
|---|---|---|---|
| --encoding | string | charset the input is read in; a byte-order mark in the file wins (default: the project's defaults.encoding, then UTF-8) | |
| --engine | string | format engine for detected files: native or a plugin name (default: native, then plugins) | |
| --format, -f | string | input format (default: what the recipe binds, else auto-detect by extension/content) | |
| --jsonl | bool | false | stream one JSON object per line (JSONL) instead of a JSON array |
| --project, -p | string | path to a kapi.yaml project recipe or its directory (auto-discovered from cwd if omitted) | |
| --render | stringSlice | also render each block to these formats (html, markdown, asciidoc) under "projected" | |
| --target-lang | string | target language (e.g. fr, de-DE); one per run |
kapi inspect --jsonl 'docs/**/*.md' | jq '{ref, rev}' kapi inspect --output-format yaml report.dclg.xml kapi inspect report.docx --render html,markdown # each block rendered per format kapi inspect -p site/kapi.yaml site/docs/guide.mdcat page.html | kapi inspect -f html← Back to the Command Reference