Crates.io | dirscribe |
lib.rs | dirscribe |
version | 0.4.0-alpha.1 |
source | src |
created_at | 2024-12-03 11:17:55.047781 |
updated_at | 2024-12-07 13:39:11.520373 |
description | A CLI tool that combines contents of files with specific extensions from a directory |
homepage | https://github.com/0xideas/dirscribe |
repository | https://github.com/0xideas/dirscribe |
max_upload_size | |
id | 1469884 |
size | 41,291 |
A CLI tool that collects and combines files with specific extensions from a directory into a single output file.
cargo install dirscribe
Basic syntax:
dirscribe <directory_path> <comma_separated_suffixes> [options]
Example:
dirscribe ./src txt,md,rs
--use-gitignore
: Respect .gitignore rules--exclude-paths
: Comma-separated paths to exclude--include-paths
: Comma-separated paths to include--or-keywords
: Only include files containing at least one of these keywords--and-keywords
: Only include files containing all of these keywords--exclude-keywords
: Exclude files containing any of these keywords--diff-only
: Only process files that have Git changes--start-commit-id
: Starting commit ID for Git diff range (optional). If provided alone without end-commit-id, diffs from this commit to the current working directory--end-commit-id
: Ending commit ID for Git diff range (optional). Must be used with start-commit-id# Example using Git commit range
dirscribe ./src rs,md \
--diff-only \
--start-commit-id abc123 \
--end-commit-id def456
This will only process files that changed between commits abc123 and def456.
dirscribe ./src rs,md \
--use-gitignore \
--include-paths src \
--exclude-paths src/core,src/temp \
--or-keywords "TODO,FIXME" \
--and-keywords "pub,struct" \
--exclude-keywords "DEPRECATED,WIP" \
--diff-only
The tool creates dirscribe.txt
in the current directory with entries in this format:
File: /path/to/file1.txt
[Contents of file1.txt]
File: /path/to/file2.md
[Contents of file2.md]
MIT License