| Crates.io | merge-code |
| lib.rs | merge-code |
| version | 0.1.0 |
| created_at | 2026-01-19 11:50:24.285266+00 |
| updated_at | 2026-01-19 11:50:24.285266+00 |
| description | A CLI tool for merging multiple code files into a signle file |
| homepage | https://gitee.com/rifine/me |
| repository | https://gitee.com/rifine/me |
| max_upload_size | |
| id | 2054403 |
| size | 36,587 |
cargo install me
git clone https://github.com/YOUR_USERNAME/me.git
cd me
cargo install --path .
# Merge all supported files in the current directory into result.txt
me .
# Merge multiple directories
me ./src,./tests,./examples
# Specify an output filename
me . -o combined.txt
# List files that would be processed
me . --preview
# Preview multiple directories
me ./src,./tests --preview
# Merge only files with specific extensions
me . -e rs,toml,md
# Enable strict case-sensitive matching
me . -e RS,Toml --strict-case
# Limit file size (KB)
me . --max-file-size 1024 # Only process files smaller than 1MB
# Markdown format (suitable for documentation)
me . --format markdown -o code.md
# JSON format (suitable for programmatic processing)
me . --format json -o metadata.json
# Plain text format (default)
me . --format plain-text -o code.txt
# Follow symbolic links
me . --follow-links
# Different levels of verbosity
me . -v # Warning-level logs
me . -vv # Info-level logs
me . -vvv # Debug-level logs
me . -vvvv # Trace-level logs (includes file names and line numbers)
## ./src/main.rs
```rust
use clap::Parser;
mod cli;
mod merge;
fn main() {
// ...
}
[
{
"path": "./src/main.rs",
"content": [
"use clap::Parser;",
"",
"mod cli;",
"mod merge;",
"",
"fn main() {",
" // ...",
"}",
]
}
]
FILE: ./src/main.rs
============================================================
use clap::Parser;
mod cli;
mod merge;
fn main() {
// ...
}
USAGE:
me [OPTIONS] <DIRECTORIES>...
ARGS:
<DIRECTORIES>...
Directories to process (comma-separated or repeated)
Example: me ./src or me ./src,./tests
OPTIONS:
-e, --extensions <EXTENSIONS>
File extensions to include (comma-separated) [default: rs,toml,html,css,js,json,yaml,yml,xml]
Can be used multiple times: -e rs,toml -e md,json
-f, --format <FORMAT>
Output format [default: plain-text] [possible values: plain-text, markdown, json]
-h, --help
Print help information
-o, --output <OUTPUT>
Output file path [default: result.txt]
-p, --preview
Preview mode: only show the list of files to be processed, do not merge
-v, --verbose...
Increase verbosity (use multiple times for more detail)
-v: warning level -vv: info level -vvv: debug level -vvvv: trace level
-V, --version
Print version information
--strict-case
Perform strict case-sensitive matching on file extensions
--max-file-size <MAX_FILE_SIZE>
Maximum file size limit (KB, 0 means no limit) [default: 0]
--follow-links
Follow symbolic links
--allow-hex <ALLOW_HEX> [Optional feature]
Convert binary files to hexadecimal strings (value indicates max length per line, 0 means no limit)
File Encoding Issues
Warning: File is not UTF-8 encoded
This warning indicates the file may contain non-text content or use a different encoding. Use the --allow-hex feature to handle such files.
File Size Limits
Use the --max-file-size parameter to limit the maximum file size processed, avoiding overly large files.
Permission Issues Ensure you have appropriate read permissions for the directories and files you want to read.
Use different levels of the -v flag for more debugging information:
# View detailed processing steps
me . -vvv
# View the most detailed trace information (including file names and line numbers)
me . -vvvv
Contributions are welcome! Please follow these steps:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Tip: Use me --help to view the complete command-line options and usage instructions.