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 Carrillo — juanjose.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file catr-1.3.1.tar.gz.
File metadata
- Download URL: catr-1.3.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b551773f545c452ee6579f786f920bed2bb57f0648056b91ad5e509c5fc2a306
|
|
| MD5 |
2f7802d5af7f673ad475e7396fc93609
|
|
| BLAKE2b-256 |
da689125ac2224b309dd220f34e3ac7bf661d3d658e9b64c2a6532957e1cd5cd
|
File details
Details for the file catr-1.3.1-py3-none-any.whl.
File metadata
- Download URL: catr-1.3.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db04a5902060318d30466af17905bca2d28be5bf8b052b1faaa129d00121c27a
|
|
| MD5 |
8ea64751567c70d90daed84d69a55eb8
|
|
| BLAKE2b-256 |
b87891e251fbf9287dac2af68f40f0b61b6e303d06cacbb2515ab2c41a18977e
|