Welcome to fileagg
, the ultimate file aggregation tool! If you've ever needed to consolidate multiple files from a directory into a single file effortlessly, fileagg
is your go-to solution. With features like respecting .gitignore
, excluding node_modules
, and supporting multiple output options, fileagg
makes file management a breeze.
- Aggregate File Contents: Combine contents from all files in a directory into one file.
- Respects
.gitignore
: Automatically skip files listed in.gitignore
. - Excludes
node_modules
: No more unnecessary bloat in your aggregated output. - Flexible Output Options: Save to a file, print to console, or copy directly to clipboard.
- Include Hidden Files: Optionally include hidden files in your aggregation.
- Filter by File Type: Only aggregate specific file types you care about.
- Progress Indication: See real-time progress as files are processed.
Ensure you have Rust and Cargo installed on your system.
To install fileagg
as a Cargo package, run the following command:
cargo install fileagg
If you prefer to build fileagg
from source:
-
Clone the repository or download the source code.
-
Navigate to the project directory:
cd path/to/your/fileagg
-
Build and install locally:
cargo install --path .
By default, fileagg
aggregates files in the current directory and saves the output to fileagg_output.txt
.
fileagg
Aggregate files from a specific directory:
fileagg /path/to/directory
To customize the output file location and name:
fileagg --output result.txt
This command saves the output to result.txt
.
To print the aggregated contents to the console:
fileagg --stdout
Copy the aggregated contents to your clipboard:
fileagg --clipboard
5. Include Hidden Files
To include hidden files (e.g., .env
, .gitignore
):
fileagg --include-hidden
If you want to ignore .gitignore
rules and include all files:
fileagg --no-ignore
Aggregate only specific file types:
fileagg --file-types rs,js,py
-
Aggregate all files in the current directory and save to
fileagg_output.txt
:fileagg
-
Aggregate files from a specific directory and save to
custom_output.txt
:fileagg /path/to/directory --output custom_output.txt
-
Include hidden files and print output to console:
fileagg --include-hidden --stdout
-
Aggregate specific file types and copy to clipboard:
fileagg --file-types md,txt --clipboard
- Node Modules Exclusion:
fileagg
automatically skips files in thenode_modules
directory. - Default Output: If no output method is specified, results are saved to
fileagg_output.txt
. - Safety First: Ensure the output file isn't in the list of files to aggregate to prevent overwriting.
We welcome contributions! Feel free to submit issues, pull requests, or ideas for improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or feedback, reach out to simplysabir.