{"id":27149163,"url":"https://github.com/bethropolis/dir-dumper","last_synced_at":"2025-07-19T14:34:34.109Z","repository":{"id":286478071,"uuid":"961524198","full_name":"bethropolis/dir-dumper","owner":"bethropolis","description":"A command-line utility to aggregate the content of files within a directory tree into a single file.","archived":false,"fork":false,"pushed_at":"2025-04-06T23:18:59.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T04:42:45.275Z","etag":null,"topics":["cli","code-context","command-line-tool","content-aggregator","go","golang","llm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bethropolis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-04-06T17:37:00.000Z","updated_at":"2025-06-03T21:58:30.000Z","dependencies_parsed_at":"2025-04-10T01:33:41.918Z","dependency_job_id":null,"html_url":"https://github.com/bethropolis/dir-dumper","commit_stats":null,"previous_names":["bethropolis/dir-dumper"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/bethropolis/dir-dumper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2Fdir-dumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2Fdir-dumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2Fdir-dumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2Fdir-dumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bethropolis","download_url":"https://codeload.github.com/bethropolis/dir-dumper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethropolis%2Fdir-dumper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265947507,"owners_count":23853382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","code-context","command-line-tool","content-aggregator","go","golang","llm"],"created_at":"2025-04-08T12:36:12.302Z","updated_at":"2025-07-19T14:34:34.073Z","avatar_url":"https://github.com/bethropolis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dir-Dumper\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/bethropolis/dir-dumper)](https://goreportcard.com/report/github.com/bethropolis/dir-dumper)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bethropolis/dir-dumper?style=flat-square\u0026labelColor=1e1e2e\u0026color=89b4fa)](https://github.com/bethropolis/dir-dumper/releases/latest)\n[![GitHub license](https://img.shields.io/github/license/bethropolis/dir-dumper?style=flat-square\u0026labelColor=1e1e2e\u0026color=cba6f7)](https://github.com/bethropolis/dir-dumper/blob/main/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/bethropolis/dir-dumper.svg)](https://pkg.go.dev/github.com/bethropolis/dir-dumper/) \n[![GitHub stars](https://img.shields.io/github/stars/bethropolis/dir-dumper?style=flat-square\u0026labelColor=1e1e2e\u0026color=f9e2af)](https://github.com/bethropolis/dir-dumper/stargazers)\n[![GitHub issues](https://img.shields.io/github/issues/bethropolis/dir-dumper?style=flat-square\u0026labelColor=1e1e2e\u0026color=f38ba8)](https://github.com/bethropolis/dir-dumper/issues)\n[![Go Version](https://img.shields.io/badge/Go-1.21+-a6e3a1?style=flat-square\u0026logo=go\u0026labelColor=1e1e2e)](https://golang.org/doc/go1.21)\n\n\n`dir-dumper` is a command-line tool written in Go that recursively traverses a directory, reads the content of non-ignored files, and prints them to standard output or a specified file. It respects `.gitignore` rules, hidden file conventions, and provides various filtering and formatting options.\n\nThe primary goal is to easily aggregate the content of a project's codebase or configuration files into a single block of text, useful for sharing context, documentation, or feeding into other tools (like Large Language Models).\n\n## Features\n\n*   **Recursive Traversal:** Scans directories and subdirectories.\n*   **.gitignore Aware:** Respects rules defined in `.gitignore` files found within the scanned directory tree.\n*   **Hidden File Handling:** Option to ignore or include hidden files and directories (those starting with `.`).\n*   **Filtering:**\n    *   Filter included files by extension (`-ext`).\n    *   Define custom ignore patterns (`-ignore`).\n    *   Set maximum file size limits (`-max-size`).\n*   **Output Formats:**\n    *   Standard plain text (default).\n    *   JSON output (`-json`).\n    *   Markdown output (`-markdown`).\n*   **Concurrency:** Optional parallel processing for faster scans (`-concurrent`).\n*   **Customizable:** Numerous flags to control behavior (see Usage).\n*   **Tracking:** Option to display a summary of skipped files and reasons (`-show-skipped`).\n*   **Progress:** Optional progress display for long scans (`-progress`).\n*   **Timeout:** Set a maximum execution time (`-timeout`).\n*   **Cross-Platform:** Built with Go, runs on Linux, macOS, and Windows.\n\n## Installation\n\n### Using `go install` (Recommended)\n\nIf you have Go (1.21+) installed and configured:\n\n```bash\ngo install github.com/bethropolis/dir-dumper/cmd/dir-dumper@latest\n```\n\n\u003e [!NOTE]\n\u003e This will download the source code, compile it, and place the `dir-dumper` binary in your `$GOPATH/bin` directory (usually `$HOME/go/bin`). Ensure this directory is in your system's `PATH`.\n\n### From Source\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/bethropolis/dir-dumper.git\n    cd dir-dumper\n    ```\n2.  **Build the binary:**\n    ```bash\n    go build -o dir-dumper ./cmd/dir-dumper/\n    ```\n3.  **(Optional) Move the binary to a directory in your PATH:**\n    ```bash\n    # Example: move to ~/.local/bin \n    mv dir-dumper ~/.local/bin/\n    ```\n\n\n## Usage\n\n```bash\ndir-dumper [flags]\n```\n\u003e [!NOTE]\n\u003e By default, `dir-dumper` scans the current directory (`.`) and prints the content of non-ignored files to standard output.\n\n\u003cdetails\u003e\n\u003csummary\u003eExamples\u003c/summary\u003e\n\n*   **Scan the current directory:**\n      ```bash\n      dir-dumper\n      ```\n*   **Scan a specific directory:**\n      ```bash\n      dir-dumper -dir /path/to/your/project\n      ```\n*   **Only include Go and Markdown files:**\n      ```bash\n      dir-dumper -ext go,md\n      ```\n*   **Ignore all `.log` files and the `dist/` directory, in addition to `.gitignore` rules:**\n      ```bash\n      dir-dumper -ignore \"*.log,dist/\"\n      ```\n*   **Include hidden files (usually ignored):**\n      ```bash\n      dir-dumper -hidden=false\n      ```\n*   **Output to a file:**\n      ```bash\n      dir-dumper -output project_dump.txt\n      ```\n*   **Output in JSON format:**\n      ```bash\n      dir-dumper -json -output dump.json\n      ```\n*   **Output in Markdown format:**\n      ```bash\n      dir-dumper -markdown -output dump.md\n      ```\n*   **Use concurrent processing and show progress:**\n      ```bash\n      dir-dumper -concurrent -progress\n      ```\n*   **Show skipped files at the end:**\n      ```bash\n      dir-dumper -show-skipped\n      ```\n*   **Set a 5-minute timeout:**\n      ```bash\n      dir-dumper -timeout 5m\n      ```\n*   **Combine multiple options:**\n      ```bash\n      dir-dumper -dir ../other-project -ext go,mod -ignore \"vendor/,*_test.go\" -concurrent -output ../dump.txt\n      ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFlags\u003c/summary\u003e\n\n```\nFlags:\n      -concurrent\n                        Enable concurrent file processing\n      -dir string\n                        The root directory to scan (default \".\")\n      -ext string\n                        Only include files with these extensions (comma-separated, e.g., 'go,md,txt')\n      -git\n                        Ignore .git directories (default true)\n      -hidden\n                        Ignore hidden files/directories (starting with '.') (default true)\n      -ignore string\n                        Custom ignore patterns (comma-separated, gitignore syntax)\n      -json\n                        Output results in JSON format\n      -log-level string\n                        Set the logging level (DEBUG, INFO, WARN, ERROR) (default \"INFO\")\n      -markdown\n                        Output results in Markdown format\n      -max-size int\n                        Max file size to process in MB (0 = no limit)\n      -no-color\n                        Disable color output\n      -output string\n                        Output to file instead of stdout\n      -progress\n                        Show progress information\n      -quiet\n                        Suppress INFO messages (only show WARN, ERROR)\n      -show-skipped\n                        Show a list of skipped files/directories and reasons at the end\n      -timeout duration\n                        Maximum execution time (e.g., '30s', '5m')\n      -verbose\n                        Enable verbose logging (DEBUG, WARN, ERROR)\n      -version\n                        Show version information\n      -workers int\n                        Max number of concurrent workers (defaults to number of CPU cores)\n```\n\n\u003c/details\u003e\n\n## Development\n\n### Prerequisites\n\n*   Go 1.21 or later\n\n### Building\n\n```bash\ngo build -o dir-dumper ./cmd/dir-dumper/\n```\n\n### Pre-built Binaries (Optional)\n\nPre-built binaries for Linux, macOS, and Windows are available on the [Releases](https://github.com/bethropolis/dir-dumper/releases) page.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethropolis%2Fdir-dumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbethropolis%2Fdir-dumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethropolis%2Fdir-dumper/lists"}