Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

D.CH.F.C. - Display Children Files Content

Go Reference GitHub Release CI Status Go Version License: MIT

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).

Installation

Via Go

go install github.com/denis1836/dchfc@latest

Building from Source

git clone https://github.com/denis1836/dchfc.git
cd dchfc
go build -ldflags="-s -w" -o dchfc

Pre-built Binaries

Download compiled binaries for Linux, macOS, and Windows directly from the Releases page.

Usage

dchfc [FLAGS] [DIRECTORY]

If no directory is provided, dchfc defaults to scanning the current working directory.

Flags and Options

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

Safety Features

dchfc includes default safety measures to prevent leaking secrets and flooding terminal sessions with binary junk:

  1. 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-secret to unmask.
  2. Binary Detection: Binary files are skipped and replaced with [Binary File] unless --allow-binary is explicitly set.
  3. Hidden Directories: Hidden directories are ignored by default.

Examples

Dump Go and Rust source files from src:

dchfc -e go,rs src

Output 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

License

MIT

About

Display Children Files Content

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages