搜索

PythonReactSEOPDF
GitHub Skill

gitingest

Convert any Git repository into a text file optimized for LLM consumption using GitIngest. Use when the user wants to ingest a repo, create a text digest of a codebase, prepare a repository for LLM analysis, or needs to convert a GitHub URL to a readable text file.

jbdamask☆ 2 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

GitIngest

Convert any Git repository into a prompt-friendly text file for LLM consumption. GitIngest extracts the structure and contents of a repository into a single text file that can be easily processed by language models.

When to Use

  • User wants to analyze an entire codebase with an LLM
  • User needs a text representation of a repository
  • User mentions "ingest", "digest", or converting a repo to text
  • User wants to prepare code for LLM context

Required Package

This skill requires the gitingest Python package.

Workflow

1. Check if GitIngest is Available

First, check if gitingest is already installed and accessible:

which gitingest || echo "NOT_FOUND"

Also check common venv locations:

ls ~/.venvs/gitingest/bin/gitingest 2>/dev/null || echo "NOT_IN_VENVS"
2. If Not Installed, Ask User

If gitingest is not found, ask the user how they'd like to install it:

Ask: "The gitingest package is required but not installed. How would you like to install it?"

Options:

  • Specify path - User provides path to existing venv or installation
  • Create a venv for me - Convenience option: look up the venv-manager skill and follow its conventions

If user chooses the convenience option:

  1. Look for a venv-manager skill by name/description
  2. If found, follow its conventions to create the venv and install the package
  3. If NOT found, inform the user: "The venv-manager skill isn't available. Would you like to specify a path manually, or should I create a venv at ~/.venvs/gitingest/?"
3. Identify the Target

Once gitingest is available, determine what the user wants to ingest:

  • Local directory: A path on the filesystem
  • GitHub URL: A repository URL like https://github.com/owner/repo
  • Current directory: If unspecified, confirm with user
4. Run GitIngest

Run gitingest using the path determined in steps 1-2. Examples use <gitingest> as placeholder for the actual path:

For a local directory:

<gitingest> /path/to/repository -o output.txt

For a GitHub repository:

<gitingest> https://github.com/owner/repo -o output.txt

For the current directory:

<gitingest> . -o output.txt
5. Common Options
Option Description
-o <file> Output to specified file (use - for stdout)
-t <token> GitHub token for private repos
--include-gitignored Include files normally ignored by .gitignore
--include-submodules Process git submodules

Private repositories: If the user needs to ingest a private repo, they must provide a GitHub token:

<gitingest> https://github.com/owner/private-repo -t <GITHUB_TOKEN> -o output.txt

Or set the environment variable:

export GITHUB_TOKEN=<token>
<gitingest> https://github.com/owner/private-repo -o output.txt
6. Output

GitIngest produces a text file containing:

  • Repository structure (directory tree)
  • File contents with clear delimiters
  • Token count estimate (useful for LLM context limits)

After running, confirm success and report:

  • Output file location
  • Approximate size/token count if available
  • Any warnings or skipped files

Tips

  • Output files can be large for big repositories - warn user about potential size
  • Token counts help users understand if the output will fit in LLM context windows
  • For very large repos, consider suggesting the user focus on specific subdirectories
  • The output is optimized for LLM consumption but is also human-readable

Reference

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-31
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!