fcpy

Crates.iofcpy
lib.rsfcpy
version0.0.1
created_at2025-06-05 02:57:46.168665+00
updated_at2025-06-05 02:57:46.168665+00
descriptionFast command-line file concatenator with smart filtering, recursive scanning, and clipboard integration.
homepage
repositoryhttps://github.com/thomasalmeida/fcpy
max_upload_size
id1701029
size610,794
Thomas Almeida (thomasalmeida)

documentation

README

fcpy - File Concatenator

fcpy logo

Crates.io GitHub release CI Status License

A high-performance command-line file concatenator written in Rust, designed to safely aggregate text files while automatically ignoring binary and media files. Features clipboard integration and smart filtering.

Features

  • 📋 Automatic clipboard copying (wl-copy or xclip/xsel required)
  • Intelligent binary-file detection – prevents corrupted output
  • 🛡️ Safe path handling and permission checks
  • 🔍 Advanced glob-pattern matching for ignore rules
  • 📁 Recursive directory processing
  • 📦 Cross-platform single-binary deployment

Installation

Crates.io

cargo install fcpy

Direct Download

# Download latest release
curl -LO https://github.com/thomasalmeida/fcpy/releases/latest/download/fcpy-linux-amd64
chmod +x fcpy-linux-amd64
sudo mv fcpy-linux-amd64 /usr/local/bin/fcpy

From Source

# Clone repository
git clone https://github.com/thomasalmeida/fcpy
cd fcpy

# Build and install
make install

Manual (local build)

# Build the release binary
cargo build --release

# Copy to a directory in your PATH (Linux/macOS)
sudo cp target/release/fcpy /usr/local/bin/

# Now you can run:
fcpy --help

Usage

fcpy [PATHS]... [OPTIONS]

Options:

  • -o, --output [FILE] Save output to file (default: paste.txt when -o is used without value)

  • -i, --ignore <PATTERN>... Ignore files/directories matching glob patterns

  • -h, --help Show help

  • -V, --version Show version

Examples

# Concatenate all .rs files, ignoring .git and target directories
fcpy src/*.rs -i .git target *.lock

# Combine multiple directories and patterns, output to log.txt
fcpy docs/ examples/ -i "**/node_modules/**" "*.zip" -o log.txt

# Process multiple files and directories
fcpy README.md LICENSE src/ -i "*.exe" "*.bin"

Testing

Run unit and integration tests:

cargo test

Performance Tips

Use more specific patterns for better performance:

# Good
fcpy . -i target "*.log"

# Better (specific directory exclusion)
fcpy . -i "**/node_modules/**" "*.zip"

Contributing

Contributions are welcome! To propose changes:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit your changes (git commit -m "Add feature")
  4. Push and open a Pull Request

License

This project is licensed under the MIT License – see the LICENSE file for details.

Commit count: 1

cargo fmt