Command Line
pip install typeseg installs the PyPI package, including the typeseg command and its alias segcat. See the content types inside a file directly in your terminal, with colored text, a legend, and a table of segment ranges and confidence scores.

textseg.precise; the current API call is typeseg.precise. Colors mark content types; the table shows ranges and confidence. Shell command text is redacted.Inspect a file
Section titled “Inspect a file”Start with U-Net for fast local inspection:
typeseg --model fast file.txtUse Mamba when full-file context matters more than throughput:
typeseg --model precise file.txttypeseg file.txt also uses Mamba: precise is the CLI default. U-Net is selected explicitly with --model fast.
Read from standard input
Section titled “Read from standard input”Omit the filename to read piped text:
cat file.txt | typeseg --model fastIn PowerShell:
Get-Content -Raw file.txt | typeseg --model fastThe file argument is read as UTF-8, with replacement for invalid characters. For other encodings, decode the input first and retain the original byte mapping if you need byte-accurate annotations.
Demo, alias, and module invocation
Section titled “Demo, alias, and module invocation”typeseg --model fast --demo # built-in mixed-text examplesegcat --model fast file.txt # alias of typesegpython -m typeseg --model fast file.txttypeseg --helpUnderstand the display
Section titled “Understand the display”The output shows the active backend, input length, a content-type legend, highlighted source, and a table of character ranges, labels, and confidence. Range ends are excluded. Confidence describes content type, not maliciousness.
Text tinting is automatic in an interactive terminal. NO_COLOR disables automatic text tinting; TYPESEG_COLOR=always or TYPESEG_COLOR=never overrides it. The CLI also uses ANSI formatting for its legend and table.
For structured results and configurable post-processing, use the Python API. For the package reference, see TypeSeg on PyPI.