| Crates.io | luff |
| lib.rs | luff |
| version | 0.1.1 |
| created_at | 2024-02-10 17:00:33.304657+00 |
| updated_at | 2025-11-12 04:12:36.897565+00 |
| description | Print files with formatting |
| homepage | |
| repository | https://github.com/owlroute/luff |
| max_upload_size | |
| id | 1135068 |
| size | 362,790 |
A production-grade CLI tool for printing file contents with multiple output formats, written in Rust.
git clone https://github.com/owlroute/luff.git
cd luff
cargo install --path .
cargo build --release
./target/release/luff --help
Print specific files with Markdown formatting:
luff -f src/main.rs Cargo.toml
Print all files in the current directory:
luff
Start from the git repository root:
luff -g
Honor gitignore patterns when walking (on by default):
luff
Include files that .gitignore would normally skip:
luff --ignored
Include dot-directories and files:
luff -d
Display as a tree structure:
luff --format tree
Only traverse up to N levels deep:
luff --max-depth 3
Copy output to system clipboard (also prints to stdout):
luff -c
Copy to clipboard without printing to terminal:
luff -c -S
Show detailed information about file processing:
luff -v
# Walk git repo, include ignored files, include dotfiles, debug output
luff -g -I -d -v
# Process specific files with tree format
luff -f src/*.rs --format tree
# Walk with depth limit and copy to clipboard
luff --max-depth 2 -c
# Clipboard-only mode with tree format
luff --format tree -c -S
| Flag | Long | Description |
|---|---|---|
-f |
--files <FILES>... |
Process specific files (disables directory walk) |
-g |
--git |
Start from git repository root |
-d |
--dotfiles |
Include hidden files/directories |
-I |
--ignored |
Include files ignored by .gitignore |
-c |
--clip |
Copy output to clipboard (also prints to stdout unless -S used) |
-S |
--suppress-stdout |
Suppress stdout output (useful with -c for clipboard-only) |
-v |
--verbose |
Enable debug logging |
--format <FORMAT> |
Output format: markdown, tree (default: markdown) | |
--max-depth <N> |
Maximum directory depth (0 = unlimited, default: 0) | |
-h |
--help |
Print help information |
-V |
--version |
Print version information |
| Flags | Behavior |
|---|---|
| (none) | Stream to stdout (default, low memory) |
-c |
Buffer entire output, write to stdout AND clipboard |
-c -S |
Buffer entire output, copy to clipboard only (no stdout) |
-S |
No output (edge case, allowed but not useful) |
Note: Clipboard mode requires buffering the entire output in memory before writing. For large codebases, this may use significant memory.
luff > output.txt output# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run with arguments
cargo run -- --help
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_normalize_path
# Run integration tests only
cargo test --test integration_test
# Run E2E tests
cargo test --test e2e_test
# Run with property-based tests
cargo test --features proptest
# Run all benchmarks
cargo bench
# Run specific benchmark
cargo bench walker_small
# Generate HTML reports
cargo bench -- --save-baseline my-baseline
# Check for issues
cargo clippy
# Format code
cargo fmt
# Check for unsafe code
cargo geiger
This project follows security best practices: