{"id":25511241,"url":"https://github.com/hathibelagal-dev/git2string","last_synced_at":"2026-02-12T21:30:58.480Z","repository":{"id":278291362,"uuid":"935046245","full_name":"hathibelagal-dev/git2string","owner":"hathibelagal-dev","description":"Converts an entire Git repository to a string that can be fed to any large language model (LLM).","archived":false,"fork":false,"pushed_at":"2025-03-15T11:55:40.000Z","size":2124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T08:36:53.248Z","etag":null,"topics":["ai","artificial-intelligence","chatbot","developer-tools","devtools","gemini","llama","llm","mistral","openai","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hathibelagal-dev.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-02-18T20:19:07.000Z","updated_at":"2025-03-15T11:55:43.000Z","dependencies_parsed_at":"2025-02-19T02:22:29.116Z","dependency_job_id":"daba405d-030c-4a57-9376-4f463dcf571b","html_url":"https://github.com/hathibelagal-dev/git2string","commit_stats":null,"previous_names":["hathibelagal-dev/git2string","hathibelagal-dev/repo-to-prompt","hathibelagal-dev/repo2prompt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hathibelagal-dev/git2string","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fgit2string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fgit2string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fgit2string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fgit2string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hathibelagal-dev","download_url":"https://codeload.github.com/hathibelagal-dev/git2string/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fgit2string/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29381746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ai","artificial-intelligence","chatbot","developer-tools","devtools","gemini","llama","llm","mistral","openai","python"],"created_at":"2025-02-19T10:30:14.427Z","updated_at":"2026-02-12T21:30:58.464Z","avatar_url":"https://github.com/hathibelagal-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git2string\n[![PyPI - Version](https://img.shields.io/pypi/v/git2string)](https://pypi.org/project/git2string/) ![PyPI - License](https://img.shields.io/pypi/l/git2string)\n\n\u003cdiv style=\"text-align: center;\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/hathibelagal-dev/git2string/refs/heads/main/assets/git2string.png\" style=\"width:256px\"/\u003e\n\u003c/div\u003e\n\ngit2string is a powerful tool that simplifies the process of converting an entire Git repository into a single LLM-friendly text file, which is easy to upload. It also tells you how many tokens the text file will consume. So, it will hopefully be saving you a lot of time and effort.\n\nIt will automatically ignore all binary files. Additionally, it will respect your **.gitignore**. You can also create a **.r2pignore** file in your repo to specify the files that should be skipped for prompt generation.\n\n## Installation\n\n```\npip3 install git2string\n```\n\n## Usage\n\n```\ngit2string \u003curl of repository\u003e\n```\n\nFor example:\n\n```\ngit2string https://github.com/mozilla/experimenter\n```\n\nThe output would look like this:\n\n```\nℹ Cloning repository to ./tmpohen963u\n✔ Using tokenizer for model gpt2\nConcatenating: 100%|██████████████████████| 3331/3331 [00:00\u003c00:00, 7547.49it/s]\n✔ All valid files have been concatenated into llm_prompt.txt\nℹ 21334492 tokens are present in the prompt\n```\n\nIf you have cloned your desired repository already, you can just specify its path.\n\n```\ngit2string \u003crepo root directory\u003e\n```\n\nBy default, the prompt will be generated in a file called **llm_prompt.txt**. You can specify a different filename as follows:\n\n```\ngit2string \u003crepo root directory\u003e --output-file \u003cfilename\u003e\n```\n\nThis tool uses OpenAI's tiktoken to count the number of tokens in the generated prompt. By default, gpt2's tokenizer will be used. But you can count tokens for most OpenAI models.\n\n```\ngit2string \u003crepo root directory\u003e --openai-model \u003cmodel name\u003e\n```\n\nFor example:\n\n```\ngit2string /tmp/myrepo --openai-model gpt-4o\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhathibelagal-dev%2Fgit2string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhathibelagal-dev%2Fgit2string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhathibelagal-dev%2Fgit2string/lists"}