{"id":20843842,"url":"https://github.com/tkc/llm-repository-loader","last_synced_at":"2026-05-03T18:35:54.027Z","repository":{"id":257444298,"uuid":"852746348","full_name":"tkc/llm-repository-loader","owner":"tkc","description":"LLM Repository Loader is a Go-based command-line tool that efficiently exports the structure and contents of local or remote GitHub repositories into a single text file, while honoring custom ignore patterns.","archived":false,"fork":false,"pushed_at":"2024-09-16T23:31:56.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T11:13:29.532Z","etag":null,"topics":["git","llm","loader","rag"],"latest_commit_sha":null,"homepage":"https://medium.com/@loosefingers/the-convenience-of-large-language-models-llms-in-code-analysis-using-chatgpt-o1-6b82e9767c09","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/tkc.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":"2024-09-05T10:57:41.000Z","updated_at":"2024-11-14T20:09:12.000Z","dependencies_parsed_at":"2024-09-16T20:20:26.346Z","dependency_job_id":"59c0414e-11cf-49b0-8529-87f856310241","html_url":"https://github.com/tkc/llm-repository-loader","commit_stats":null,"previous_names":["tkc/llm-repository-loader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tkc/llm-repository-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkc%2Fllm-repository-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkc%2Fllm-repository-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkc%2Fllm-repository-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkc%2Fllm-repository-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkc","download_url":"https://codeload.github.com/tkc/llm-repository-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkc%2Fllm-repository-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32580163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["git","llm","loader","rag"],"created_at":"2024-11-18T02:07:32.404Z","updated_at":"2026-05-03T18:35:54.011Z","avatar_url":"https://github.com/tkc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Repository Loader\n\nLLM Repository Loader is a command-line tool written in Go that reads a Git repository, applies an ignore list, and outputs the repository's file structure and contents to a specified text file. The tool allows you to either specify a local repository path or download a GitHub repository directly, then process the files in that repository. Files are ignored based on patterns specified in an ignore file (.loader_ignores), and the final output is written to a text file.\n\n## Features\n- Local and Remote Repositories: You can provide either a local path to a Git repository or download one directly from GitHub.\n- Custom Ignore List: You can specify files and directories to ignore by providing patterns in a .loader_ignores file.\n- File Processing: The tool processes each file in the repository and writes the contents to a specified output file, including file paths.\n- Support for Preamble: You can provide a preamble text file to be included at the beginning of the output.\n- Cross-platform: Supports both Windows and Unix-based systems.\n\n## Usage\n\nCommand-line Options\n\n- local_repo_path (Optional): The path to a local Git repository.\n- remote_repo (Optional): The path to a GitHub repository in the format user/repo_name. The repository will be downloaded and processed.\n\n## Examples\n\nProcessing a local repository:\n```go\ngo run main.go -local_repo_path /path/to/local/repository\n```\n\nDownloading and processing a GitHub repository:\n\n```go\ngo run main.go -remote_repo tkc/go_bedrock_proxy_server\n```\n\n## .loader_ignores File\nThe .loader_ignores file specifies patterns for files or directories that should be excluded from processing. The patterns follow standard glob-style matching.\n\n```lua\n*.log\noutput/\n.git/\n.idea/\n```\n\n## Output\n\n```txt\n\n----\ninternal/repository.go\npackage internal\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc ProcessRepository(repoPath string, ignoreList []string, outputFile *os.File) {\n\terr := filepath.Walk(repoPath, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif !info.IsDir() {\n\t\t\trelativeFilePath, err := filepath.Rel(repoPath, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !ShouldIgnore(relativeFilePath, ignoreList) {\n\t\t\t\tcontents, err := ioutil.ReadFile(path)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\t_, err = outputFile.WriteString(\"----\\n\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t_, err = outputFile.WriteString(fmt.Sprintf(\"%s\\n\", relativeFilePath))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t_, err = outputFile.WriteString(fmt.Sprintf(\"%s\\n\", contents))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tfmt.Printf(\"Error processing repository: %v\\n\", err)\n\t}\n}\n\n----\ninternal/utils.go\npackage internal\n\nimport (\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc IsWindows() bool {\n\treturn runtime.GOOS == \"windows\"\n}\n\nfunc ToWindowsPath(path string) string {\n\treturn strings.ReplaceAll(path, \"/\", \"\\\\\")\n}\n\n```\n\n\nIf a preamble is provided, it will be included at the beginning of the output file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkc%2Fllm-repository-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkc%2Fllm-repository-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkc%2Fllm-repository-loader/lists"}