{"id":48571584,"url":"https://github.com/mkopa/dp","last_synced_at":"2026-04-08T14:33:50.026Z","repository":{"id":300595552,"uuid":"1006584011","full_name":"mkopa/dp","owner":"mkopa","description":"DirPacker is a cross-platform command-line utility written in C++ for serializing the contents of a directory into a single archive file","archived":false,"fork":false,"pushed_at":"2025-10-18T09:25:13.000Z","size":13598,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-19T05:53:02.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkopa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-22T15:33:07.000Z","updated_at":"2025-10-18T09:25:18.000Z","dependencies_parsed_at":"2025-06-22T16:45:17.668Z","dependency_job_id":null,"html_url":"https://github.com/mkopa/dp","commit_stats":null,"previous_names":["mkopa/dp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mkopa/dp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopa%2Fdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopa%2Fdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopa%2Fdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopa%2Fdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkopa","download_url":"https://codeload.github.com/mkopa/dp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopa%2Fdp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31559930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-08T14:33:49.922Z","updated_at":"2026-04-08T14:33:50.006Z","avatar_url":"https://github.com/mkopa.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dirpacker\n\n\u003e **dirpacker** — Lightweight, text-based directory archiver with zero external dependencies.\n\n`dirpacker` is a minimal tool that serializes an entire directory into a single, human-readable text stream. Perfect for:\n- Sharing project structure with AI assistants (e.g. LLMs)\n- Archiving codebases without binary formats\n- Debugging or auditing file inclusions/exclusions\n- Secure, transparent packaging (no compression, no hidden data)\n\nAll files are wrapped in clear markers, and binary files are Base64-encoded. Rules from `.dpignore` (like `.gitignore`) control what's included.\n\n## ✨ Features\n\n- ✅ **Text-only output** — safe for AI, logs, diffs\n- ✅ **Binary file support** via custom Base64 encoding\n- ✅ **SHA256/SHA3 hashing** — built-in implementations\n- ✅ **`.dpignore` support** — ignore files/dirs like `.gitignore`\n- ✅ **Filter by type**: `--text-only` skips binaries\n- ✅ **Limit by size**: `-l 100k` skips large files\n- ✅ **Dry-run \u0026 stats**: preview what would be packed\n- ✅ **Cross-platform**: Linux, macOS, Windows (MSVC/MinGW)\n\n## 🛠️ Build Instructions\n\n`dirpacker` uses **CMake** — modern, portable, and dependency-free.\n\n### Prerequisites\n\n- **C++17 compiler** (GCC 8+, Clang 7+, MSVC 19.14+)\n- **CMake** (v3.15+)\n- **Git** (to clone)\n\n### 🐧 Linux \u0026 🍎 macOS\n\n```bash\n# Clone the repo\ngit clone https://github.com/mkopa/dp.git\ncd dp\n\n# Build\n./build.sh\n\n# Run\n./build/dirpacker --help\n```\n\n### 💻 Windows\n\n#### Option 1: MSYS2 / MinGW-w64 (Recommended)\n\n```bash\n# Install MSYS2 from https://www.msys2.org/\n# Open \"MSYS2 MinGW 64-bit\"\n\n# Install tools\npacman -Syu\npacman -S git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja\n\n# Build\ngit clone https://github.com/mkopa/dp.git\ncd dp\n./build.sh\n\n# Run\n./build/dirpacker.exe --help\n```\n\n#### Option 2: Visual Studio (MSVC)\n\n```cmd\nREM Open x64 Native Tools Command Prompt\ngit clone https://github.com/mkopa/dp.git\ncd dp\n\nREM Build\nbuild.bat\n\nREM Run\nbuild\\Release\\dirpacker.exe --help\n```\n\n## 🧰 Usage\n\n```bash\ndirpacker -d \u003cDIRECTORY\u003e [OPTIONS]\n```\n\n### Required\n- `-d, --dir DIR` — input directory to pack\n\n### Optional\n- `-o, --out FILE` — output file (default: stdout)\n- `-a, --algorithm ALGO` — hash algorithm: `sha256` (default), `sha3`\n- `-t, --text-only` — skip binary files\n- `-l, --limit SIZE` — skip files larger than SIZE (e.g. `100k`, `1m`, `512b`)\n- `--dry-run` — simulate without writing\n- `--stats` — show summary after completion\n- `--verbose` — detailed processing logs\n- `-v, --version` — show version\n- `-h, --help` — show help\n\n### Examples\n\n```bash\n# Pack current dir to stdout\ndirpacker -d .\n\n# Save to file with SHA3\ndirpacker -d . -a sha3 -o project.pack\n\n# Pipe to another tool\ndirpacker -d src -l 100k | wc -c\n\n# Dry run with stats\ndirpacker -d . --dry-run --stats\n\n# Only text files, max 50KB\ndirpacker -d . -t -l 50k -o code_text.pack\n```\n\n## 📝 `.dpignore`\n\nPlace a `.dpignore` file in your input directory to exclude files. Syntax is `.gitignore`-like:\n\n```gitignore\n# Comments\n*.log\n*.tmp\nbuild/\ndist/\nnode_modules/\n*.exe\n*.dll\n\n# Exceptions\n!important.txt\n!docs/README.md\n```\n\nRules are matched recursively. Paths are normalized to forward slashes (`/`).\n\n\u003e 💡 Tip: Use `--dry-run --stats` to verify what will be included.\n\n## 📦 Output Format\n\nEach file is wrapped like this:\n\n```\n--- START TEXT FILE path: \"path/to/file.txt\" size: 1234 bytes sha3: 9dc2f59f074cf22b14bab8cb45b841cd5cc34b9e08387a0532c4c463dc310df5 ---\n(file content here)\n--- END OF FILE ---\n```\n\nor for binaries:\n\n```\n--- START BINARY FILE path: \"image.png\" size: 5678 bytes sha3: 11548bb468eb66240a65e670e0d75c4e357409eafb57d6e1436ba19a003c0507 ---\n(base64-encoded data)\n--- END OF FILE ---\n```\n\nThis makes parsing and debugging trivial.\n\n## 🏗️ Project Structure\n\n```\ndp/\n├── CMakeLists.txt          # Build configuration\n├── build.sh                # Linux/macOS build script\n├── build.bat               # Windows build script\n├── README.md               # This file\n├── .dpignore               # Ignore rules\n├── include/\n│   ├── dirpacker.hpp       # Main library interface\n│   ├── sha256.hpp          # SHA256 implementation\n│   ├── sha3.hpp            # SHA3 implementation\n│   └── base64.hpp          # Base64 encoder/decoder\n└── src/\n    ├── main.cpp            # CLI application\n    ├── dirpacker.cpp       # Core packing logic\n    ├── sha256.cpp          # SHA256 implementation\n    ├── sha3.cpp            # SHA3 implementation\n    └── base64.cpp          # Base64 implementation\n```\n\n## 🔧 Technical Details\n\n### Hash Algorithms\n- **SHA256**: Secure Hash Algorithm 256-bit\n- **SHA3**: SHA-3 (Keccak) 256-bit variant\n\nBoth implementations are self-contained, no OpenSSL or external crypto libraries required.\n\n### Base64 Encoding\nCustom, optimized Base64 encoder/decoder with:\n- RFC 4648 compliance\n- Efficient memory usage\n- Proper padding handling\n- Validation on decode\n\n### Binary Detection\nFiles are checked for null bytes (`\\0`) in the first 8KB to determine if they're binary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkopa%2Fdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkopa%2Fdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkopa%2Fdp/lists"}