{"id":27488249,"url":"https://github.com/gs0ciety/dump-code","last_synced_at":"2026-04-19T14:02:43.472Z","repository":{"id":285634282,"uuid":"958825470","full_name":"gs0ciety/dump-code","owner":"gs0ciety","description":"A simple Bash script to export entire repositories into a single Markdown file. Perfect for summarizing codebases or feeding them into LLMs for analysis!","archived":false,"fork":false,"pushed_at":"2025-04-12T01:37:41.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T02:45:06.304Z","etag":null,"topics":["bash","cli-tool","code-analysis","developer-tools","documentation","linux","markdown","open-source","shell-script"],"latest_commit_sha":null,"homepage":"https://www.gsociety.com.ar","language":"Shell","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/gs0ciety.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,"zenodo":null}},"created_at":"2025-04-01T20:30:46.000Z","updated_at":"2025-04-12T01:37:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"24d41e0a-4d77-4465-8961-230b18ca567b","html_url":"https://github.com/gs0ciety/dump-code","commit_stats":null,"previous_names":["gs0ciety/dump-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs0ciety%2Fdump-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs0ciety%2Fdump-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs0ciety%2Fdump-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gs0ciety%2Fdump-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gs0ciety","download_url":"https://codeload.github.com/gs0ciety/dump-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249270210,"owners_count":21241291,"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":["bash","cli-tool","code-analysis","developer-tools","documentation","linux","markdown","open-source","shell-script"],"created_at":"2025-04-16T19:55:30.855Z","updated_at":"2026-04-19T14:02:38.448Z","avatar_url":"https://github.com/gs0ciety.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dump-code 📝\n\n\u003e A simple Bash script to export an entire repository's codebase into a single Markdown file. Ideal for feeding into language models (LLMs) for analysis, summarization, or processing.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS-blue)](https://shields.io/)\n[![Bash](https://img.shields.io/badge/Bash-%3E%3D%204.0-green)](https://www.gnu.org/software/bash/)\n\n## Features\n\n- 🔍 **Recursive Code Extraction:** Scans the provided repository directory recursively.\n- 🛡️ **Exclusion Filters:** Ignores specific files, directories, and file types.\n- 🔒 **Prevents Self-Inclusion:** Avoids infinite loops by skipping the output file if it's within the source directory.\n- 📄 **Flexible Output:** Generates the output file at a specified path or defaults to `dump.md` in the current working directory.\n\n## Installation\n\n### Using Make (Recommended)\nIf you have `make` installed, you can install **dump-code** system-wide by running:\n\n```bash\ngit clone https://github.com/gs0ciety/dump-code.git\ncd dump-code\nsudo make install\n```\n\nThis command copies the script to `/usr/local/bin/dump-code` and sets the proper executable permissions. **The `sudo` command is required** because writing to `/usr/local/bin/` requires superuser privileges.\n\n### Manual Installation\nIf you prefer not to use `make`, follow these steps:\n\n1. Clone the repository or download the `dump-code` script.\n2. Copy the script to a directory in your `PATH` (e.g., `/usr/local/bin/`):\n\n   ```bash\n   sudo cp bin/dump-code /usr/local/bin/dump-code\n   ```\n\n3. Make the script executable:\n\n   ```bash\n   sudo chmod +x /usr/local/bin/dump-code\n   ```\n\n## Usage\n\nThe **dump-code** command accepts the following parameters:\n\n```bash\ndump-code \u003csource_directory\u003e [output_file.md]\n```\n\n- `\u003csource_directory\u003e`: The directory containing the repository you want to export.\n- `[output_file.md]`: *(Optional)* The destination file for the output. If omitted, a file named `dump.md` will be created in the current working directory.\n\n### Examples\n\n- Export code to a custom output file:\n\n  ```bash\n  dump-code /path/to/repo /path/to/output/output.md\n  ```\n\n- Export code using the default output filename (`dump.md`):\n\n  ```bash\n  dump-code /path/to/repo\n  ```\n\n---\n\n## 🔨 Customizing Ignored Files, Directories, and Extensions\n\nBy default, the script ignores certain files, directories, and file extensions to avoid including unnecessary content in the Markdown export. You can **modify these lists directly within the script** by editing the following variables:\n\n### Ignored Files\nThese files will be skipped regardless of their location in the repository:\n\n```bash\nlocal ignore_files=(\"package-lock.json\" \"yarn.lock\" \".DS_Store\")\n```\n\nTo **add more files**, simply include them in the list:\n\n```bash\nlocal ignore_files=(\"package-lock.json\" \"yarn.lock\" \".DS_Store\" \"README.md\" \"LICENSE\")\n```\n\n---\n\n### Ignored Directories\nThese directories and their contents are ignored recursively:\n\n```bash\nlocal ignore_dirs=(\".git\" \"node_modules\" \"dist\" \"build\" \".next\" \".expo\" \"fonts\" \"docs\")\n```\n\nTo **add or remove directories**, edit this list. For example, to ignore `test` and `coverage` folders:\n\n```bash\nlocal ignore_dirs=(\".git\" \"node_modules\" \"dist\" \"build\" \".next\" \".expo\" \"fonts\" \"docs\" \"test\" \"coverage\")\n```\n\n---\n\n### Ignored Extensions\nThese file types will be excluded from the Markdown output:\n\n```bash\nlocal ignore_extensions=(\"png\" \"jpg\" \"jpeg\" \"gif\" \"svg\" \"ico\" \"webp\" \"bmp\" \"tiff\")\n```\n\nTo **add new extensions**, simply include them in the list. For example, to also ignore `.mp4` and `.zip` files:\n\n```bash\nlocal ignore_extensions=(\"png\" \"jpg\" \"jpeg\" \"gif\" \"svg\" \"ico\" \"webp\" \"bmp\" \"tiff\" \"mp4\" \"zip\")\n```\n\n---\n\n## How It Works\n\n- **Directory Scanning:** The script uses the `find` command to locate all files in the provided source directory.\n- **Exclusion Rules:** It filters out specific files, directories, and file types as defined above.\n- **Markdown Formatting:** For each file processed, the script adds a header with the file name and path, and wraps the file’s contents in Markdown code blocks.\n- **Self-Exclusion:** It checks and skips the output file if it resides within the source directory to avoid recursive inclusion.\n\n## Uninstallation\n\nIf you installed the script using the Makefile, you can remove it by running:\n\n```bash\nsudo make uninstall\n```\n\nThis command removes **dump-code** from `/usr/local/bin/dump-code`. **The `sudo` command is required** because removing a file from `/usr/local/bin/` requires superuser privileges.\n\n## Contributing\n\nContributions, improvements, and suggestions are welcome! To contribute:\n\n1. Fork this repository.\n2. Clone your forked repository.\n3. Create a new branch (`git checkout -b feature/YourFeature`).\n4. Commit your changes (`git commit -m 'Add new feature'`).\n5. Push to your branch (`git push origin feature/YourFeature`).\n6. Open a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contact\n\nFeel free to reach out via:\n\n- GitHub: [gs0ciety](https://github.com/gs0ciety)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs0ciety%2Fdump-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgs0ciety%2Fdump-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgs0ciety%2Fdump-code/lists"}