A simple cat alternative written in Rust with syntax highlighting and some extra features.
- Syntax Highlighting: Automatic syntax highlighting for various file types
- Line Numbers: Optional line numbering with
-nflag - Clipboard Integration: Copy output directly to clipboard
- Smart Copy Confirmation: Prompts for large content (>2500 chars) unless forced
- Multi-file Support: Display multiple files with clear separators
- Show All Characters: Display non-printable characters with
-Aflag
cargo build --releaseThe binary will be available as bcat in target/release/.
bcat file.rs
bcat file1.py file2.js # Multiple filesbcat -n file.rs
bcat --number file.rsbcat -c file.rs # Copy with confirmation for large files
bcat -cf file.rs # Force copy without confirmation
bcat --copy --force file.rsbcat -A file.txt
bcat --show-all file.txtbcat -nc file.rs # Line numbers + copy
bcat -nAcf file.rs # All options combined| Option | Short | Description |
|---|---|---|
--number |
-n |
Show line numbers |
--show-all |
-A |
Show all characters (including non-printable) |
--copy |
-c |
Copy output to clipboard |
--force |
-f |
Force copy without confirmation for large content |
--help |
-h |
Show help message |
Display a Rust file with syntax highlighting:
bcat src/main.rsCopy a configuration file to clipboard with line numbers:
bcat -nc config.tomlView multiple files with all characters visible:
bcat -A file1.txt file2.logclap- Command line argument parsingsyntect- Syntax highlightinganyhow- Error handlingarboard- Clipboard integration
This project is open source and available under the MIT license.