Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:23:11 +08:00
commit d36eeec1dc
7 changed files with 678 additions and 0 deletions

39
commands/concat.md Normal file
View File

@@ -0,0 +1,39 @@
---
description: Concatenate files matching glob patterns
argument-hint: patterns
---
Concatenate files matching PATTERNS to output file with separators.
## Usage
```bash
concat-glob-tool PATTERNS... --output-file FILE [OPTIONS]
```
## Arguments
- `PATTERNS...`: Glob patterns (e.g., `*.py`, `src/**/*.md`)
- `-o, --output-file FILE`: Output file path (required)
- `--separator TEXT`: Separator text (default: `---`)
- `-n, --dry-run`: Preview (default, enabled)
- `--no-dry-run`: Execute concatenation
- `-f, --force`: Overwrite existing file
- `-v/-vv/-vvv`: Verbosity (INFO/DEBUG/TRACE)
## Examples
```bash
# Preview concatenation (dry-run)
concat-glob-tool '*.py' -o output.txt
# Execute concatenation
concat-glob-tool '*.py' '*.md' -o output.txt --no-dry-run
# Custom separator
concat-glob-tool '*.py' -o output.txt --separator '===' --no-dry-run
```
## Output
Files concatenated with format: `\n---\n# FILENAME\n---\n`

34
commands/help.md Normal file
View File

@@ -0,0 +1,34 @@
---
description: Show help and examples
argument-hint: --help
---
Display help information with examples.
## Usage
```bash
concat-glob-tool --help
concat-glob-tool --version
```
## Examples
```bash
# Show full help
concat-glob-tool --help
# Show version
concat-glob-tool --version
# Verbose help with examples
concat-glob-tool --help | less
```
## Output
Comprehensive help with:
- Command syntax
- All options and flags
- Working examples
- Output format description

37
commands/stdin.md Normal file
View File

@@ -0,0 +1,37 @@
---
description: Concatenate files from stdin input
argument-hint: --stdin
---
Read file paths from stdin and concatenate them.
## Usage
```bash
find ... | concat-glob-tool --stdin --output-file FILE [OPTIONS]
```
## Arguments
- `-s, --stdin`: Read paths from stdin (required)
- `-o, --output-file FILE`: Output file path (required)
- `--separator TEXT`: Separator text (default: `---`)
- `--no-dry-run`: Execute concatenation
- `-f, --force`: Overwrite existing file
## Examples
```bash
# From find command
find . -name '*.py' | concat-glob-tool --stdin -o output.txt --no-dry-run
# From fd command
fd -e py | concat-glob-tool --stdin -o output.txt --no-dry-run
# Filtered with grep
find . -name '*.py' | grep -v test | concat-glob-tool --stdin -o output.txt --no-dry-run
```
## Output
Files concatenated with separators including filenames.