{"id":21508544,"url":"https://github.com/addyosmani/git2txt","last_synced_at":"2025-04-08T12:13:00.014Z","repository":{"id":264111158,"uuid":"891790346","full_name":"addyosmani/git2txt","owner":"addyosmani","description":"CLI tool to convert GitHub repositories to text files for LLMs","archived":false,"fork":false,"pushed_at":"2024-11-22T03:20:51.000Z","size":110,"stargazers_count":473,"open_issues_count":11,"forks_count":45,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-01T11:06:06.137Z","etag":null,"topics":["cli","convert","git","github","llm","repository","text"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/addyosmani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-11-21T00:41:06.000Z","updated_at":"2025-03-29T04:08:17.000Z","dependencies_parsed_at":"2024-11-22T04:30:38.666Z","dependency_job_id":null,"html_url":"https://github.com/addyosmani/git2txt","commit_stats":null,"previous_names":["addyosmani/git2txt"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addyosmani%2Fgit2txt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addyosmani%2Fgit2txt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addyosmani%2Fgit2txt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/addyosmani%2Fgit2txt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/addyosmani","download_url":"https://codeload.github.com/addyosmani/git2txt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838446,"owners_count":21004580,"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","convert","git","github","llm","repository","text"],"created_at":"2024-11-23T21:06:24.915Z","updated_at":"2025-04-08T12:12:59.994Z","avatar_url":"https://github.com/addyosmani.png","language":"JavaScript","readme":"# git2txt\n\nConvert GitHub repositories to text files with ease. This CLI tool downloads a repository and concatenates its contents into a single text file, making it perfect for analysis, documentation, or AI training purposes.\n\n![Screenshot](https://github.com/user-attachments/assets/846fcec4-5919-44c7-956d-ca0ee6384c77)\n\n## Features\n\n- 📥 Download any public GitHub repository\n- 📝 Convert repository contents to a single text file\n- ⚡ Automatic binary file exclusion\n- 🔧 Configurable file size threshold\n- 💻 Cross-platform support (Windows, macOS, Linux)\n\n## Installation\n\n```bash\nnpm install -g git2txt\n```\n\n## Usage\n\nYou can specify the repository in several formats:\n\n```bash\n# Full HTTPS URL\ngit2txt https://github.com/username/repository\n\n# Short format (username/repository)\ngit2txt username/repository\n\n# SSH format\ngit2txt git@github.com:username/repository\n```\n\n### URL Format Support\n\nThe tool accepts these GitHub repository URL formats:\n\n- HTTPS URLs: `https://github.com/username/repository`\n- Short format: `username/repository`\n- SSH URLs: `git@github.com:username/repository`\n- URLs with or without `.git` suffix\n- URLs with or without trailing slashes\n\n### Options\n\n```\n--output, -o     Specify output file path (default: repo-name.txt)\n--threshold, -t  Set file size threshold in MB (default: 0.1)\n--include-all    Include all files regardless of size or type\n--debug         Enable debug mode with verbose logging\n--help          Show help\n--version       Show version\n```\n\n### Examples\n\nDownload and convert a repository using different formats:\n```bash\n# Using HTTPS URL\ngit2txt https://github.com/username/repository\n\n# Using short format\ngit2txt username/repository\n\n# Using SSH URL\ngit2txt git@github.com:username/repository\n\n# With custom output file\ngit2txt username/repository --output=output.txt\n\n# With custom file size threshold (2MB)\ngit2txt username/repository --threshold=2\n\n# Include all files (no size/type filtering)\ngit2txt username/repository --include-all\n\n# Enable debug output\ngit2txt username/repository --debug\n```\n\n## Default Behavior\n\n- Files larger than 100KB are excluded by default\n- Binary files are automatically excluded\n- The output file is created in the current directory named after the repository\n- Files are processed recursively through all subdirectories (excluding node_modules and .git)\n- File paths and contents are separated by clear markers\n- Relative paths are preserved in the output\n\n## Output Format\n\nThe tool generates a text file with this format:\n\n```\n================================================================================\nFile: path/to/file.txt\nSize: 1.2 KB\n================================================================================\n\n[File contents here]\n\n================================================================================\nFile: another/file.js\nSize: 4.5 KB\n================================================================================\n\n[File contents here]\n```\n\n## Contributing\n\nContributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddyosmani%2Fgit2txt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddyosmani%2Fgit2txt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddyosmani%2Fgit2txt/lists"}