CLI Reference¶
The parot binary is built from the crates/cli workspace member. Its full help tree is embedded below from _api/cli.md, regenerated by the api-docs skill against the live clap definitions.
For quickstart and common workflows, see the Guide.
CLI Reference: parot¶
Text index toolkit -- duplicate detection, pattern search, transforms, and more.
Backward compatibility: parot file.md is equivalent to parot scan file.md. Any first argument that is not a known subcommand and does not start with - is treated as a file path and scan is prepended automatically.
parot scan <file>¶
Find duplicate phrases in a text file.
| Option | Type | Default | Description |
|---|---|---|---|
--min-words |
usize |
4 |
Minimum words in a phrase |
--min-chars |
usize |
9 |
Minimum characters excluding spaces |
--max-words |
usize |
50 |
Maximum words in a phrase |
--min-count |
usize |
2 |
Minimum occurrences to report |
--top |
usize |
all | Show only top N results |
--no-blocks |
flag | off | Disable block detection |
--json |
flag | off | Output as JSON array |
--quiet |
flag | off | Suppress stats, only show results |
Output (text): One line per duplicate: {count}x ({words} words) "{phrase}"
Output (JSON): Array of {"phrase": "...", "count": N, "words": N}
parot index-dump <file>¶
Print the raw index: one rank\tposition row per line.
| Option | Type | Default | Description |
|---|---|---|---|
--bytes |
flag | off | Treat file as raw bytes instead of UTF-8 text |
--json |
flag | off | Output as JSON array |
Output (text): Tab-separated rank\tposition per line.
parot prefix-stats <file>¶
Print adjacent shared-prefix lengths for the index.
| Option | Type | Default | Description |
|---|---|---|---|
--bytes |
flag | off | Treat file as raw bytes instead of UTF-8 text |
--json |
flag | off | Output as JSON array |
Output (text): Tab-separated rank\tvalue per line.
parot search <file> <pattern>¶
Search for a pattern and print match positions.
| Option | Type | Default | Description |
|---|---|---|---|
--bytes |
flag | off | Treat file as raw bytes instead of UTF-8 text |
--json |
flag | off | Output as JSON array |
Output (text): One byte position per line.
Output (JSON): Array of positions.
parot count <file> <pattern>¶
Count occurrences of a pattern.
| Option | Type | Default | Description |
|---|---|---|---|
--bytes |
flag | off | Treat file as raw bytes instead of UTF-8 text |
Output: A single integer count.
parot transform <file>¶
Print the reversible block transform of the input.
| Option | Type | Default | Description |
|---|---|---|---|
--bytes |
flag | off | Treat file as raw bytes (output raw transformed bytes to stdout) instead of UTF-8 (output lossy UTF-8) |
parot lcs <file1> <file2>¶
Find the longest common substring between two files.
No additional options. Both files are read as UTF-8 text.
Output: Length: N followed by the substring, or No common substring found. if none exists.
parot info <file>¶
Print file statistics: size, word count, line count, and distinct-substring count.
| Option | Type | Default | Description |
|---|---|---|---|
--json |
flag | off | Output as JSON object |
Output (text):
Output (JSON): {"size_bytes": N, "words": N, "lines": N, "distinct_substrings": N}
Global Options¶
| Option | Description |
|---|---|
--help, -h |
Print help |
--version, -V |
Print version |