Gå til hovedinnhold

kapi stats

kapi stats [files...]

Summarize the content of one or more files: total and translatable blocks, word and character counts (with and without spaces), segments, and a breakdown by structural role (heading, paragraph, list-item, table-cell, …). Any format — a Word document, a JSON catalog, Markdown, HTML — yields the same shape.

Word, character, and segment counts cover the translatable content; block and role counts cover the whole document. Prints a human table by default; --output-format json|yaml emits the structured record for piping into a pipeline.

Positional paths accept glob patterns and directories, expanded by kapi itself — quote the pattern and ** recurses identically in every shell. Inside a project, no FILE means the project's tracked content; FILE "-" reads standard input.

Commandstats
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 stats report.docx
Flags
FlagTypeDefaultDescription
--encodingstringUTF-8input encoding
--format, -fstringinput format (default: auto-detect by extension/content)
--source-langstringensource language (e.g. en, en-US)
More examples
kapi stats 'src/**' # every file under src, any depth
kapi stats --output-format json 'docs/**/*.md' | jq '.total.words'
kapi stats # inside a project: its tracked content
cat page.html | kapi stats -f html

← Back to the Command Reference