Skip to main content

kapi search-replace

kapi search-replace [files...]

Search and Replace

Commandsearch-replace
Grouptext-processing
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 search-replace messages.json --find "foo" --replace "bar"
Flags
FlagTypeDefaultDescription
--concurrency, -jint0max parallel files (0 = auto)
--dot-allboolfalseMake the period character match every character including line-feed
--encoding, -estringUTF-8input file encoding
--fail-on-unknownboolfalseexit with error if any file cannot be processed (default: skip with warning)
--format, -fstringoverride input format detection
--ignore-caseboolfalseIgnore case when matching search patterns
--jsonboolfalseoutput results as JSON
--map, -mstringArraymap glob pattern to format (e.g. '*.docx=okf_openxml:test')
--multi-lineboolfalseMake ^ and $ match at the beginning and end of each line
--no-warnboolfalsesuppress warnings for skipped files
--output, -ostringoutput path template (variables: {dir}, {name}, {ext}, {lang})
--output-dirstringwrite outputs under DIR/{lang}/ (default: beside the input, mirroring its locale layout)
--packboolfalsewhen transforming a .klz, also eject the result to the .klz (auto-pack)
--parallel-blocksint0fan out block processing across N goroutines (0 = off)
--progress, -pboolfalseshow progress bar
--reg-exboolfalseEnable regular expression mode for all search patterns
--replace-allbooltrueReplace all matches instead of only the first
--sourceboolfalsePerform search and replace on source content
--source-langstringensource language (e.g. en, en-US)
--strictboolfalsealias for --fail-on-unknown
--targetbooltruePerform search and replace on target content
--target-langstringtarget language (e.g. fr, de-DE)
--tracestringwrite flow trace JSON to file (for flow visualization)
More examples
kapi search-replace page.html --find "colour" --replace "color"

← Back to the Command Reference