Gå til hovedinnhold

kapi exec search-replace

kapi search-replace [files...]

Søk og erstatt

Commandexec search-replace
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 exec search-replace messages.json --find "foo" --replace "bar"
Flags
FlagTypeDefaultDescription
--concurrency , -jint0max parallel files (0 = auto)
--dot-all boolfalseMake the period character match every character including line-feed
--encoding , -estringinput file encoding
--fail-on-unknown boolfalseexit with error if any file cannot be processed (default: skip with warning)
--format , -fstringoverride input format detection
--ignore-case boolfalseIgnore case when matching search patterns
--json boolfalseoutput results as JSON
--map , -mstringArraymap glob pattern to format (e.g. '*.docx=okf_openxml:test')
--multi-line boolfalseMake ^ and $ match at the beginning and end of each line
--no-warn boolfalsesuppress warnings for skipped files
--output , -ostringoutput path template (variables: {dir}, {name}, {ext}, {lang})
--output-dir stringwrite outputs under DIR/{lang}/ (default: beside the input, mirroring its locale layout)
--pack boolfalsewhen transforming a .kpz, also eject the result to the .kpz (auto-pack)
--parallel-blocks int0fan out block processing across N goroutines (0 = off)
--progress , -pboolfalseshow progress bar
--reg-ex boolfalseEnable regular expression mode for all search patterns
--replace-all booltrueReplace all matches instead of only the first
--source boolfalsePerform search and replace on source content
--source-lang stringsource language (e.g. en, en-US; defaults to the project's source_language, else en)
--strict boolfalsealias for --fail-on-unknown
--target booltruePerform search and replace on target content
--target-lang stringtarget language (e.g. fr, de-DE)
--trace stringwrite flow trace JSON to file (for flow visualization)
More examples
kapi exec search-replace page.html --find "colour" --replace "color"

← Back to the Command Reference