{"id":22399129,"url":"https://github.com/alfonsobries/llm-project-aggregator","last_synced_at":"2025-03-26T23:43:22.181Z","repository":{"id":265135258,"uuid":"895238090","full_name":"alfonsobries/llm-project-aggregator","owner":"alfonsobries","description":"Combine your project's code into one file for AI tools, excluding hidden and ignored files.","archived":false,"fork":false,"pushed_at":"2024-11-27T20:35:22.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T07:16:11.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/alfonsobries.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}},"created_at":"2024-11-27T20:24:05.000Z","updated_at":"2024-11-27T20:35:26.000Z","dependencies_parsed_at":"2024-11-27T21:30:25.215Z","dependency_job_id":"9011e5a4-b08b-4653-bc29-fa0dd729a083","html_url":"https://github.com/alfonsobries/llm-project-aggregator","commit_stats":null,"previous_names":["alfonsobries/llm-project-aggregator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfonsobries%2Fllm-project-aggregator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfonsobries%2Fllm-project-aggregator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfonsobries%2Fllm-project-aggregator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfonsobries%2Fllm-project-aggregator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfonsobries","download_url":"https://codeload.github.com/alfonsobries/llm-project-aggregator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245750697,"owners_count":20666217,"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":[],"created_at":"2024-12-05T07:13:39.914Z","updated_at":"2025-03-26T23:43:22.163Z","avatar_url":"https://github.com/alfonsobries.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Project Aggregator\n\n`project-aggregator.py` is a Python script that aggregates all the relevant files in your project into a single file, excluding hidden files, git-ignored files, and binary files. This aggregated file is ideal for sharing or feeding into an AI prompt.\n\n## Features\n\n- **Aggregates project files into one file**\n- **Excludes hidden, git-ignored, and binary files**\n- **Automatically generates an introduction and index**\n- **Ideal for AI analysis or code review**\n- **Allows specifying output file name and project directory**\n\n## Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/alfonsobries/llm-project-aggregator.git\n```\n\nNavigate to the directory:\n\n```bash\ncd llm-project-aggregator\n```\n\nMake the script executable (optional):\n\n```bash\nchmod +x project-aggregator.py\n```\n\n## Usage\n\nRun the script from any directory, specifying the project directory and output file if needed:\n\n```bash\npython project-aggregator.py -d /path/to/project -o /path/to/output.txt\n```\n\nOr if you made it executable:\n\n```bash\n./project-aggregator.py -d /path/to/project -o /path/to/output.txt\n```\n\n### Options\n\n- `-d`, `--directory`: The directory of the project to aggregate. Defaults to the current directory.\n- `-o`, `--output`: The output file path and name. Defaults to `aggregated_project.txt` in the current directory.\n\n### Examples\n\n- **Aggregate the current directory and use the default output file:**\n\n```bash\npython project-aggregator.py\n```\n\n- **Specify a project directory and output file:**\n\n```bash\npython project-aggregator.py -d /path/to/project -o /path/to/output.txt\n```\n\n- **Using the script as a global command:**\n\n```bash\nproject-aggregator -d /path/to/project -o /path/to/output.txt\n```\n\n## Output\n\nThe `aggregated_project.txt` file (or the specified output file) will have the following structure:\n\n- **Introduction:** Brief description and instructions.\n- **Index:** Numbered list of all included files.\n- **File Contents:** Each file's content separated by clear headers.\n\n### Example Output Structure\n\n```\nIntroduction:\nThis file contains the aggregated content of the project files.\nPlease review the code and provide any suggestions for improvement.\n\nIndex:\n1. main.py\n2. utils/helpers.py\n3. README.md\n\n==================================================\n=== 1. main.py ===\n==================================================\n\n# Contents of main.py\n\n==================================================\n=== 2. utils/helpers.py ===\n==================================================\n\n# Contents of helpers.py\n\n...\n```\n\n## Adding as a Global Command\n\nTo use `project-aggregator.py` as a global command:\n\n1. **Move the script to a directory in your PATH:**\n\nFor Unix/Linux systems, you can move the script to `/usr/local/bin`:\n\n```bash\nsudo mv project-aggregator.py /usr/local/bin/project-aggregator\n```\n\n2. **Ensure it has execute permissions:**\n\n```bash\nsudo chmod +x /usr/local/bin/project-aggregator\n```\n\n3. **Run from anywhere:**\n\nNow you can run the script from any directory:\n\n```bash\nproject-aggregator -d /path/to/project -o /path/to/output.txt\n```\n\n## How It Works\n\n- **File Selection:**\n  - Uses `git ls-files` to get a list of tracked and unignored files in the specified directory.\n  - Skips hidden files and directories (those starting with `.`).\n  - Excludes binary files based on MIME type detection.\n\n- **Content Aggregation:**\n  - Reads each file's content using UTF-8 encoding.\n  - Collects file paths and contents for index and aggregation.\n\n- **Output Generation:**\n  - Writes an introduction and index at the beginning of the output file.\n  - Separates each file's content with clear headers and separators.\n\n## Dependencies\n\n- **Python 3**\n- **Git**\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License\n\nThis project is in the public domain. Feel free to use it as you see fit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsobries%2Fllm-project-aggregator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfonsobries%2Fllm-project-aggregator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfonsobries%2Fllm-project-aggregator/lists"}