| Crates.io | rosetree |
| lib.rs | rosetree |
| version | 0.2.1 |
| created_at | 2025-06-23 07:50:13.654754+00 |
| updated_at | 2025-06-28 08:16:09.616764+00 |
| description | A fast command-line tool for scanning directories, analyzing file structures, and extracting file contents with gitignore support |
| homepage | https://github.com/huahuadeliaoliao/RoseTree |
| repository | https://github.com/huahuadeliaoliao/RoseTree |
| max_upload_size | |
| id | 1722579 |
| size | 57,720 |
A fast and efficient command-line tool for scanning directories, analyzing file structures, and extracting file contents with support for .gitignore rules.
.gitignore rules during scanningcargo install rosetree
git clone https://github.com/huahuadeliaoliao/RoseTree.git
cd RoseTree
cargo build --release
Simply run the command in any directory:
rst
The tool will:
.gitignore files and ask if you want to apply the rulesy to respect .gitignore files, n to scan all files1 3 5) to select certain file typesa to select all file typesScanning current directory and subdirectories...
Found the following .gitignore files:
- .gitignore
- frontend/.gitignore
Apply .gitignore rules? (y/n):
y
Found the following UTF-8 file types:
1. rs
2. md
3. toml
4. json
5. js
Enter file type numbers to extract (space-separated, 'a' for all types):
1 2 3
Reading file contents...
File contents successfully extracted to: rosetree_20240623_143022.md
The generated Markdown file contains:
Example output structure:
# Project Analysis Report
## File Structure
. โโโ Cargo.toml โโโ README.md โโโ src/ โ โโโ main.rs โโโ target/
## File Contents
### `Cargo.toml`
```toml
[package]
name = "rosetree"
version = "0.2.0"
...
README.md# RST (RoseTree)
...
## Performance
RST is optimized for speed:
- **Parallel Processing**: Files are scanned and processed in parallel
- **Smart Sampling**: Only reads the first 1024 bytes for UTF-8 detection
- **Memory Efficient**: Streams file content instead of loading everything into memory
- **Timing Reports**: Built-in performance monitoring
Example timing output:
Total processing time: 17,611 ยตs 17 ms (approx total)
## Dependencies
- [rayon](https://crates.io/crates/rayon) - Data parallelism
- [chrono](https://crates.io/crates/chrono) - Date and time handling
- [ignore](https://crates.io/crates/ignore) - GitIgnore rule processing
- [dashmap](https://crates.io/crates/dashmap) - Concurrent HashMap
- [content_inspector](https://crates.io/crates/content_inspector) - Binary/text file detection
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## Changelog
### v0.2.0
- **Enhanced Output Format**: Switch from plain text to Markdown with syntax highlighting
- **Improved Internationalization**: All comments translated to English
- **Better Structure**: Organized output with project analysis report format
- **Syntax Highlighting**: Support for 15+ programming languages in output
- **Code Quality**: Improved error handling and code organization
### v0.1.0
- Initial release
- Basic directory scanning and file extraction
- GitIgnore support
- Multi-threaded processing
- UTF-8 file detection optimization