{"id":21183123,"url":"https://github.com/samkg/repocat","last_synced_at":"2025-10-26T02:16:00.692Z","repository":{"id":252332733,"uuid":"840127248","full_name":"SamKG/repocat","owner":"SamKG","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-19T17:27:28.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T11:05:42.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/SamKG.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-08-09T03:10:07.000Z","updated_at":"2025-03-23T16:35:56.000Z","dependencies_parsed_at":"2025-02-19T18:26:21.428Z","dependency_job_id":"87510af0-d3fc-480e-8034-d17f6f8ef273","html_url":"https://github.com/SamKG/repocat","commit_stats":null,"previous_names":["samkg/repocat"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/SamKG/repocat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2Frepocat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2Frepocat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2Frepocat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2Frepocat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamKG","download_url":"https://codeload.github.com/SamKG/repocat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2Frepocat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263889805,"owners_count":23525616,"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-11-20T17:59:18.464Z","updated_at":"2025-10-26T02:15:55.673Z","avatar_url":"https://github.com/SamKG.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# REPOCAT 🐯\n[![Crates.io][crates-badge]][crates-url]\n\n[crates-badge]: https://img.shields.io/crates/v/repocat.svg\n[crates-url]: https://crates.io/crates/repocat\n\nA simple CLI tool that accepts either:\n1. A GitHub repository URL\n2. A local folder path\n\nand concatenates all text/code files into a single string output. This can be useful for providing context to LLMs or other tools that need a single “flattened” representation of your codebase.\n\n## Features\n\n- **Configurable Include/Exclude**: Specify which file types to include or exclude using glob patterns.\n- **Automatic Ignore**: By default, `repocat` respects `.gitignore` and other ignore files (unless you disable it).\n- **GitHub Repo Cloning**: Automatically clones a GitHub repository and concatenates matching files.\n- **Checkout Specific Branch/Commit/Tag** (via `--checkout`).\n- **Preserve or Strip Blank Lines** (via `--keep-blank-lines`).\n- **Optionally Disable Ignore Rules** (via `--no-ignore`).\n\n## Installation\n\nIf you have Rust (and Cargo) installed:\n\n```bash\ncargo install repocat\n```\n\nAlternatively, clone this repository and run:\n\n```bash\ncargo build --release\n```\n\nYour compiled binary will be in the `target/release` directory.\n\nYou may also use the pre-compiled binaries offered in the Release, though support for different platforms may be limited.\n\n## Usage Examples\n\n### 1. Local Folder Input\n\n```bash\nrepocat --root /path/to/my-project\n```\n\n- This will walk the `my-project` folder, respecting `.gitignore` by default.\n- Includes files matching `*.toml, *.md, *.py, *.rs, *.cpp, *.h, *.hpp, *.c, *.rst, *.txt, *.cuh, *.cu`.\n- Writes all content into `concatenated_output.txt`.\n- By default, root is `.`\n\n### 2. GitHub Repository\n\n```bash\nrepocat --root https://github.com/owner/repo\n```\n\n- Clones `repo` from GitHub into a temporary folder.\n- By default, it checks out the default branch (e.g., `main` or `master`).\n- Gathers all matching files and writes them to `concatenated_output.txt`.\n\n### 3. Checking Out a Specific Branch or Commit\n\n```bash\nrepocat --root https://github.com/owner/repo --checkout feature-branch\n```\n\n```bash\nrepocat --root https://github.com/owner/repo --checkout abcd1234\n```\n\n- Clones the specified repository, then checks out either a branch named `feature-branch` or the commit `abcd1234`.\n- Proceeds to gather and concatenate files as usual.\n\n### 4. Including and Excluding Specific File Types\n\n```bash\nrepocat \\\n  --root /path/to/my-project \\\n  --include \"*.rs,*.toml\" \\\n  --exclude \"*.lock,*.bak\"\n```\n\n- Only gathers `.rs` and `.toml` files, while excluding anything ending with `.lock` or `.bak`.\n\n### 5. Preserving Blank Lines\n\nBy default, repocat removes blank lines for more compact output. If you want to preserve them:\n\n```bash\nrepocat --root /path/to/my-project --keep-blank-lines\n```\n\n- This keeps the blank lines in your final concatenated output.\n\n### 6. Disabling Ignore Logic\n\nIf you want to include hidden and/or binary files, you can disable all ignore logic:\n\n```bash\nrepocat --root /path/to/my-project --no-ignore\n```\n\n- This will cause repocat to walk the folder without ignoring anything.\n- **Warning**: This may significantly increase the size of your output if your project has large binary files or directories like `.git`.\n\n## Additional Info\n\n- `repocat` uses the [ignore crate](https://github.com/BurntSushi/ripgrep) by default, which means it respects `.gitignore`, `.ignore`, and `.rgignore` files, along with hidden file filtering and binary file detection.\n- The default list of “included” file extensions can be found in `src/lib.rs`, but can be overridden via the `--include` and `--exclude` flags.\n- If you prefer to keep blank lines in your concatenated output, use `--keep-blank-lines`. Otherwise, empty lines are removed.\n\n## Roadmap / Future Enhancements\n\n- **JSON Output**: A possible future feature to output file metadata and content in a structured JSON format.\n- **Partial Extraction**: Extract only certain lines or only lines matching a pattern.\n- **Parallel Processing**: Speed up concatenation by reading files in parallel.\n\n---\n\n*Thanks for checking out repocat! Feel free to open an issue or pull request if you have suggestions or encounter any problems.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkg%2Frepocat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamkg%2Frepocat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkg%2Frepocat/lists"}