dchfc is a lightweight CLI tool designed to aggregate and print file contents across a directory tree.
Can be used to streamline feeding codebase context into LLMs (e.g. ChatGPT, Claude).
go install github.com/denis1836/dchfc@latestgit clone https://github.com/denis1836/dchfc.git
cd dchfc
go build -ldflags="-s -w" -o dchfcDownload compiled binaries for Linux, macOS, and Windows directly from the Releases page.
dchfc [FLAGS] [DIRECTORY]If no directory is provided, dchfc defaults to scanning the current working directory.
| Flag | Long Flag | Description |
|---|---|---|
-a |
--absolute |
Output absolute file paths |
-b |
--allow-binary |
Force reading binary files (masked by default) |
--allow-secret |
Force reading sensitive files/keys (masked by default) | |
-c |
--colored |
Enable ANSI output coloring for paths and XML tags |
-e |
--ext |
Filter by comma-separated extensions (e.g. go,rs or txt) |
-i |
--ignore |
Ignore specific files or directories (e.g. vendor,node_modules) |
--gitignore |
Respect rules from local .gitignore |
|
--xml |
Format output using XML tags (<file path="...">) |
|
-v |
--version |
Display current application version |
-h |
--help |
Display help message |
dchfc includes default safety measures to prevent leaking secrets and flooding terminal sessions with binary junk:
- Secret Detection: Files matching patterns like
.env, private SSH/TLS keys (.key,.pem,id_rsa), and service credentials (credentials.json,secrets.yaml) are automatically masked with[Secret File]. Requires--allow-secretto unmask. - Binary Detection: Binary files are skipped and replaced with
[Binary File]unless--allow-binaryis explicitly set. - Hidden Directories: Hidden directories are ignored by default.
Dump Go and Rust source files from src:
dchfc -e go,rs srcOutput XML format with ANSI colors according to .gitignore rules:
dchfc --xml -c --gitignore .Exclude specific directories:
dchfc -i node_modules,dist,tmp.txt ./my-app-project