Fast, AI-ready CLI tool that converts entire codebases into structured text files. Perfect for feeding projects to LLMs, code reviews, and documentation. Features streaming architecture, smart filtering, and cross-platform clipboard integration.
npm install git-ingest


A powerful CLI tool for analyzing and ingesting project codebases into structured text files with advanced gitignore support, binary file detection, and cross-platform clipboard integration.
``bashGlobal installation
npm install -g git-ingest
š Usage
$3
`bash
Analyze current directory
git-ingestAnalyze specific directory
git-ingest /path/to/projectCopy output to clipboard
git-ingest --copyVerbose output with progress
git-ingest --verboseQuiet mode
git-ingest --quiet
`$3
`bashCustom output filename (Markdown)
git-ingest --output my-project-analysis.mdGenerate classic text format output
git-ingest --format text --output analysis.txtInclude only specific file patterns
git-ingest --include ".js" ".ts" "*.json"Exclude specific patterns
git-ingest --exclude ".test.js" ".spec.js"Set maximum file size (in MB)
git-ingest --max-size 5Generate text format with custom output
git-ingest --format text --output analysis.txt
`$3
`bash
git-ingest [options] [directory]Arguments:
directory Target directory to analyze (default: "./")
Options:
-V, --version output the version number
-o, --output Specify output filename
-f, --format Output format: markdown or text (default: "markdown")
-c, --copy Copy output to clipboard
-i, --include Include files matching patterns
-e, --exclude Exclude files matching patterns
--max-size Maximum file size to include (in MB) (default: "10")
-v, --verbose Verbose output
-q, --quiet Quiet mode
-h, --help display help for command
`š Output Format
Git-Ingest supports two output formats optimized for different use cases. Markdown is now the default output format.
$3
The default output is a structured, semantic Markdown format designed for optimal AI/LLM processing:
`
git-ingest
`Features:
- šÆ LLM-Friendly Structure: Hierarchical organization with proper semantic markup
- š Language Detection: Automatic syntax highlighting for 60+ programming languages
- š Rich Metadata: File statistics, language distribution, and categorization
- š Table of Contents: Navigation-friendly structure with links
- š·ļø File Categorization: Organized by Web Frontend, Backend, DevOps, etc.
- š» Code Blocks: Proper syntax highlighting for better readability
- š Analytics: Comprehensive project statistics and insights
Example markdown output structure:
``markdown
š Project Analysis Report
š Project Overview
Language: javascript | Files: 25 | Size: 2.3 MB
š Statistics
$3
| Category | Files | Percentage |
| -------------- | ----- | ---------- |
| Web Frontend | 15 | 60.0% |
| Backend/Server | 8 | 32.0% |
$3
Path:
src/app.js
Size: 3.2 KB
Language: javascript (high confidence)
Category: Web Frontend`javascript
// Your code here with proper syntax highlighting
`
``$3
The classic plain text format with directory tree and file contents:
`bash
git-ingest --format text
`Example:
`
Directory structure for: /path/to/project
Generated on: 2024-01-15T10:30:00.000Z
Total items: 15āāā package.json
āāā README.md
āāā src/
ā āāā index.js
ā āāā utils/
ā āāā helpers.js
================================================
File: package.json
================================================
{
"name": "my-project",
"version": "1.0.0"
}
`š§ Development
$3
- Node.js 16+
- npm or yarn
$3
`bash
Clone the repository
git clone https://github.com/AungMyoKyaw/git-ingest.git
cd git-ingestInstall dependencies
npm installRun tests
npm testLint code
npm run lintFormat code
npm run format
`$3
`bash
Run all tests
npm testRun tests with coverage
npm run test:coverageRun tests in watch mode
npm run test:watch
`$3
`bash
Lint and format
npm run lint:fix
npm run formatTest before release
npm test
`š ļø Configuration
Git-Ingest respects standard
.gitignore files and includes sensible defaults:$3
- Generated output files (
git-ingest-.txt, git-ingest-.json)
- Version control (.git/)
- Dependencies (node_modules/, vendor/)
- Build directories (dist/, build/, out/)
- Binary files (images, videos, executables)
- IDE files (.vscode/, .idea/)
- OS files (.DS_Store, Thumbs.db)$3
Use include/exclude patterns to customize file selection:
`bash
Only include JavaScript and TypeScript files
git-ingest --include ".js" ".ts" ".jsx" ".tsx"Exclude test files
git-ingest --exclude ".test.js" ".spec.js" "__tests__/"Complex filtering
git-ingest --include "src/*" --exclude ".min.js" "*.bundle.js"
`š Use Cases
$3
Generate comprehensive project overviews for code reviews, sharing complete project context in a single document.
$3
Perfect for feeding entire codebases to AI tools like ChatGPT, Claude, or GitHub Copilot for analysis, documentation, or refactoring suggestions.
$3
Create snapshot documentation of project structure and content for onboarding or archival purposes.
$3
Analyze and understand legacy codebases before migration or modernization efforts.
$3
Share project context quickly with team members or stakeholders.
š Performance
Git-Ingest v2.0 delivers significant performance improvements:
- 10x faster than v1.0 for large projects
- Constant memory usage regardless of project size
- Streaming architecture prevents memory overflow
- Async operations ensure UI responsiveness
- Smart caching reduces redundant operations
$3
| Project Size | Files | Processing Time | Memory Usage |
| ------------ | ------ | --------------- | ------------ |
| Small | < 100 | < 2 seconds | < 50MB |
| Medium | 1,000 | < 10 seconds | < 100MB |
| Large | 10,000 | < 60 seconds | < 200MB |
š Security
Security is a top priority in Git-Ingest v2.0:
- No Command Injection: Safe clipboard operations
- Path Validation: Prevents directory traversal attacks
- Permission Respect: Works within user permissions
- Input Sanitization: All user inputs are validated
- No Data Persistence: Sensitive data is not cached
š Version 2.0 Improvements
Git-Ingest v2.0 represents a complete rewrite with focus on security, performance, and user experience:
$3
- ā
Eliminated command injection vulnerabilities
- ā
Added comprehensive input validation
- ā
Implemented secure clipboard operations
- ā
Added path traversal protection
$3
- ā
Converted to fully async operations
- ā
Implemented memory-efficient streaming
- ā
Added binary file detection
- ā
Optimized directory traversal
$3
- ā
Professional CLI with Commander.js
- ā
Real-time progress indicators
- ā
Colored output and better formatting
- ā
Enhanced error messages
- ā
Comprehensive help system
$3
- ā
Complete test suite with Jest
- ā
ESLint and Prettier configuration
- ā
Modular, maintainable code structure
- ā
Comprehensive documentation
š¤ Contributing
We welcome contributions! Please see our Contributing Guide for details on how to get started.
$3
1. Fork the repository
2. Create a feature branch:
git checkout -b feature/amazing-feature
3. Make your changes
4. Run tests: npm test
5. Lint code: npm run lint:fix
6. Commit changes: git commit -m 'Add amazing feature'
7. Push to branch: git push origin feature/amazing-feature`This project is licensed under the MIT License - see the LICENSE file for details.
- Commander.js for CLI argument parsing
- Chalk for terminal colors
- Ora for progress indicators
- ignore for gitignore support
- isbinaryfile for binary detection
- clipboardy for clipboard operations
---
Made with ā¤ļø by Aung Myo Kyaw
ā If you find Git-Ingest useful, please star the repository!