ccode is a lightweight command-line tool for combining text files into a single output file.
It supports .ccodeignore rules (similar to .gitignore) to exclude files or directories,
and provides options for safe overwriting, dry-run previews, and stripping empty lines.
- 📂 Recursively collect and combine text files from a directory.
- 📝 Supports
.ccodeignorefiles for flexible file exclusion. - 🚀 CLI flags for customization:
--force– overwrite output if it already exists.--dry-run– preview which files would be combined without writing output.--strip-empty– remove empty lines from file contents.--output, -o– specify output file path (default:combined.txt).
- 🔍 Marks empty files with
[empty file]. - 🧪 Tested with unit and integration tests.
- 📦 Prebuilt binaries for Linux, macOS, and Windows (via GitHub Releases).
go install github.com/x45iq/ccode@latestgit clone https://github.com/x45iq/ccode.git
cd ccode
make build
./bin/ccode --helpDownload the latest release from the Releases page.
Combine all text files in the current directory into combined.txt:
ccodeSpecify a custom output file:
ccode --output myfiles.txtPreview without writing output:
ccode --dry-runForce overwrite if output already exists:
ccode --force --output result.txtRemove empty lines from files:
ccode --strip-emptyYou can exclude files and directories using .ccodeignore files placed anywhere in your project.
The syntax follows .gitignore conventions:
# Ignore all log files
*.log
# Ignore a specific file
secret.txt
# Keep a file explicitly
!keep.txt
# Ignore files in a subdirectory
subdir/*.tmp
Run linting, tests, and build:
make lint
make test
make buildClean build artifacts:
make cleanUnlicense license – see LICENSE.