Skip to main content

A sleek terminal syntax highlighting file viewer.

Project description

catr

A sleek terminal syntax highlighting file viewer — like cat, but prettier.

catr displays file contents in your terminal with full syntax highlighting, line numbers, file metadata, and a clean formatted layout powered by Pygments.


Features

  • Syntax highlighting for hundreds of languages (Python, C, JavaScript, YAML, and more)
  • Line numbers with aligned gutter
  • File metadata — filename, size in bytes, and total line count
  • Binary file detection — gracefully handles non-text files
  • Colorized output using true-color terminal support
  • Works as a global CLI command after installation

Installation

pip install catr

Or install from source:

git clone https://github.com/your-username/catr.git
cd catr
pip install .

Dependencies

Usage

catr <file_path>

Examples

catr src/catr/catr.py
catr README.md
catr config.yaml

Sample Output

────────────────────────────────────────────────────────────────────────────────────────────────────
    catr.py (2048 bytes) | 72 lines
────────────────────────────────────────────────────────────────────────────────────────────────────
 1 │ import sys
 2 │ from pygments import highlight
 3 │ ...
────────────────────────────────────────────────────────────────────────────────────────────────────
: < END OF FILE >
════════════════════════════════════════════════════════════════════════════════════════════════════

Requirements


Project Structure

catr/
├── src/
│   └── catr/
│       ├── __init__.py
│       └── catr.py
├── pyproject.toml
└── README.md

License

See LICENSE for details.


Author

Juan Jose Solorzano Carrillojuanjose.solorzano.c@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catr-1.4.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catr-1.4.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file catr-1.4.1.tar.gz.

File metadata

  • Download URL: catr-1.4.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for catr-1.4.1.tar.gz
Algorithm Hash digest
SHA256 c5f9229439e109a79d6f124837ea485013023537275bd0001a54380f507ab2e5
MD5 a4a095267abf573d34b7d6b1411adecd
BLAKE2b-256 127230f0df4ea90905e5253d843ac7356119004e14e5884c1c915a28e54e274c

See more details on using hashes here.

File details

Details for the file catr-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: catr-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for catr-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df8bfd9691b842c293d8e0a794427776d81e2c3b4bb6f0de7dff7886155ade33
MD5 fed7b7f771fbeba3b958eca2acc24b2f
BLAKE2b-256 3db81daf0ce2dbf476892c857c2585229aafa4ac5439965df6d752e6bc2b6ede

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page